/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Survey Page Styles */
.survey-page {
  background: linear-gradient(135deg, #5b4a9e 0%, #7866b8 50%, #5b4a9e 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: #fef7e6;
  border-radius: 25px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 650px;
  width: 100%;
  padding: 45px;
  overflow-x: hidden;
  overflow-y: visible;
  box-sizing: border-box;
  position: relative;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.screen {
  display: none;
  animation: fadeIn 0.5s;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #667eea;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

p {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 25px;
  color: #666;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.input-field {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}

.input-field:focus {
  outline: none;
  border-color: #667eea;
}

.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 18px;
  font-size: 1.3rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #061275;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(6, 18, 117, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f0f0f0;
  color: #061275;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

/* Progress Bar Container with Wheels */
.progress-bar-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 30px auto;
  position: relative;
  width: 100%;
  max-width: 90%;
  overflow: visible;
}

.progress-wheel {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  z-index: 5;
}

.progress-wheel.left {
  margin-right: -10px;
}

.progress-wheel.right {
  margin-left: -10px;
}

.progress-bar {
  width: 65%;
  height: 16px;
  background: #c0c0c0;
  border-radius: 20px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  margin: 0;
}

.progress-fill {
  height: 100%;
  background: transparent;
  transition: width 0.4s ease;
  border-radius: 20px;
  position: relative;
}

.progress-star {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  transition: left 0.4s ease;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.question-counter {
  font-size: 1rem;
  color: #8f6f17;
  text-align: left;
  margin-bottom: 10px;
  font-weight: 500;
}

.question-text {
  font-size: 1.4rem;
  margin-bottom: 30px;
  color: #061275;
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: center;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.option-btn {
  width: 100%;
  padding: 18px 20px;
  font-size: 1.1rem;
  background: rgba(255, 250, 220, 0.6);
  border: 2px solid #8f6f17;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  color: #8f6f17;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: left;
}

.option-btn:hover {
  background: rgba(143, 111, 23, 0.15);
  border-color: #061275;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(143, 111, 23, 0.2);
}

.success-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

.success-id {
  font-size: 1.3rem;
  color: #667eea;
  margin: 20px 0;
}

/* Unique ID Display */
.participant-id-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 15px;
  text-align: center;
  margin: 30px 0;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.id-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.id-value {
  font-size: 2.5rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

/* Screenshot Prompt */
.screenshot-prompt {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.screenshot-text {
  font-size: 1.1rem;
  color: #856404;
  margin-bottom: 10px;
}

.screenshot-subtext {
  font-size: 0.95rem;
  color: #856404;
  margin: 0;
}

/* Checkbox Container */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  margin: 20px 0;
}

.screenshot-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.checkbox-container label {
  font-size: 1.1rem;
  color: #333;
  cursor: pointer;
  margin: 0;
  text-align: left;
}

/* Survey Input Fields */
.wisdom-header {
  font-size: 1.3rem;
  font-weight: 600;
  color: #8f6f17;
  margin-bottom: 20px;
  text-align: center;
}

.question-subtitle {
  font-size: 1rem;
  color: #8f6f17;
  margin-top: 10px;
  line-height: 1.6;
  text-align: center;
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 25px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-icon {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  object-fit: contain;
}

.option-btn.selected {
  background: #061275;
  color: #feefd2;
  border-color: #061275;
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(6, 18, 117, 0.3);
}

.input-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.input-fields-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 25px;
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #061275;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prediction-input {
  padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid #8f6f17;
  border-radius: 8px;
  transition: border-color 0.3s;
  background: rgba(255, 255, 255, 0.8);
  color: #061275;
}

.prediction-input:focus {
  outline: none;
  border-color: #061275;
  box-shadow: 0 0 0 3px rgba(6, 18, 117, 0.1);
}

.text-input {
  padding: 15px 20px;
  font-size: 1.2rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  transition: all 0.3s;
  width: 100%;
}

.text-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.disclaimer-text {
  font-size: 0.82rem;
  color: #8f6f17;
  background: rgba(255, 250, 220, 0.5);
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #8f6f17;
  margin-top: 15px;
  margin-bottom: 20px;
  text-align: left;
  white-space: pre-wrap;
}

.info-text {
  font-size: 1rem;
  color: #667eea;
  text-align: center;
  margin: 20px 0;
}

/* Answer Summary */
.answers-summary {
  background: #feefd2;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  max-height: 400px;
  overflow-y: auto;
}

.answers-summary h3 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.answer-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 2px solid #e0e0e0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.answer-item h4 {
  color: #8f6f17;
  font-size: 1.1rem;
  margin-bottom: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.answer-item p {
  font-size: 0.95rem;
  margin: 5px 0;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: #8f6f17;
}

/* Mobile responsive for input fields */
@media (max-width: 768px) {
  .input-fields-row {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Page Styles */
.dashboard-page {
  background: #feefd2;
  min-height: 100vh;
  padding: 30px 20px;
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-header {
  text-align: center;
  color: #061275;
  margin-bottom: 40px;
  position: relative;
}

.dashboard-header h1 {
  color: #061275;
  font-size: 2.8rem;
  margin-bottom: 30px;
}

.stats-summary {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.stat-box {
  background: rgba(102, 126, 234, 0.1);
  backdrop-filter: blur(10px);
  padding: 25px 40px;
  border-radius: 15px;
  border: 2px solid rgba(102, 126, 234, 0.3);
}

.stat-value {
  font-size: 3rem;
  font-weight: bold;
  color: #061275;
}

.stat-label {
  font-size: 1rem;
  color: #061275;
  margin-top: 5px;
}

.chart-container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin-bottom: 30px;
}

.chart-title {
  font-size: 1.8rem;
  color: #061275;
  margin-bottom: 30px;
  text-align: center;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.metric-label {
  font-size: 0.9rem;
  color: #667eea;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
  word-wrap: break-word;
}

/* Dashboard Breakdown Content Styles */
.breakdown-content {
  text-align: left;
  line-height: 1.6;
}

.breakdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
  font-size: 1.1rem;
}

.breakdown-percentage {
  font-weight: bold;
  color: #667eea;
  font-size: 1.3rem;
  min-width: 50px;
  flex-shrink: 0;
}

.breakdown-option-text {
  color: #333;
  font-size: 1.05rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Dashboard Consensus Content Styles */
.consensus-content {
  text-align: left;
  line-height: 1.6;
}

.consensus-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.consensus-label {
  color: #666;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

.consensus-value {
  color: #333;
  font-size: 1.5rem;
  font-weight: bold;
}

/* Increase Response Count font size */
#responseCount {
  font-size: 2.5rem !important;
}

.metric-sublabel {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

/* Histogram Section */
.histogram-section {
  margin-top: 30px;
}

.histogram-section h3 {
  font-size: 1.5rem;
  color: #667eea;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

canvas {
  max-height: 400px;
}

/* Notification Popup */
.notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

/* Branding Footer */
.branding-footer {
  text-align: center;
  padding: 20px;
  margin-top: 30px;
  border-top: 1px solid #e0e0e0;
}

.branding-footer p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

.branding-footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.branding-footer a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Dashboard Page Footer Override */
.dashboard-page .branding-footer {
  border-top: 2px solid #8f6f17;
}

.dashboard-page .branding-footer p {
  color: #666;
}

.dashboard-page .branding-footer a {
  color: #061275;
  font-weight: 700;
}

.dashboard-page .branding-footer a:hover {
  color: #667eea;
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .container {
    padding: 30px 20px;
    overflow-x: hidden;
  }

  /* Footer logos - reduce size on mobile */
  .footer-logo {
    height: 28px !important;
  }

  /* Smaller wheels on tablets */
  .progress-wheel {
    width: 45px;
    height: 45px;
  }

  .progress-bar-container {
    max-width: 95%;
  }

  .progress-bar {
    width: 60%;
  }

  h1 {
    font-size: 2rem;
  }

  .question-text {
    font-size: 1.2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .option-btn {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }

  .option-btn {
    font-size: 1.1rem;
    padding: 18px;
  }

  .dashboard-header h1 {
    font-size: 2rem;
  }

  .chart-container {
    padding: 25px 15px;
  }

  .chart-title {
    font-size: 1.3rem;
    line-height: 1.5;
    padding: 0 10px;
  }

  .histogram-section h3 {
    font-size: 1.2rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .participant-id-box {
    padding: 20px 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .id-value {
    font-size: 2rem;
    letter-spacing: 1px;
  }

  .notification {
    bottom: 20px;
    right: 20px;
    left: 20px;
    font-size: 1rem;
  }

  /* Dashboard metrics mobile styles */
  .breakdown-item {
    flex-direction: column;
    gap: 5px;
  }

  .breakdown-percentage {
    font-size: 1.2rem;
  }

  .breakdown-option-text {
    font-size: 1rem;
  }

  .consensus-value {
    font-size: 1.3rem;
  }

  #responseCount {
    font-size: 2rem !important;
  }

  .chart-title {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  .histogram-section h3 {
    font-size: 1.1rem;
  }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
  .container {
    padding: 20px 15px;
  }

  /* Even smaller wheels on phones */
  .progress-wheel {
    width: 35px;
    height: 35px;
  }

  .progress-wheel.left {
    margin-right: -5px;
  }

  .progress-wheel.right {
    margin-left: -5px;
  }

  .progress-bar-container {
    max-width: 98%;
    margin: 15px auto 25px auto;
  }

  .progress-bar {
    width: 55%;
  }

  /* Add top margin to question counter to prevent overlap */
  .question-counter {
    margin-top: 10px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .participant-id-box {
    padding: 15px 10px;
    margin: 20px 0;
  }

  .id-label {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
  }

  .id-value {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
  }
}

/* Extra small mobile devices (360px and below) */
@media (max-width: 360px) {
  .container {
    padding: 15px 10px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .participant-id-box {
    padding: 12px 8px;
    margin: 15px 0;
  }

  .id-label {
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
  }

  .id-value {
    font-size: 1.2rem;
    letter-spacing: 0.3px;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
  }
}

/* Compact styling for final screenshot confirmation page */
#finalConfirmScreen h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

#finalConfirmScreen>p {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

#finalConfirmScreen .participant-id-box {
  padding: 12px;
  margin: 12px 0;
}

#finalConfirmScreen .id-label {
  font-size: 0.75rem;
  margin-bottom: 5px;
}

#finalConfirmScreen .id-value {
  font-size: 1.4rem;
  letter-spacing: 1px;
}

#finalConfirmScreen .answers-summary {
  padding: 12px;
  margin: 12px 0;
  max-height: none;
  overflow-y: visible;
}

#finalConfirmScreen .answers-summary h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

#finalConfirmScreen .answer-item {
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
}

#finalConfirmScreen .answer-item h4 {
  font-size: 0.85rem;
  margin-bottom: 5px;
}

#finalConfirmScreen .answer-item p {
  font-size: 0.75rem;
  margin: 3px 0;
}

#finalConfirmScreen .screenshot-prompt {
  padding: 10px;
  margin: 10px 0;
}

#finalConfirmScreen .screenshot-text {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

#finalConfirmScreen .screenshot-subtext {
  font-size: 0.8rem;
}

#finalConfirmScreen .checkbox-container {
  padding: 8px;
  margin: 10px 0;
}

#finalConfirmScreen .checkbox-container label {
  font-size: 0.9rem;
}

#finalConfirmScreen .btn-primary {
  padding: 12px;
  font-size: 1.1rem;
}

/* Reduce container padding for final screen to fit more content */
body:has(#finalConfirmScreen.active) .container {
  padding: 20px;
}

/* Removed emoji wheels - replaced with decorative wheels on progress bar */

.screen {
  position: relative;
}

/* Custom Footer for Question Screens */
.survey-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #8f6f17;
}

/* Footer logos are now inline, no separate left/right classes needed */

/* Decorative Elements for Dashboard */
.decorative-wheel-dashboard {
  position: absolute;
  width: 150px;
  height: 150px;
  z-index: 5;
}

.decorative-wheel-dashboard.left {
  top: -10px;
  left: -38px;
}

.decorative-wheel-dashboard.right {
  top: -10px;
  right: -38px;
}