/**
 * TechConcepts Chat UI - Apple Design System
 * Version 2.0 - Complete redesign with Apple-level polish
 */

/* ========================================
   CSS Variables - Apple Design System
   ======================================== */

:root {
  /* Typography - SF Pro stack */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;

  /* Colors - Apple palette */
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F5F5F7;
  --color-bg-tertiary: #FAFAFA;
  --color-text-primary: #1D1D1F;
  --color-text-secondary: #86868B;
  --color-text-tertiary: #6E6E73;
  --color-accent-blue: #007AFF;
  --color-accent-blue-hover: #0066CC;
  --color-accent-blue-active: #004C99;
  --color-success: #30D158;
  --color-success-bg: #F0FDF4;
  --color-warning: #FF453A;
  --color-warning-bg: #FEF2F2;

  /* Spacing - 8px grid */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;

  /* Shadows - Multi-layer Apple style */
  --shadow-sm:
    0 2px 4px rgba(0, 0, 0, 0.02),
    0 4px 8px rgba(0, 0, 0, 0.03);
  --shadow-md:
    0 2px 4px rgba(0, 0, 0, 0.02),
    0 8px 16px rgba(0, 0, 0, 0.03),
    0 16px 32px rgba(0, 0, 0, 0.04);
  --shadow-lg:
    0 4px 8px rgba(0, 0, 0, 0.02),
    0 12px 24px rgba(0, 0, 0, 0.03),
    0 24px 48px rgba(0, 0, 0, 0.05),
    0 32px 64px rgba(0, 0, 0, 0.06);
  --shadow-lifted:
    0 8px 16px rgba(0, 0, 0, 0.04),
    0 16px 32px rgba(0, 0, 0, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.08);

  /* Easing - Apple spring physics */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(20px);
  --glass-saturate: saturate(180%);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-primary: #000000;
    --color-bg-secondary: #1C1C1E;
    --color-bg-tertiary: #2C2C2E;
    --color-text-primary: #F5F5F7;
    --color-text-secondary: #98989D;
    --color-text-tertiary: #86868B;
    --color-accent-blue: #0A84FF;
    --color-accent-blue-hover: #409CFF;
    --color-accent-blue-active: #0070F0;
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
  }
}

/* ========================================
   Base Reset
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Main Container
   ======================================== */

.chat-container {
  max-width: 760px;
  margin: -24px auto var(--space-2xl);
  background: var(--color-bg-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  z-index: 2;
  font-family: var(--font-system);
}

/* ========================================
   Progress Bar - Apple Style
   ======================================== */

.chat-progress {
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.chat-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-blue) 0%, #5AC8FA 100%);
  border-radius: var(--radius-sm);
  transition: width 0.6s var(--ease-out);
  width: 0;
  position: relative;
  overflow: hidden;
}

/* Progress shimmer effect */
.chat-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.chat-progress-text {
  position: absolute;
  top: 50%;
  right: var(--space-md);
  transform: translateY(-50%);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ========================================
   Messages Area
   ======================================== */

.chat-messages {
  min-height: 450px;
  max-height: 600px;
  overflow-y: auto;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--color-bg-secondary);
  scroll-behavior: smooth;
}

.chat-message {
  display: flex;
  margin-bottom: var(--space-md);
  animation: slideUp 0.4s var(--ease-out) backwards;
}

.chat-message.bot {
  justify-content: flex-start;
}

.chat-message.user {
  justify-content: flex-end;
}

/* ========================================
   Chat Bubbles - Apple Messages Style
   ======================================== */

.chat-bubble {
  max-width: 72%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-xl);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
  font-weight: 400;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-out);
}

.bot .chat-bubble {
  background: var(--color-accent-blue);
  color: white;
  border-bottom-left-radius: 6px;
}

.user .chat-bubble {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border-bottom-right-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-emoji {
  font-size: 1.25em;
  margin-right: 6px;
  display: inline-block;
  animation: emojiPop 0.5s var(--ease-bounce);
}

@keyframes emojiPop {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-12deg);
  }
  50% {
    transform: scale(1.1) rotate(8deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* ========================================
   Typing Indicator - Apple Style
   ======================================== */

.typing-indicator .chat-bubble {
  padding: 20px var(--space-md);
  background: var(--color-accent-blue);
}

.typing-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.8);
  animation: typingBounce 0.6s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0ms;
}

.typing-dots span:nth-child(2) {
  animation-delay: 200ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 400ms;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.8;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ========================================
   Input Area
   ======================================== */

.chat-input-area {
  padding: var(--space-lg);
  background: var(--color-bg-primary);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  min-height: 96px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* ========================================
   Buttons - Apple Style
   ======================================== */

.chat-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chat-button {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-primary);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-system);
  position: relative;
  overflow: hidden;
}

.chat-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,122,255,0.05), rgba(90,200,250,0.05));
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.chat-button:hover {
  border-color: var(--color-accent-blue);
  background: rgba(0, 122, 255, 0.04);
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.chat-button:hover::before {
  opacity: 1;
}

.chat-button:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.button-emoji {
  font-size: 1.25em;
  display: inline-block;
  transition: transform 0.2s var(--ease-out);
}

.chat-button:hover .button-emoji {
  transform: scale(1.15);
}

.yes-button:hover {
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

.no-button:hover {
  border-color: var(--color-warning);
  background: var(--color-warning-bg);
}

/* ========================================
   Input Fields - Apple Style
   ======================================== */

.chat-input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.chat-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  outline: none;
  transition: all 0.3s var(--ease-out);
  font-family: var(--font-system);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
}

.chat-input::placeholder {
  color: var(--color-text-secondary);
}

.chat-input:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
  background: white;
}

/* ========================================
   Submit Button - Apple Style
   ======================================== */

.chat-submit-btn {
  width: 56px;
  height: 56px;
  background: var(--color-accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.75rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-system);
}

.chat-submit-btn:hover {
  background: var(--color-accent-blue-hover);
  transform: translateX(3px) scale(1.05);
  box-shadow: var(--shadow-md);
}

.chat-submit-btn:active {
  transform: translateX(1px) scale(0.95);
  transition-duration: 0.1s;
}

/* ========================================
   Feedback Indicator
   ======================================== */

.chat-feedback {
  text-align: right;
  font-size: 1.75rem;
  animation: feedbackPop 0.5s var(--ease-bounce);
  margin-top: -8px;
  margin-bottom: var(--space-xs);
  color: var(--color-success);
  filter: drop-shadow(0 2px 4px rgba(48, 209, 88, 0.3));
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-45deg);
  }
  50% {
    transform: scale(1.3) rotate(12deg);
  }
  70% {
    transform: scale(0.9) rotate(-6deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* ========================================
   Results Card - Glassmorphism
   ======================================== */

.chat-results-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin: var(--space-md) 0;
  box-shadow: var(--shadow-lg);
  animation: resultsCardFadeIn 0.8s var(--ease-out);
}

@keyframes resultsCardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    backdrop-filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
  }
}

.chat-results-card h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
  text-align: center;
  animation: resultsCardTitle 0.6s var(--ease-out) 200ms backwards;
}

@keyframes resultsCardTitle {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Result Rows
   ======================================== */

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  animation: resultsCardRow 0.5s var(--ease-out) backwards;
}

.result-row:nth-child(2) { animation-delay: 300ms; }
.result-row:nth-child(3) { animation-delay: 400ms; }
.result-row:nth-child(4) { animation-delay: 500ms; }
.result-row:nth-child(5) { animation-delay: 600ms; }
.result-row:nth-child(6) { animation-delay: 700ms; }

@keyframes resultsCardRow {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-accent-blue);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s var(--ease-out);
}

.result-value.highlight {
  color: var(--color-success);
  animation: valueHighlight 0.6s var(--ease-bounce);
}

@keyframes valueHighlight {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ========================================
   Share Buttons
   ======================================== */

.chat-share-buttons {
  margin: var(--space-md) 0;
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  animation: fadeIn 0.6s var(--ease-out) 1s backwards;
}

.chat-share-buttons p {
  text-align: center;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.share-button-group {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  transition: all 0.2s var(--ease-out);
  font-family: var(--font-system);
  box-shadow: var(--shadow-sm);
}

.share-btn.twitter {
  background: #1DA1F2;
  color: white;
}

.share-btn.linkedin {
  background: #0077B5;
  color: white;
}

.share-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lifted);
}

.share-btn:active {
  transform: translateY(-1px) scale(0.98);
  transition-duration: 0.1s;
}

/* ========================================
   Animations
   ======================================== */

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.fade-in {
  animation: slideUp 0.4s var(--ease-out);
}

/* ========================================
   Scrollbar - Apple Style
   ======================================== */

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 600px) {
  :root {
    --space-2xl: 48px;
    --space-xl: 32px;
    --space-lg: 24px;
  }

  .chat-container {
    margin: -12px 12px var(--space-lg);
    border-radius: var(--radius-xl);
  }

  .chat-messages {
    min-height: 400px;
    max-height: 500px;
    padding: var(--space-lg) var(--space-sm);
  }

  .chat-input-area {
    padding: var(--space-sm);
  }

  .chat-bubble {
    max-width: 85%;
    font-size: 1rem;
  }

  .chat-button {
    padding: 14px var(--space-sm);
    font-size: 0.9375rem;
  }

  .chat-results-card {
    padding: var(--space-md);
  }

  .share-button-group {
    flex-direction: column;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   Accessibility
   ======================================== */

.chat-button:focus-visible,
.chat-input:focus-visible,
.chat-submit-btn:focus-visible {
  outline: 3px solid var(--color-accent-blue);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .chat-button {
    border-width: 3px;
  }

  .chat-input {
    border-width: 3px;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .chat-progress-bar::after {
    animation: none;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .chat-container {
    box-shadow: none;
    border: 1px solid #000;
  }

  .chat-input-area {
    display: none;
  }

  .chat-share-buttons {
    display: none;
  }
}

/* ========================================
   Mode Toggle - iOS Segmented Control
   ======================================== */

.mode-toggle {
  display: flex;
  gap: 4px;
  padding: var(--space-sm);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  justify-content: center;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  font-family: var(--font-system);
  position: relative;
}

.mode-btn .icon {
  font-size: 1.125em;
  transition: transform 0.2s var(--ease-out);
}

.mode-btn:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.mode-btn.active {
  background: white;
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

.mode-btn.active .icon {
  transform: scale(1.1);
}

/* ========================================
   Survey Mode Container
   ======================================== */

.survey-mode {
  background: var(--color-bg-primary);
  min-height: 500px;
}

.survey-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
}

/* ========================================
   Survey Progress Circle
   ======================================== */

.survey-progress-circle {
  position: fixed;
  top: 100px;
  right: 40px;
  z-index: 100;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.survey-progress-circle svg {
  transform: scale(1);
  transition: transform 0.3s var(--ease-out);
}

.survey-progress-circle:hover svg {
  transform: scale(1.05);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: var(--font-system);
}

.progress-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1;
}

.progress-total {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.progress-ring {
  transition: stroke-dashoffset 0.6s var(--ease-out);
}

/* ========================================
   Survey Questions Container
   ======================================== */

.survey-questions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ========================================
   Question Card - Apple Style
   ======================================== */

.question-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-out);
  border: 2px solid transparent;
  position: relative;
  animation: slideUp 0.4s var(--ease-out) backwards;
}

.question-card:nth-child(1) { animation-delay: 0ms; }
.question-card:nth-child(2) { animation-delay: 100ms; }
.question-card:nth-child(3) { animation-delay: 200ms; }
.question-card:nth-child(4) { animation-delay: 300ms; }
.question-card:nth-child(5) { animation-delay: 400ms; }

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.question-card.answered {
  border-left: 4px solid var(--color-success);
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.02) 0%, rgba(48, 209, 88, 0.01) 100%);
}

/* ========================================
   Question Header
   ======================================== */

.question-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  position: relative;
}

.question-emoji {
  font-size: 1.5rem;
  transition: transform 0.3s var(--ease-out);
}

.question-card:hover .question-emoji {
  transform: scale(1.1) rotate(5deg);
}

.question-title {
  flex: 1;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  line-height: 1.4;
}

.question-checkmark {
  font-size: 1.25rem;
  color: var(--color-success);
  opacity: 0;
  transform: scale(0.5) rotate(-45deg);
  transition: all 0.3s var(--ease-bounce);
}

.question-card.answered .question-checkmark {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ========================================
   Question Input Area
   ======================================== */

.question-input {
  margin-top: var(--space-sm);
}

/* ========================================
   Toggle Switch (Yes/No) - iOS Style
   ======================================== */

.toggle-switch {
  display: flex;
  gap: var(--space-xs);
  width: 100%;
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px var(--space-sm);
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-family: var(--font-system);
}

.toggle-emoji {
  font-size: 1.125em;
  transition: transform 0.2s var(--ease-out);
}

.toggle-option:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-accent-blue);
  transform: scale(1.02);
}

.toggle-option.selected {
  background: var(--color-accent-blue);
  color: white;
  border-color: var(--color-accent-blue);
  box-shadow: var(--shadow-md);
}

.toggle-option.selected .toggle-emoji {
  transform: scale(1.2);
}

/* ========================================
   Choice Options
   ======================================== */

.choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xs);
}

.choice-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px var(--space-sm);
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-family: var(--font-system);
  text-align: center;
}

.choice-emoji {
  font-size: 1.25em;
  transition: transform 0.2s var(--ease-out);
}

.choice-option:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.choice-option.selected {
  background: var(--color-accent-blue);
  color: white;
  border-color: var(--color-accent-blue);
  box-shadow: var(--shadow-md);
}

.choice-option.selected .choice-emoji {
  transform: scale(1.15);
}

/* ========================================
   Number Input with Slider
   ======================================== */

.number-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.survey-number-input {
  width: 100%;
  padding: 14px var(--space-md);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  outline: none;
  transition: all 0.3s var(--ease-out);
  font-family: var(--font-system);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  font-variant-numeric: tabular-nums;
}

.survey-number-input:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
  background: white;
}

.slider-track {
  padding: 0 4px;
}

.survey-slider {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-accent-blue) 0%, #5AC8FA 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.survey-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s var(--ease-out);
}

.survey-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.survey-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s var(--ease-out);
}

.survey-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ========================================
   Text Input
   ======================================== */

.survey-text-input {
  width: 100%;
  padding: 14px var(--space-md);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  outline: none;
  transition: all 0.3s var(--ease-out);
  font-family: var(--font-system);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  resize: vertical;
  min-height: 80px;
}

.survey-text-input:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
  background: white;
}

/* ========================================
   Email Input
   ======================================== */

.survey-email-input {
  width: 100%;
  padding: 14px var(--space-md);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  outline: none;
  transition: all 0.3s var(--ease-out);
  font-family: var(--font-system);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
}

.survey-email-input:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
  background: white;
}

/* ========================================
   Confetti Animation
   ======================================== */

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  top: -10px;
  z-index: 1000;
  animation: confettiFall linear forwards;
  pointer-events: none;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========================================
   Survey Mode Mobile Responsive
   ======================================== */

@media (max-width: 768px) {
  .survey-container {
    padding: var(--space-lg) var(--space-sm);
  }

  .survey-progress-circle {
    position: static;
    margin: 0 auto var(--space-lg);
    width: fit-content;
  }

  .choice-options {
    grid-template-columns: 1fr;
  }

  .toggle-switch {
    flex-direction: column;
  }

  .mode-toggle {
    padding: var(--space-xs);
  }

  .mode-btn {
    padding: 8px 16px;
    font-size: 0.875rem;
  }
}
