/* Dark Theme System - Optimized for Accessibility and Performance */

/* CSS Custom Properties for Dark Theme */
:root {
  /* Light theme (default) colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f5f2;
  --bg-surface: #ffffff;
  --text-primary: #2b2b2b;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --brand-primary: #800020;
  --brand-secondary: #b87333;
  --brand-accent: #ffd700;
  
  /* Button colors */
  --btn-primary-bg: linear-gradient(135deg, #800020 0%, #b87333 50%, #a0002a 100%);
  --btn-primary-color: #ffffff;
  --btn-secondary-bg: rgba(255, 255, 255, 0.1);
  --btn-secondary-color: #ffffff;
  --btn-secondary-border: rgba(255, 255, 255, 0.3);
  
  /* Focus and interaction states */
  --focus-outline: 3px solid rgba(255, 215, 0, 0.5);
  --hover-transform: translateY(-2px) scale(1.02);
}

/* Dark theme overrides */
.theme-dark {
  --bg-primary: #0f1113;
  --bg-secondary: #151718;
  --bg-surface: #1b1e20;
  --text-primary: #e6eef3;
  --text-secondary: #b8c5d1;
  --text-muted: #9aa0a6;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.5);
  --brand-primary: #ff6b6b;
  --brand-secondary: #ffb347;
  --brand-accent: #ffd86b;
  
  /* Dark theme button colors */
  --btn-primary-bg: linear-gradient(135deg, #8b1a2a 0%, #b4552f 100%);
  --btn-primary-color: #ffffff;
  --btn-secondary-bg: rgba(255, 255, 255, 0.08);
  --btn-secondary-color: var(--text-primary);
  --btn-secondary-border: rgba(255, 255, 255, 0.12);
  
  /* Enhanced focus visibility in dark mode */
  --focus-outline: 3px solid rgba(255, 215, 107, 0.6);
}

/* Apply theme colors to body */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme specific overrides */
.theme-dark {
  color-scheme: dark;
}

.theme-dark body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Navigation overrides */
.theme-dark .navbar {
  background: rgba(15, 17, 19, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
}

.theme-dark .nav-link {
  color: var(--text-secondary);
}

.theme-dark .nav-link:hover {
  color: var(--brand-accent);
}

/* Button optimizations */
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border: none;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: var(--hover-transform);
  box-shadow: 0 8px 25px var(--shadow-medium);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 2px solid var(--btn-secondary-border);
  backdrop-filter: blur(15px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--brand-accent);
  color: var(--brand-accent);
  transform: var(--hover-transform);
}

/* Hero section dark theme */
.theme-dark .hero {
  background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5)),
                    url('https://images.unsplash.com/photo-1555939594-58d7cb561ad1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
}

/* Card and surface optimizations */
.theme-dark .menu-item,
.theme-dark .feature,
.theme-dark .achievement,
.theme-dark .testimonial,
.theme-dark .contact-item,
.theme-dark .gallery-item {
  background: linear-gradient(145deg, var(--bg-surface), var(--bg-secondary));
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--shadow-light);
}

.theme-dark .menu-item:hover,
.theme-dark .feature:hover,
.theme-dark .achievement:hover,
.theme-dark .contact-item:hover {
  background: linear-gradient(145deg, #1e2225, var(--bg-surface));
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--shadow-medium);
}

/* Typography optimizations */
.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4 {
  color: var(--text-primary);
}

.theme-dark p,
.theme-dark .text-secondary {
  color: var(--text-secondary);
}

.theme-dark .text-muted {
  color: var(--text-muted);
}

/* Link colors */
.theme-dark a {
  color: var(--brand-accent);
  transition: color 0.3s ease;
}

.theme-dark a:hover {
  color: var(--brand-primary);
}

/* Form elements comprehensive styling */
.theme-dark input,
.theme-dark textarea,
.theme-dark select {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.theme-dark input:focus,
.theme-dark textarea:focus,
.theme-dark select:focus {
  outline: var(--focus-outline) !important;
  background: var(--bg-secondary) !important;
  border-color: var(--brand-accent) !important;
}

.theme-dark .form-group input,
.theme-dark .form-group textarea,
.theme-dark .form-group select {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.theme-dark .form-group input::placeholder,
.theme-dark .form-group textarea::placeholder {
  color: var(--text-muted) !important;
}

/* Footer */
.theme-dark .footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  transform: scale(1.05);
}

.theme-toggle i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.theme-dark .theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Accessibility enhancements */
.theme-dark *:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .theme-dark,
  .theme-dark * {
    transition: none !important;
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .theme-dark {
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --border-color: rgba(255, 255, 255, 0.2);
  }
}

/* Component-specific dark theme optimizations */

/* Menu items */
.theme-dark .menu-item .item-info h4 {
  color: var(--text-primary);
}

.theme-dark .menu-item .item-info p {
  color: var(--text-secondary);
  opacity: 0.9;
}

.theme-dark .menu-item .price {
  background: linear-gradient(120deg, #8b1a2a, #b4552f, #ffd86b);
  color: #ffffff;
}

/* Feature cards */
.theme-dark .feature h4 {
  color: var(--brand-primary);
}

.theme-dark .feature p {
  color: var(--text-secondary);
}

/* Professional quote/blockquote */
.theme-dark .about-text blockquote.professional-quote {
  background: var(--bg-surface);
  border-left-color: var(--brand-accent);
  color: var(--text-primary);
}

.theme-dark .about-text blockquote.professional-quote cite {
  color: var(--brand-primary);
}

/* Contact section comprehensive overrides */
html.theme-dark .contact,
body.theme-dark .contact,
.theme-dark .contact,
html.theme-dark section.contact,
body.theme-dark section.contact {
  background: #0f1113 !important;
  background-color: #0f1113 !important;
  color: #e6eef3 !important;
}

/* Contact layout styling */
.theme-dark .contact-layout {
  display: grid;
  gap: 1rem;
}

/* Compact section header */
.theme-dark .contact-header {
  margin-bottom: 1.5rem !important;
}

.theme-dark .contact-header h2 {
  font-size: 1.8rem !important;
  margin-bottom: 0.5rem !important;
}

.theme-dark .contact-header p {
  font-size: 1rem !important;
  margin: 0 !important;
}

.theme-dark .contact-panel {
  background: linear-gradient(145deg, #1b1e20, #151718) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 1rem !important;
  color: #e6eef3 !important;
}

.theme-dark .contact-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.theme-dark .contact-list-item i {
  background: linear-gradient(135deg, #ff6b6b, #ffb347) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  width: 35px !important;
  height: 35px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.9rem !important;
  flex-shrink: 0 !important;
}

.theme-dark .action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.theme-dark .action-heading {
  color: #ff6b6b !important;
  font-size: 1.1rem !important;
  margin: 0 0 1rem 0 !important;
  font-weight: 600 !important;
}

/* Filter buttons */
.theme-dark .filter-btn {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.theme-dark .filter-btn:hover {
  background: var(--bg-secondary);
}

.theme-dark .filter-btn.active {
  background: linear-gradient(120deg, #8b1a2a, #b4552f, #ffd86b);
  color: #ffffff;
}

/* Gallery overlay */
.theme-dark .gallery-overlay {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

/* Menu filter bar */
.theme-dark .menu-filter {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

/* Section headers */
.theme-dark .section-header h2 {
  color: var(--brand-primary);
}

.theme-dark .section-header p {
  color: var(--text-secondary);
}

/* Order methods and quick actions */
.theme-dark .order-method {
  background: linear-gradient(135deg, #1b1e20, #151718) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #e6eef3 !important;
}

.theme-dark .order-method h4 {
  color: #ff6b6b !important;
}

.theme-dark .order-method p {
  color: #b8c5d1 !important;
}

.theme-dark .order-method i {
  background: linear-gradient(135deg, rgba(255, 215, 107, 0.15), rgba(184, 115, 51, 0.15)) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffd86b !important;
}

.theme-dark .order-method.whatsapp {
  background: linear-gradient(135deg, #1b1e20, #151718) !important;
  border-color: rgba(37, 211, 102, 0.3) !important;
}

.theme-dark .order-method.whatsapp i {
  color: #25d366 !important;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(37, 211, 102, 0.1)) !important;
}

/* Company/brand sections */
.theme-dark .company-branding {
  background: rgba(255, 215, 107, 0.05) !important;
  border-left-color: var(--brand-accent) !important;
  color: var(--text-primary) !important;
}

.theme-dark .company-info {
  color: var(--brand-accent) !important;
}

.theme-dark .company-tagline {
  color: var(--text-secondary) !important;
}

/* Override any white text fills or backgrounds */
.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6 {
  -webkit-text-fill-color: unset;
  color: var(--text-primary);
}

/* Legacy component overrides with high specificity */
.theme-dark .menu-item,
.theme-dark .achievement,
.theme-dark .testimonial,
.theme-dark .feature {
  background: linear-gradient(145deg, var(--bg-surface), var(--bg-secondary)) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Ultra-high specificity contact section overrides - correct class names */
html.theme-dark .contact-panel,
body.theme-dark .contact-panel,
.theme-dark .contact .contact-panel,
html.theme-dark .info-panel,
body.theme-dark .info-panel,
.theme-dark .contact .info-panel,
html.theme-dark .action-panel,
body.theme-dark .action-panel,
.theme-dark .contact .action-panel,
html.theme-dark .contact-list-item,
body.theme-dark .contact-list-item,
.theme-dark .contact .contact-list-item,
html.theme-dark .action-tile,
body.theme-dark .action-tile,
.theme-dark .contact .action-tile {
  background: #1b1e20 !important;
  background-color: #1b1e20 !important;
  background-image: linear-gradient(145deg, #1b1e20, #151718) !important;
  color: #e6eef3 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Force all contact section panel elements to use dark theme */
html.theme-dark .contact-panel *,
body.theme-dark .contact-panel *,
html.theme-dark .contact-list-item *,
body.theme-dark .contact-list-item *,
html.theme-dark .action-tile *,
body.theme-dark .action-tile * {
  background-color: transparent !important;
}

/* Specific contact list item styling - compact */
.theme-dark .contact-list-item {
  background: linear-gradient(135deg, #1b1e20, #151718) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  padding: 0.75rem !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

/* Action tiles styling */
.theme-dark .action-tile {
  background: linear-gradient(135deg, #1b1e20, #151718) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #ffd86b !important;
  border-radius: 8px !important;
  padding: 0.75rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.5rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
}

.theme-dark .action-tile i {
  font-size: 1.2rem !important;
  color: #ffd86b !important;
}

.theme-dark .action-tile:hover {
  background: linear-gradient(135deg, #1e2225, #1b1e20) !important;
  transform: translateY(-2px) !important;
}

/* Specific element color overrides for actual contact section elements */
.theme-dark .contact-panel h3,
.theme-dark .contact-list-item h3,
.theme-dark .action-heading,
.theme-dark .action-panel h3 {
  color: #ff6b6b !important;
  background: transparent !important;
}

.theme-dark .contact-list-item h3 {
  color: #ff6b6b !important;
  background: transparent !important;
  font-size: 1rem !important;
  margin: 0 0 0.25rem 0 !important;
  font-weight: 600 !important;
}

.theme-dark .contact-list-item p,
.theme-dark .contact-list-item address {
  color: #b8c5d1 !important;
  background: transparent !important;
  font-size: 0.85rem !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

.theme-dark .action-tile span {
  color: #b8c5d1 !important;
  background: transparent !important;
  font-size: 0.8rem !important;
}

.theme-dark .contact-list-item a,
.theme-dark .action-tile {
  color: #ffd86b !important;
  text-decoration: none;
}

.theme-dark .contact-list-item a:hover,
.theme-dark .action-tile:hover {
  color: #ffffff !important;
}

/* Override any remaining white/light backgrounds in contact section */
.theme-dark .contact [style*="background: white"],
.theme-dark .contact [style*="background: #fff"],
.theme-dark .contact [style*="background: #ffffff"],
.theme-dark .contact [style*="background-color: white"],
.theme-dark .contact [style*="background-color: #fff"],
.theme-dark .contact [style*="background-color: #ffffff"] {
  background: #1b1e20 !important;
  background-color: #1b1e20 !important;
}

/* Clean pseudo-element styling */
.theme-dark .contact-content::before,
.theme-dark .contact-item::before {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Responsive optimizations */
/* Responsive compact contact design */
@media (max-width: 768px) {
  .theme-toggle {
    width: 40px;
    height: 40px;
    margin-left: 0.5rem;
  }
  
  .theme-toggle i {
    font-size: 1rem;
  }
  
  .theme-dark .contact-panel {
    padding: 0.75rem !important;
  }
  
  .theme-dark .contact-list-item {
    padding: 0.5rem !important;
    margin-bottom: 0.4rem !important;
  }
  
  .theme-dark .contact-list-item i {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem !important;
  }
  
  .theme-dark .action-tile {
    padding: 0.5rem !important;
  }
  
  .theme-dark .action-grid {
    gap: 0.5rem;
  }
}

/* FeastCloud logo styling */
.feastcloud-logo {
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feastcloud-logo:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-dark .feastcloud-logo {
  filter: brightness(1.1) contrast(1.1);
  box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

.theme-dark .feastcloud-logo:hover {
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}