/**
 * Grub Stars - Whimsical Theme CSS
 * "Cosmic Comfort Food" design system
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700&display=swap');

/* ============================================
   Base Styles
   ============================================ */

body {
  font-family: 'Nunito', system-ui, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: 'Fredoka', 'Comic Sans MS', cursive;
}

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

/* Shimmer loading effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to right, #F5E6D3 0%, #FFFBF5 20%, #F5E6D3 40%, #F5E6D3 100%);
  background-size: 1000px 100%;
}

/* Loading spinner - now uses theme colors */
.spinner {
  border: 4px solid #F5E6D3;
  border-top: 4px solid #A855F7;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Wiggle animation - for fun hover effects */
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.animate-wiggle {
  animation: wiggle 0.3s ease-in-out;
}

.hover-wiggle:hover {
  animation: wiggle 0.3s ease-in-out;
}

/* Float animation - for decorative elements */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Pop in animation - for new elements appearing */
@keyframes pop-in {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pop-in {
  animation: pop-in 0.3s ease-out;
}

/* Bounce in animation - more playful entrance */
@keyframes bounce-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-bounce-in {
  animation: bounce-in 0.4s ease-out;
}

/* Pulse glow - for attention-grabbing elements */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(168, 85, 247, 0.2);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Rainbow gradient animation - for special elements */
@keyframes rainbow-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-rainbow {
  background: linear-gradient(90deg, #FFB347, #FF6B9D, #A855F7, #6EE7B7, #FFB347);
  background-size: 300% 100%;
  animation: rainbow-shift 3s ease infinite;
}

/* Sparkle effect */
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.animate-sparkle {
  animation: sparkle 1.5s ease-in-out infinite;
}

/* ============================================
   Focus & Accessibility Styles
   ============================================ */

*:focus-visible {
  outline: 3px solid #A855F7;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ============================================
   Gradient Header Bar
   ============================================ */

.gradient-bar {
  background: linear-gradient(90deg, #A855F7, #FF6B9D, #FFB347);
  height: 4px;
}

/* ============================================
   Card Styles
   ============================================ */

.card {
  background: white;
  border-radius: 1rem;
  border: 2px solid #F5E6D3;
  box-shadow: 0 4px 20px -2px rgba(168, 85, 247, 0.15);
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px -4px rgba(168, 85, 247, 0.3);
}

/* ============================================
   Button Styles
   ============================================ */

.btn-primary {
  background: linear-gradient(135deg, #FFB347, #FF6B9D);
  color: white;
  font-family: 'Fredoka', cursive;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px -2px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px -2px rgba(255, 107, 157, 0.5);
}

.btn-secondary {
  background: #F5E6D3;
  color: #4A3728;
  font-family: 'Fredoka', cursive;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: 2px solid #FFB347;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #FFB347;
  color: white;
}

/* ============================================
   Form Styles
   ============================================ */

.input-whimsical {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: 2px solid #F5E6D3;
  background: white;
  font-family: 'Nunito', sans-serif;
  color: #4A3728;
  transition: all 0.2s ease;
}

.input-whimsical:focus {
  border-color: #A855F7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
  outline: none;
}

.input-whimsical::placeholder {
  color: rgba(74, 55, 40, 0.4);
}

/* ============================================
   Tag & Badge Styles
   ============================================ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tag-category {
  background: rgba(168, 85, 247, 0.15);
  color: #A855F7;
}

.tag-category:hover {
  background: rgba(168, 85, 247, 0.25);
}

.tag-rating {
  background: #FDE047;
  color: #4A3728;
}

.tag-source {
  background: rgba(251, 113, 133, 0.2);
  color: #FB7185;
  font-size: 0.75rem;
}

/* ============================================
   Alert Styles
   ============================================ */

.alert {
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 2px solid;
}

.alert-success {
  background: rgba(110, 231, 183, 0.2);
  border-color: #6EE7B7;
}

.alert-error {
  background: rgba(251, 113, 133, 0.2);
  border-color: #FB7185;
}

.alert-warning {
  background: rgba(253, 224, 71, 0.3);
  border-color: #FDE047;
}

/* ============================================
   Empty State Styles
   ============================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: inline-block;
}

/* ============================================
   Star Rating Display
   ============================================ */

.stars {
  display: inline-flex;
  gap: 2px;
  color: #FDE047;
}

.star-empty {
  color: #F5E6D3;
}

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

@media print {
  .no-print {
    display: none !important;
  }

  .gradient-bar {
    display: none;
  }

  body {
    background: white !important;
  }
}

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

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

/* ============================================
   Dark Mode Styles
   ============================================ */

/* Body background */
html.dark body {
  background-color: #0f172a; /* slate-900 */
}

/* Card styles - dark mode */
html.dark .card {
  background: #1e293b; /* slate-800 */
  border-color: #3f3f46; /* zinc-700 */
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

html.dark .card:hover {
  box-shadow: 0 8px 30px -4px rgba(168, 85, 247, 0.25);
}

/* Button styles - dark mode */
html.dark .btn-secondary {
  background: #27272a; /* zinc-800 */
  color: #FFFBF5; /* cream */
  border-color: #FFB347; /* mango */
}

html.dark .btn-secondary:hover {
  background: #FFB347;
  color: #0f172a;
}

/* Form styles - dark mode */
html.dark .input-whimsical {
  background: #1e293b; /* slate-800 */
  border-color: #3f3f46; /* zinc-700 */
  color: #FFFBF5; /* cream */
}

html.dark .input-whimsical:focus {
  border-color: #A855F7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.3);
}

html.dark .input-whimsical::placeholder {
  color: rgba(255, 251, 245, 0.4);
}

/* Alert styles - dark mode */
html.dark .alert-success {
  background: rgba(110, 231, 183, 0.15);
  border-color: rgba(110, 231, 183, 0.5);
}

html.dark .alert-error {
  background: rgba(251, 113, 133, 0.15);
  border-color: rgba(251, 113, 133, 0.5);
}

html.dark .alert-warning {
  background: rgba(253, 224, 71, 0.15);
  border-color: rgba(253, 224, 71, 0.5);
}

/* Tag styles - dark mode */
html.dark .tag-category {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc; /* lighter purple for contrast */
}

html.dark .tag-source {
  background: rgba(251, 113, 133, 0.25);
  color: #fda4af; /* lighter coral for contrast */
}

/* Star rating - dark mode */
html.dark .star-empty {
  color: #3f3f46; /* zinc-700 */
}

/* Spinner - dark mode */
html.dark .spinner {
  border-color: #3f3f46;
  border-top-color: #A855F7;
}

/* Shimmer loading - dark mode */
html.dark .shimmer {
  background: linear-gradient(to right, #1e293b 0%, #334155 20%, #1e293b 40%, #1e293b 100%);
}

/* Focus styles - dark mode (slightly brighter) */
html.dark *:focus-visible {
  outline-color: #c084fc;
}

/* Text color adjustments for dark mode */
html.dark .text-cocoa {
  color: #f8fafc !important; /* slate-50 - much brighter */
}

html.dark .text-cocoa\/70 {
  color: rgba(248, 250, 252, 0.85) !important; /* brighter */
}

html.dark .text-cocoa\/60 {
  color: rgba(248, 250, 252, 0.75) !important; /* brighter */
}

/* Target footer text directly since Twind hashes class names */
html.dark footer p {
  color: rgba(248, 250, 252, 0.75) !important;
}

html.dark .text-cocoa\/50 {
  color: rgba(248, 250, 252, 0.7) !important; /* brighter */
}

html.dark .text-cocoa\/40 {
  color: rgba(248, 250, 252, 0.6) !important; /* brighter */
}

/* Background adjustments for dark mode */
html.dark .bg-cream {
  background-color: #0f172a !important;
}

html.dark .bg-latte {
  background-color: #1e293b !important;
}

html.dark .bg-latte\/50 {
  background-color: rgba(30, 41, 59, 0.5) !important;
}

html.dark .bg-white {
  background-color: #1e293b !important;
}

/* Border adjustments for dark mode */
html.dark .border-latte {
  border-color: #3f3f46 !important;
}

/* Gray colors in dark mode */
html.dark .bg-gray-50 {
  background-color: #1e293b !important;
}

html.dark .border-gray-200 {
  border-color: #3f3f46 !important;
}

html.dark .text-gray-600,
html.dark .text-gray-500,
html.dark .text-gray-400 {
  color: rgba(248, 250, 252, 0.75) !important; /* brighter for readability */
}

html.dark .text-gray-700 {
  color: rgba(248, 250, 252, 0.9) !important; /* brighter */
}

/* Heading colors in dark mode - brighter variants */
html.dark .text-mango {
  color: #fcd34d !important; /* amber-300 - brighter yellow */
}

html.dark .text-hotpink {
  color: #f9a8d4 !important; /* pink-300 - brighter pink */
}

html.dark .text-coral {
  color: #fda4af !important; /* rose-300 - brighter coral */
}

/* Blue tints in dark mode */
html.dark .bg-blue-50 {
  background-color: rgba(168, 85, 247, 0.1) !important;
}

html.dark .border-blue-200 {
  border-color: rgba(168, 85, 247, 0.3) !important;
}

html.dark .text-blue-700 {
  color: #c084fc !important;
}

html.dark .text-blue-600 {
  color: #A855F7 !important;
}

/* Sort badge dark mode is handled via Twind dark: variants in search.js */

/* Amber tints in dark mode */
html.dark .bg-amber-50 {
  background-color: rgba(253, 224, 71, 0.1) !important;
}

html.dark .border-amber-200 {
  border-color: rgba(253, 224, 71, 0.3) !important;
}

/* Hover state backgrounds */
html.dark .hover\:bg-blue-50:hover {
  background-color: rgba(168, 85, 247, 0.15) !important;
}

html.dark .hover\:border-blue-300:hover {
  border-color: rgba(168, 85, 247, 0.5) !important;
}

html.dark .hover\:text-blue-700:hover {
  color: #c084fc !important;
}

/* Error message component dark mode - override inline styles */
html.dark .bg-red-50,
html.dark [style*="background-color: #fef2f2"] {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

html.dark .text-red-800,
html.dark [style*="color: #991b1b"] {
  color: #fca5a5 !important; /* red-300 */
}

html.dark .text-red-600,
html.dark [style*="color: #dc2626"] {
  color: #f87171 !important; /* red-400 */
}

/* Warning message dark mode */
html.dark .bg-yellow-50,
html.dark [style*="background-color: #fefce8"] {
  background-color: rgba(234, 179, 8, 0.15) !important;
  border-color: rgba(234, 179, 8, 0.4) !important;
}

html.dark .text-yellow-700,
html.dark [style*="color: #a16207"] {
  color: #fde047 !important; /* yellow-300 */
}

html.dark .text-yellow-800,
html.dark [style*="color: #854d0e"] {
  color: #fef08a !important; /* yellow-200 */
}

html.dark .text-yellow-500,
html.dark [style*="color: #eab308"] {
  color: #facc15 !important; /* yellow-400 */
}

/* Success message dark mode (index success card) */
html.dark .bg-green-50 {
  background-color: rgba(34, 197, 94, 0.15) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
}

html.dark .text-green-600 {
  color: #4ade80 !important; /* green-400 */
}

html.dark .text-green-800 {
  color: #86efac !important; /* green-300 */
}

html.dark .border-green-200 {
  border-color: rgba(34, 197, 94, 0.4) !important;
}

/*
 * Dark mode for JS-rendered content
 * Twind hashes class names, so we must target elements directly
 * by their semantic type and container structure
 */

/* All article elements (restaurant cards, detail pages) */
html.dark article {
  background-color: #1e293b !important;
}

/* Restaurant details page - main container */
html.dark #restaurant-details article {
  background-color: #1e293b !important;
}

html.dark #restaurant-details article > div {
  border-color: #475569 !important;
}

/* Rating cards in details page - target divs inside grid */
html.dark #restaurant-details article div div div {
  background-color: #334155 !important;
}

/* Search results container */
html.dark #search-results article {
  background-color: #1e293b !important;
}

/* All blockquotes (reviews) */
html.dark blockquote {
  background-color: #334155 !important;
}

/* Index results container */
html.dark #index-results > div {
  background-color: #1e293b !important;
  border-color: #475569 !important;
}

html.dark #index-results article {
  background-color: #1e293b !important;
}

/* Categories list container */
html.dark #categories-list > div {
  background-color: #1e293b !important;
}

html.dark #categories-list a {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark #categories-list a:hover {
  background-color: #475569 !important;
  border-color: #6366f1 !important;
}

/* Bookmarks list container */
html.dark #bookmarks-list article {
  background-color: #1e293b !important;
}

html.dark .shadow,
html.dark .shadow-lg {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4) !important;
}

html.dark .hover\:shadow-md:hover {
  box-shadow: 0 6px 25px -2px rgba(0, 0, 0, 0.5) !important;
}

/* Gray text colors for dark mode */
html.dark .text-gray-800 {
  color: #f8fafc !important; /* slate-50 */
}

html.dark .text-gray-700 {
  color: #e2e8f0 !important; /* slate-200 */
}

html.dark .text-gray-600,
html.dark [style*="color: #4b5563"] {
  color: #cbd5e1 !important; /* slate-300 */
}

html.dark .text-gray-500,
html.dark [style*="color: #9ca3af"] {
  color: #94a3b8 !important; /* slate-400 */
}

html.dark .text-gray-400 {
  color: #94a3b8 !important; /* slate-400 */
}

html.dark .text-gray-300 {
  color: #64748b !important; /* slate-500 */
}

/* Gray backgrounds for dark mode */
html.dark .bg-gray-200 {
  background-color: #475569 !important; /* slate-600 */
}

html.dark .bg-gray-100 {
  background-color: #334155 !important; /* slate-700 */
}

html.dark .hover\:bg-gray-100:hover {
  background-color: #475569 !important; /* slate-600 */
}

html.dark .hover\:bg-gray-300:hover {
  background-color: #64748b !important; /* slate-500 */
}

/* Border colors for dark mode */
html.dark .border-gray-200 {
  border-color: #475569 !important; /* slate-600 */
}

html.dark .border-gray-300 {
  border-color: #64748b !important; /* slate-500 */
}

/* Blue colors for dark mode (links, buttons, tags) */
html.dark .bg-blue-100 {
  background-color: rgba(168, 85, 247, 0.2) !important;
}

html.dark .text-blue-700 {
  color: #c084fc !important; /* purple-400 */
}

html.dark .text-blue-600,
html.dark [style*="color: #2563eb"] {
  color: #a78bfa !important; /* violet-400 */
}

html.dark .hover\:bg-blue-200:hover {
  background-color: rgba(168, 85, 247, 0.3) !important;
}

html.dark .bg-blue-600 {
  background-color: #7c3aed !important; /* violet-600 */
}

html.dark .hover\:bg-blue-700:hover {
  background-color: #6d28d9 !important; /* violet-700 */
}

/* Yellow/rating colors */
html.dark .text-yellow-600 {
  color: #fde047 !important; /* yellow-300 */
}

html.dark .text-yellow-400 {
  color: #facc15 !important; /* yellow-400 */
}

/* Onboarding banner dark mode - override inline styles */
html.dark #onboarding-banner {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.15), rgba(168, 85, 247, 0.2)) !important;
  border-color: rgba(255, 179, 71, 0.4) !important;
}

html.dark #onboarding-banner h3,
html.dark #onboarding-banner h4 {
  color: #f8fafc !important; /* slate-50 */
}

html.dark #onboarding-banner p {
  color: rgba(248, 250, 252, 0.85) !important;
}

html.dark #onboarding-banner strong {
  color: #fcd34d !important; /* amber-300 */
}

html.dark #onboarding-banner #dismiss-onboarding {
  color: rgba(248, 250, 252, 0.6) !important;
}

html.dark #onboarding-banner #dismiss-onboarding:hover {
  color: #f8fafc !important;
}

/* Search card and form headings in dark mode */
html.dark h2,
html.dark h3,
html.dark h4 {
  color: #f8fafc !important;
}

/* Input placeholder in dark mode - needs higher contrast */
html.dark input::placeholder {
  color: rgba(248, 250, 252, 0.5) !important;
}

/* Label text in dark mode */
html.dark label {
  color: rgba(248, 250, 252, 0.9) !important;
}

/* Paragraph text in dark mode - ensure good contrast */
html.dark .card p {
  color: rgba(248, 250, 252, 0.8) !important;
}

/* Link colors in dark mode */
html.dark a:not(.btn-primary):not(.btn-secondary) {
  color: #c084fc;
}

html.dark a:not(.btn-primary):not(.btn-secondary):hover {
  color: #e879f9;
}

/* ============================================
   Address Autocomplete Styles
   ============================================ */

.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
}

.autocomplete-dropdown {
  background: white;
  border: 2px solid #F5E6D3;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px -2px rgba(168, 85, 247, 0.2);
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

html.dark .autocomplete-dropdown {
  background: #1e293b;
  border-color: #3f3f46;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #4A3728;
  font-family: 'Nunito', sans-serif;
}

html.dark .autocomplete-item {
  color: #FFFBF5;
}

.autocomplete-item:hover,
.autocomplete-item-active {
  background: rgba(168, 85, 247, 0.1);
}

.autocomplete-item-active {
  outline: 2px solid #A855F7;
  outline-offset: -2px;
}

.autocomplete-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.autocomplete-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Autocomplete loading state */
.autocomplete-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: #A855F7;
}

.autocomplete-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #F5E6D3;
  border-top-color: #A855F7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
}

/* Autocomplete empty state */
.autocomplete-empty {
  padding: 1rem;
  text-align: center;
  color: rgba(74, 55, 40, 0.6);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.autocomplete-add-link {
  display: inline-block;
  color: #A855F7;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s, color 0.15s;
}

.autocomplete-add-link:hover {
  background-color: rgba(168, 85, 247, 0.1);
  color: #9333EA;
  text-decoration: underline;
}

/* Autocomplete content with details */
.autocomplete-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.autocomplete-details {
  font-size: 0.75rem;
  color: rgba(74, 55, 40, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.autocomplete-address {
  font-size: 0.8rem;
  color: rgba(74, 55, 40, 0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

html.dark .autocomplete-address {
  color: rgba(255, 251, 245, 0.65);
}

html.dark .autocomplete-empty {
  color: rgba(255, 251, 245, 0.5);
}

html.dark .autocomplete-add-link {
  color: #c084fc;
}

html.dark .autocomplete-add-link:hover {
  background-color: rgba(192, 132, 252, 0.15);
  color: #d8b4fe;
}

html.dark .autocomplete-details {
  color: rgba(255, 251, 245, 0.5);
}

html.dark .autocomplete-loading {
  color: #c084fc;
}

html.dark .autocomplete-loading::before {
  border-color: #3f3f46;
  border-top-color: #A855F7;
}

/* ============================================
   Restaurant Details Page - Enhanced Elements
   ============================================ */

/* Rating cards in details page */
.rating-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rating-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

html.dark .rating-card {
  background-color: #334155 !important;
}

html.dark .rating-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Review cards */
.review-card {
  transition: transform 0.15s ease;
}

.review-card:hover {
  transform: translateX(4px);
}

html.dark .review-card {
  background-color: #334155 !important;
}

/* Similar restaurants cards */
.similar-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.similar-card:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html.dark .similar-card {
  background-color: #334155 !important;
}

html.dark .similar-card:hover {
  background-color: #475569 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Photo thumbnails */
.photo-thumb {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

html.dark .photo-thumb {
  background-color: #334155 !important;
}

html.dark .photo-thumb:hover {
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

/* Photo placeholder */
html.dark .photo-placeholder {
  background-color: #1e293b !important;
  color: #64748b !important;
}

/* Map container */
#restaurant-map {
  transition: box-shadow 0.2s ease;
}

#restaurant-map:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

html.dark #restaurant-map {
  background-color: #334155 !important;
}

html.dark #restaurant-map:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* External link buttons dark mode */
html.dark .bg-red-100 {
  background-color: rgba(239, 68, 68, 0.2) !important;
}

html.dark .text-red-700 {
  color: #fca5a5 !important;
}

html.dark .hover\:bg-red-200:hover {
  background-color: rgba(239, 68, 68, 0.3) !important;
}

html.dark .bg-green-100 {
  background-color: rgba(34, 197, 94, 0.2) !important;
}

html.dark .text-green-700 {
  color: #86efac !important;
}

html.dark .hover\:bg-green-200:hover {
  background-color: rgba(34, 197, 94, 0.3) !important;
}

/* Video cards dark mode */
html.dark .bg-red-100 {
  background-color: rgba(239, 68, 68, 0.2) !important;
}

html.dark .group-hover\:bg-red-200:hover,
html.dark .group:hover .group-hover\:bg-red-200 {
  background-color: rgba(239, 68, 68, 0.3) !important;
}

/* Share toast */
#share-toast {
  backdrop-filter: blur(8px);
}

html.dark #share-toast {
  background-color: #334155 !important;
}

/* Photo lightbox - no dark mode needed as it's already dark */
#photo-lightbox {
  backdrop-filter: blur(4px);
}

#photo-lightbox img {
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Lightbox navigation buttons */
#lightbox-prev,
#lightbox-next,
#lightbox-close {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#lightbox-prev:hover,
#lightbox-next:hover,
#lightbox-close:hover {
  transform: scale(1.1);
  opacity: 1;
}

#lightbox-prev:active,
#lightbox-next:active,
#lightbox-close:active {
  transform: scale(0.95);
}

/* Show more reviews button */
#show-more-reviews {
  transition: color 0.15s ease, transform 0.15s ease;
}

#show-more-reviews:hover {
  transform: translateX(4px);
}

html.dark #show-more-reviews {
  color: #c084fc !important;
}

html.dark #show-more-reviews:hover {
  color: #e879f9 !important;
}

/* Share button dark mode */
html.dark #share-btn {
  color: #94a3b8 !important;
}

html.dark #share-btn:hover {
  background-color: #334155 !important;
  color: #f8fafc !important;
}

/* Directions link */
html.dark a[href*="google.com/maps"] {
  color: #a78bfa !important;
}

html.dark a[href*="google.com/maps"]:hover {
  color: #c4b5fd !important;
}

/* Similar restaurants section */
html.dark #similar-restaurants {
  border-color: #475569 !important;
}

html.dark #similar-restaurants h3 {
  color: #f8fafc !important;
}

html.dark #similar-restaurants-list a {
  background-color: #334155 !important;
}

html.dark #similar-restaurants-list a:hover {
  background-color: #475569 !important;
}

html.dark #similar-restaurants-list h4 {
  color: #e2e8f0 !important;
}

html.dark #similar-restaurants-list p {
  color: #94a3b8 !important;
}

/* External links section dark mode */
html.dark #restaurant-details .flex.flex-wrap.gap-3 a {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Touch-friendly targets for mobile */
@media (hover: none) and (pointer: coarse) {
  .photo-thumb,
  .rating-card,
  .similar-card,
  .review-card {
    -webkit-tap-highlight-color: rgba(168, 85, 247, 0.2);
  }

  #lightbox-prev,
  #lightbox-next {
    padding: 16px;
  }

  #lightbox-close {
    padding: 12px;
  }
}

/* Swipe hint animation for lightbox on mobile */
@keyframes swipe-hint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-10px); }
}

@media (hover: none) and (pointer: coarse) {
  #photo-lightbox[data-show-hint="true"] #lightbox-image {
    animation: swipe-hint 1s ease-in-out 2;
  }
}

/* ==========================================================================
   Map Page Styles
   ========================================================================== */

/* Restaurant marker styles */
.restaurant-marker {
  background: transparent;
  border: none;
}

.restaurant-marker .marker-pin {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.restaurant-marker:hover .marker-pin {
  transform: scale(1.2);
}

/* Map popup styles */
.map-popup {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.map-popup strong {
  color: #4a3728;
  font-weight: 600;
}

.map-popup small {
  color: #6b5c4e;
}

/* Leaflet container override */
.leaflet-container {
  font-family: 'Nunito', sans-serif;
  border-radius: 1rem;
}

/* Dark mode - Leaflet map tiles */
html.dark .leaflet-container {
  background-color: #1e293b;
}

html.dark .leaflet-tile-pane {
  filter: brightness(0.8) saturate(0.9) hue-rotate(180deg) invert(1);
}

/* Dark mode - Leaflet controls */
html.dark .leaflet-control-zoom a {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

html.dark .leaflet-control-zoom a:hover {
  background-color: #475569 !important;
}

html.dark .leaflet-control-attribution {
  background-color: rgba(30, 41, 59, 0.8) !important;
  color: #94a3b8 !important;
}

html.dark .leaflet-control-attribution a {
  color: #a78bfa !important;
}

/* Dark mode - Leaflet popups */
html.dark .leaflet-popup-content-wrapper {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
  border-radius: 0.5rem;
}

html.dark .leaflet-popup-tip {
  background-color: #334155 !important;
}

html.dark .map-popup strong {
  color: #f8fafc !important;
}

html.dark .map-popup small {
  color: #94a3b8 !important;
}

/* Dark mode - Restaurant marker */
html.dark .restaurant-marker .marker-pin {
  background: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Dark mode - Selected restaurant card */
html.dark #selected-restaurant article {
  background-color: #1e293b !important;
}

html.dark #selected-restaurant h3 a {
  color: #f8fafc !important;
}

html.dark #selected-restaurant h3 a:hover {
  color: #a78bfa !important;
}

html.dark #selected-restaurant p {
  color: #94a3b8 !important;
}

/* Dark mode - Map header and controls */
html.dark #locate-me-btn {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

html.dark #locate-me-btn:hover {
  background-color: #475569 !important;
}

html.dark #restaurant-count {
  color: #94a3b8 !important;
}

/* Dark mode - Empty state */
html.dark #map-empty {
  background-color: #1e293b !important;
}

html.dark #map-empty h3 {
  color: #f8fafc !important;
}

html.dark #map-empty p {
  color: #94a3b8 !important;
}
