/* ============================================
   Theme System for Mindful Dining
   Three themes: Default, Anime, Stranger Things
   ============================================ */

/* Theme Switcher UI */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-left: var(--spacing-xl);
  flex-shrink: 0;
}

.theme-switcher-label {
  font-size: var(--font-size-xs);
  color: var(--color-neutral-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  display: none; /* Hidden on mobile, available on desktop */
}

.theme-buttons {
  display: flex;
  gap: var(--spacing-xs);
  background: var(--color-neutral-100);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-neutral-200);
}

.theme-button {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--color-neutral-600);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-button:hover {
  background: var(--color-neutral-200);
}

.theme-button.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.theme-button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Show label on larger screens */
@media (min-width: 769px) {
  .theme-switcher-label {
    display: block;
  }
}

/* Mobile adjustments for theme switcher */
@media (max-width: 768px) {
  .theme-switcher {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0) + 12px);
    right: calc(env(safe-area-inset-right, 0) + 12px);
    z-index: 1100;
    background: rgba(250, 250, 249, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-neutral-200);
    margin-left: 0;
    box-shadow: var(--shadow-md);
  }
  
  .theme-buttons {
    gap: 4px;
    padding: 0;
    background: transparent;
    border: none;
  }
  
  .theme-button {
    padding: 8px 12px;
    font-size: 0.75rem;
    min-height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 480px) {
  .theme-switcher {
    top: calc(env(safe-area-inset-top, 0) + 10px);
    right: calc(env(safe-area-inset-right, 0) + 10px);
    padding: 6px;
  }
  
  .theme-button {
    padding: 8px 10px;
    font-size: 0.75rem;
    min-height: 44px;
    min-width: 44px;
  }
}

/* Character Avatar Cards Container */
.theme-avatars {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 12px;
  z-index: 999;
  pointer-events: none;
}

.theme-avatars.show {
  display: flex;
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.avatar-card {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid white;
  transition: transform var(--transition-base);
  pointer-events: auto;
}

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

.avatar-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile adjustments for avatars */
@media (max-width: 768px) {
  .theme-avatars {
    bottom: 10px;
    right: 10px;
    gap: 8px;
  }
  
  .avatar-card {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .theme-avatars {
    bottom: 8px;
    right: 8px;
    gap: 6px;
  }
  
  .avatar-card {
    width: 50px;
    height: 50px;
    border-width: 2px;
  }
}

/* ============================================
   ANIME THEME
   ============================================ */
body[data-theme="anime"] {
  /* Pastel Color Palette */
  --color-primary: #FF9AA2;           /* Soft pink */
  --color-primary-dark: #FF8094;      /* Deeper pink */
  --color-primary-light: #FFB3BB;     /* Light pink */
  --color-accent: #FFD4A3;            /* Peach */
  
  --color-neutral-50: #FFF8F5;        /* Warm cream */
  --color-neutral-100: #FFF0E6;       /* Light peach */
  --color-neutral-200: #FFE4D9;       /* Soft borders */
  --color-neutral-300: #FFDCCC;       /* Pastel borders */
  --color-neutral-400: #C9A89D;       /* Muted text */
  --color-neutral-600: #7A6B66;       /* Body text */
  --color-neutral-700: #5A4A45;       /* Headings */
  --color-neutral-900: #3D2E29;       /* Deep text */
  
  --color-success: #B5E7A0;
  --color-success-light: #E8F9E1;
  --color-error: #FFABAB;
  --color-error-light: #FFE9E9;
}

body[data-theme="anime"] .hero-section {
  background: linear-gradient(135deg, 
    rgba(255, 154, 162, 0.15) 0%, 
    rgba(255, 212, 163, 0.15) 50%,
    rgba(181, 231, 160, 0.15) 100%),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><defs><linearGradient id="animeGrad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23FFF8F5;stop-opacity:1" /><stop offset="50%" style="stop-color:%23FFF0E6;stop-opacity:1" /><stop offset="100%" style="stop-color:%23FFE4D9;stop-opacity:1" /></linearGradient></defs><rect width="1200" height="800" fill="url(%23animeGrad)"/><circle cx="150" cy="150" r="200" fill="%23FFB3BB" opacity="0.3"/><circle cx="1050" cy="650" r="250" fill="%23B5E7A0" opacity="0.3"/><circle cx="600" cy="400" r="180" fill="%23FFD4A3" opacity="0.25"/></svg>');
  background-size: cover;
  background-position: center;
}

body[data-theme="anime"] .navbar {
  background-color: rgba(255, 248, 245, 0.95);
}

body[data-theme="anime"] .theme-button.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
}

body[data-theme="anime"] .step-number,
body[data-theme="anime"] .cta-button,
body[data-theme="anime"] .submit-button,
body[data-theme="anime"] .button.primary,
body[data-theme="anime"] .nav-button.primary {
  background: linear-gradient(135deg, #FF9AA2 0%, #FFD4A3 100%);
}

body[data-theme="anime"] .cta-button:hover,
body[data-theme="anime"] .submit-button:hover,
body[data-theme="anime"] .button.primary:hover,
body[data-theme="anime"] .nav-button.primary:hover {
  background: linear-gradient(135deg, #FFD4A3 0%, #FF9AA2 100%);
}

body[data-theme="anime"] .test-header {
  background: linear-gradient(135deg, #FF9AA2 0%, #FFD4A3 100%);
}

/* Softer shadows for anime theme */
body[data-theme="anime"] .step,
body[data-theme="anime"] .reservation-form-container,
body[data-theme="anime"] .test-container,
body[data-theme="anime"] .confirmation-container {
  box-shadow: 0 8px 20px rgba(255, 154, 162, 0.15);
}

/* ============================================
   STRANGER THINGS THEME
   ============================================ */
body[data-theme="stranger"] {
  /* Dark & Neon Palette */
  --color-primary: #FF3366;           /* Neon pink */
  --color-primary-dark: #CC0033;      /* Deep red */
  --color-primary-light: #FF6699;     /* Light neon pink */
  --color-accent: #00FFFF;            /* Cyan */
  
  --color-neutral-50: #0D0D0D;        /* Near black */
  --color-neutral-100: #1A1A1A;       /* Dark bg */
  --color-neutral-200: #2D2D2D;       /* Borders */
  --color-neutral-300: #404040;       /* Light borders */
  --color-neutral-400: #808080;       /* Muted text */
  --color-neutral-600: #B3B3B3;       /* Body text */
  --color-neutral-700: #E6E6E6;       /* Headings */
  --color-neutral-900: #FFFFFF;       /* Bright text */
  
  --color-success: #00FF88;
  --color-success-light: #1A2E26;
  --color-error: #FF3366;
  --color-error-light: #2E1A1F;
  
  /* Neon glow effects */
  --neon-glow: 0 0 10px rgba(255, 51, 102, 0.5), 0 0 20px rgba(255, 51, 102, 0.3);
  --cyan-glow: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 20px rgba(0, 255, 255, 0.3);
}

body[data-theme="stranger"] {
  background-color: var(--color-neutral-50);
  color: var(--color-neutral-600);
}

body[data-theme="stranger"] .hero-section {
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(255, 51, 102, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #0D0D0D 0%, #1A1A1A 100%);
}

body[data-theme="stranger"] .navbar {
  background-color: rgba(13, 13, 13, 0.95);
  border-bottom: 2px solid rgba(255, 51, 102, 0.3);
}

body[data-theme="stranger"] .logo h1 {
  color: var(--color-primary);
  text-shadow: var(--neon-glow);
  font-weight: 700;
  letter-spacing: 0.1em;
}

body[data-theme="stranger"] h1,
body[data-theme="stranger"] h2,
body[data-theme="stranger"] h3 {
  color: var(--color-neutral-700);
  text-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
}

body[data-theme="stranger"] .hero-title {
  color: var(--color-neutral-900);
  text-shadow: var(--neon-glow);
}

body[data-theme="stranger"] .about-section,
body[data-theme="stranger"] .contact-section {
  background-color: var(--color-neutral-100);
}

body[data-theme="stranger"] .how-it-works-section {
  background: linear-gradient(180deg, 
    var(--color-neutral-100) 0%, 
    var(--color-neutral-50) 100%);
}

body[data-theme="stranger"] .step {
  background-color: var(--color-neutral-100);
  border-color: var(--color-neutral-300);
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.2);
}

body[data-theme="stranger"] .step:hover {
  border-color: var(--color-primary);
  box-shadow: var(--neon-glow), 0 8px 25px rgba(255, 51, 102, 0.3);
}

body[data-theme="stranger"] .step-number {
  background: var(--color-primary);
  box-shadow: var(--neon-glow);
}

body[data-theme="stranger"] .cta-button,
body[data-theme="stranger"] .submit-button,
body[data-theme="stranger"] .button.primary,
body[data-theme="stranger"] .nav-button.primary {
  background: var(--color-primary);
  box-shadow: var(--neon-glow);
  border: 2px solid var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

body[data-theme="stranger"] .cta-button:hover,
body[data-theme="stranger"] .submit-button:hover,
body[data-theme="stranger"] .button.primary:hover,
body[data-theme="stranger"] .nav-button.primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.8), 0 0 40px rgba(255, 51, 102, 0.5);
}

body[data-theme="stranger"] .button.secondary,
body[data-theme="stranger"] .nav-button.secondary {
  background-color: var(--color-neutral-100);
  color: var(--color-neutral-700);
  border-color: var(--color-neutral-300);
}

body[data-theme="stranger"] .reservation-main,
body[data-theme="stranger"] .test-main,
body[data-theme="stranger"] .confirmation-main {
  background: linear-gradient(180deg, 
    var(--color-neutral-50) 0%, 
    var(--color-neutral-100) 100%);
}

body[data-theme="stranger"] .reservation-form-container,
body[data-theme="stranger"] .test-container,
body[data-theme="stranger"] .confirmation-container {
  background-color: var(--color-neutral-100);
  border-color: var(--color-neutral-300);
  box-shadow: 0 0 30px rgba(255, 51, 102, 0.2);
}

body[data-theme="stranger"] .form-group input,
body[data-theme="stranger"] .form-group select,
body[data-theme="stranger"] .form-group textarea {
  background-color: var(--color-neutral-50);
  border-color: var(--color-neutral-300);
  color: var(--color-neutral-700);
}

body[data-theme="stranger"] .form-group input:focus,
body[data-theme="stranger"] .form-group select:focus,
body[data-theme="stranger"] .form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: var(--neon-glow);
}

body[data-theme="stranger"] .test-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  box-shadow: 0 4px 20px rgba(255, 51, 102, 0.4);
}

body[data-theme="stranger"] .option {
  background-color: var(--color-neutral-50);
  border-color: var(--color-neutral-300);
  color: var(--color-neutral-600);
}

body[data-theme="stranger"] .option:hover {
  border-color: var(--color-primary);
  background-color: var(--color-neutral-100);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

body[data-theme="stranger"] .option.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: var(--neon-glow);
}

body[data-theme="stranger"] .pricing-info,
body[data-theme="stranger"] .reservation-details {
  background: var(--color-neutral-50);
  border-color: var(--color-neutral-300);
}

body[data-theme="stranger"] footer {
  background: linear-gradient(135deg, 
    var(--color-neutral-100) 0%, 
    var(--color-neutral-50) 100%);
  border-top: 2px solid rgba(255, 51, 102, 0.3);
}

body[data-theme="stranger"] .nav-menu a::after {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
}

body[data-theme="stranger"] .theme-button.active {
  background: var(--color-primary);
  box-shadow: var(--neon-glow);
}

/* Neon accent for theme avatars in stranger theme */
body[data-theme="stranger"] .avatar-card {
  border-color: var(--color-primary);
  box-shadow: var(--neon-glow), var(--shadow-lg);
}

body[data-theme="stranger"] .avatar-card:hover {
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.8), 0 0 40px rgba(255, 51, 102, 0.5);
}

/* Accessibility - maintain contrast in dark theme */
body[data-theme="stranger"] .form-group label {
  color: var(--color-neutral-700);
}

body[data-theme="stranger"] *:focus-visible {
  outline-color: var(--color-primary);
  box-shadow: var(--neon-glow);
}
