/* ==========================================================================
   MARHABA TOURS & TRAVELS
   Centralized Light/Dark Theme System
   File: src/css/theme.css
   ========================================================================== */

/* ==========================================================================
   1. LIGHT THEME TOKENS
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;

  --section-primary: #ffffff;
  --section-secondary: #f1f5f9;

  --card-bg: #ffffff;
  --card-bg-muted: #f8fafc;
  --card-border: #e2e8f0;

  --line: #e2e8f0;
  --line-soft: #f1f5f9;

  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --accent: #d69e36;

  --footer-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.96);

  /* Service Card Badge Tokens (Gold Gradient over Crisp White Badge Shell) */
  --ic-line: #9a6e1a;                 /* Deep Bronze-Gold for crisp outline details */
  --ic-fill: #ffffff;                 /* Clean White Infill */
  --ic-g1: #d69e36;                   /* Rich Warm Gold Gradient Start */
  --ic-g2: #f59e0b;                   /* Luminous Amber-Gold Gradient End */
  --ic-badge-1: #ffffff;              /* Crisp White Badge Outer Ring */
  --ic-badge-2: #faf8f5;              /* Subtle Warm Tinted Inner Base */
  --ic-ring: rgba(214, 158, 54, 0.35);/* Soft Gold Accent Ring Border */
  --gold-glow: rgba(214, 158, 54, 0.25);
}

/* ==========================================================================
   2. DARK THEME TOKENS
   ========================================================================== */

html.dark {
  color-scheme: dark;

  --bg: #0a1624;
  --surface: #0f2033;
  --surface-2: #132942;
  --surface-3: #193550;

  --section-primary: #0f2033;
  --section-secondary: #060e18;

  --card-bg: #0f2033;
  --card-bg-muted: #132942;
  --card-border: #29445f;

  --line: #1e293b;
  --line-soft: #0f172a;

  --ink: #f8fafc;
  --ink-2: #cbd5e1;
  --ink-3: #a3b4c7;

  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --accent: #fbbf24;

  --footer-bg: #07111c;
  --nav-bg: rgba(10, 22, 36, 0.96);

  /* Service Card Badge Tokens (Luminous Gold/Sky Gradient for Dark Mode) */
  --ic-line: #f8fafc;
  --ic-fill: #0f172a;
  --ic-g1: #38bdf8;
  --ic-g2: #e8c17a;
  --ic-badge-1: #1e293b;
  --ic-badge-2: #0f172a;
  --ic-ring: rgba(232, 193, 122, 0.35);
  --navy-glow: rgba(214, 158, 54, 0.25);
}

/* ==========================================================================
   3. GLOBAL BASE & TYPOGRAPHY
   ========================================================================== */

html, body {
  min-height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--ink-2);
}

/* Target section titles, but EXCLUDE card titles over dark image overlays */
section:not(#main-hero) h1:not(.card-title-overlay *):not(.tour-card *):not(.package-card *):not(.hotel-card *),
section:not(#main-hero) h2:not(.card-title-overlay *):not(.tour-card *):not(.package-card *):not(.hotel-card *),
section:not(#main-hero) h3:not(.card-title-overlay *):not(.tour-card *):not(.package-card *):not(.hotel-card *),
section:not(#main-hero) h4:not(.card-title-overlay *):not(.tour-card *):not(.package-card *):not(.hotel-card *),
section:not(#main-hero) .font-serif-title:not(.card-title-overlay *):not(.tour-card *):not(.package-card *):not(.hotel-card *) {
  color: var(--ink) !important;
}

/* Force titles over dark image gradient overlays to pure white in ALL themes */
.card-title-overlay,
.card-title-overlay h2,
.card-title-overlay h3,
.card-title-overlay h4,
.tour-card h2,
.tour-card h3,
.package-card h2,
.package-card h3,
.hotel-card h2,
.hotel-card h3,
.hotel-card h4 {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   4. ALTERNATING SECTIONS & SUBTLE DIVIDERS
   ========================================================================== */

section {
  background-color: var(--section-primary);
  border-color: var(--line) !important;
}

#services,
#packages,
#airline-partners,
#contact {
  background-color: var(--section-primary) !important;
}

#tours,
#hotels,
#testimonials {
  background-color: var(--section-secondary) !important;
}

html.dark section,
html.dark .border-b,
html.dark .border-slate-800,
html.dark .border-slate-700 {
  border-color: var(--line) !important;
}

/* ==========================================================================
   5. HERO SECTION (ISOLATED BACKDROP & CROSSFADING SLIDER)
   ========================================================================== */

#main-hero {
  background-color: #0b192c !important;
  position: relative;
  overflow: hidden;
}

#main-hero h1,
#main-hero h2,
#main-hero h3,
#main-hero p,
#main-hero .font-serif-title {
  color: #ffffff !important;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1.2s ease-in-out;
}

.hero-bg-img.focus-right {
  object-position: 75% center;
}

.hero-bg-img.focus-center {
  object-position: center center;
}

@media (min-width: 640px) {
  .hero-bg-img.focus-right,
  .hero-bg-img.focus-center {
    object-position: center 35%;
  }
}

.hero-overlay-light {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: linear-gradient(to right, rgba(15, 23, 42, 0.75) 0%, rgba(15, 23, 42, 0.45) 50%, rgba(15, 23, 42, 0.15) 100%);
}

html.dark .hero-overlay-light {
  display: none !important;
}

.hero-overlay-dark {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  background: linear-gradient(to right, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.65) 55%, rgba(2, 6, 23, 0.25) 100%);
}

html.dark .hero-overlay-dark {
  display: block !important;
}

#main-hero .hero-eyebrow-text {
  color: #E8C17A !important;
}

html.dark #main-hero .hero-eyebrow-text {
  color: #E8C17A !important;
}

#main-hero .text-champagne-gold {
  color: #C59B27 !important;
}

html.dark #main-hero .text-champagne-gold {
  color: #E8C17A !important;
}

/* ==========================================================================
   6. CARDS & OVERLAYS
   ========================================================================== */

.tour-card,
.package-card,
.hotel-card,
.contact-card {
  background-color: var(--card-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--ink-2) !important;
}

.testimonial-card {
  background-color: var(--card-bg-muted, #f8fafc) !important;
  border-color: var(--card-border) !important;
  color: var(--ink) !important;
}

html:not(.dark) .testimonial-card p {
  color: #0f172a !important;
  font-weight: 500;
}

html.dark .testimonial-card p {
  color: #cbd5e1 !important;
}

.testimonial-card h4 {
  color: var(--ink) !important;
}

/* Force pure white title headings over dark image overlays */
.card-title-overlay h2,
.card-title-overlay h3,
.card-title-overlay h4,
.tour-card h3,
.package-card h3,
.hotel-card h4 {
  color: #ffffff !important;
}

/* Contact Info Item Cards - High Contrast Light Mode Fix */
.contact-item-card {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.dark .contact-item-card {
  background-color: rgba(15, 23, 42, 0.8) !important;
  border-color: #1e293b !important;
}

/* Label & Text Contrast Rules for Contact Items */
.contact-item-card p {
  color: #475569 !important; /* Dark Slate in Light Mode for high legibility */
}

html.dark .contact-item-card p {
  color: #94a3b8 !important; /* Muted Light Slate in Dark Mode */
}

.contact-item-card a {
  color: #0f172a !important;
}

html.dark .contact-item-card a {
  color: #ffffff !important;
}

/* Gold Hover Accent Lines & Outline Glow */
.svc-card:hover,
.tour-card:hover,
.package-card:hover,
.hotel-card:hover,
.testimonial-card:hover,
.contact-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent) !important;
  box-shadow: 0 12px 30px var(--gold-glow) !important;
}

.svc-card::before,
.tour-card::before,
.package-card::before,
.hotel-card::before,
.testimonial-card::before,
.contact-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 30;
  pointer-events: none;
}

.svc-card:hover::before,
.tour-card:hover::before,
.package-card:hover::before,
.hotel-card:hover::before,
.testimonial-card:hover::before,
.contact-card:hover::before {
  opacity: 1;
}

/* Force titles over dark overlay gradients to pure white in light & dark mode */
.card-title-overlay,
.card-title-overlay h2,
.card-title-overlay h3,
.card-title-overlay h4,
.tour-card h2,
.tour-card h3,
.package-card h2,
.package-card h3,
.hotel-card h2,
.hotel-card h3,
.hotel-card h4 {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); /* Extra drop-shadow readability */
}

/* ==========================================================================
   7. CAROUSEL CONTROLS THEME
   ========================================================================== */

/* Base Light Mode Shell */
.carousel-btn {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Force Crisp White Icon Shell in Dark Mode */
html.dark .carousel-btn {
  background-color: #1e293b !important; /* Rich Slate-800 button fill */
  color: #ffffff !important;            /* Pure white icon text */
  border-color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* SVG / Lucide Icon Color Mapping */
.carousel-btn svg,
.carousel-btn i {
  color: inherit !important;
  stroke: currentColor !important;
}

/* Luminous Gold Hover & Ring Glow Effects (Both Themes) */
.carousel-btn:hover {
  border-color: #fbbf24 !important;
  color: #d97706 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 0 18px 3px rgba(245, 158, 11, 0.5) !important;
}

html.dark .carousel-btn:hover {
  border-color: #fbbf24 !important;
  color: #fbbf24 !important;             /* Gold icon color on hover */
  box-shadow: 0 0 20px 4px rgba(245, 158, 11, 0.55) !important;
}

/* ==========================================================================
   8. FORM SECTION CONTRAST
   ========================================================================== */

html:not(.dark) #contact .lg\:col-span-5 h2 {
  color: #0f172a !important;
}

html:not(.dark) #contact .lg\:col-span-5 p {
  color: #334155 !important;
}

html:not(.dark) #contact .lg\:col-span-5 a {
  color: #0f172a !important;
  font-weight: 700;
}

html:not(.dark) #contact .lg\:col-span-5 a:hover {
  color: var(--primary) !important;
}

html:not(.dark) #contact .lg\:col-span-5 .text-slate-500,
html:not(.dark) #contact .lg\:col-span-5 .text-slate-400 {
  color: #475569 !important;
  font-weight: 600;
}

#contact .contact-card {
  background-color: #0f2033 !important;
  border-color: var(--card-border) !important;
}

#contact label,
html:not(.dark) #contact label,
html.dark #contact label {
  color: #ffffff !important;
  font-weight: 600;
}

#contact input,
#contact select,
#contact textarea {
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

html.dark #contact input,
html.dark #contact select,
html.dark #contact textarea {
  color: #f8fafc !important;
  background-color: #132942 !important;
  border-color: #29445f !important;
}

#contact input::placeholder,
#contact textarea::placeholder {
  color: var(--ink-3) !important;
  opacity: 0.8;
}

/* ==========================================================================
   9. NAVIGATION & FOOTER CONTRAST
   ========================================================================== */

.glass-nav {
  background: var(--nav-bg) !important;
  color: var(--ink) !important;
  border-bottom: 1px solid var(--line) !important;
}

.header-brand-title,
.footer-brand-title,
.footer-group-heading {
  color: var(--ink) !important;
}

.header-nav-links a:not(.bg-emerald-600),
.footer-nav-list a,
.footer-legal-links a {
  color: var(--ink-2) !important;
}

.header-nav-links a:not(.bg-emerald-600):hover,
.footer-nav-list a:hover,
.footer-legal-links a:hover {
  color: var(--primary) !important;
}

footer,
#site-footer {
  background-color: var(--footer-bg) !important;
  color: var(--ink-2) !important;
  border-top: 1px solid var(--line) !important;
}

/* ==========================================================================
   10. THEME SWITCHER TOGGLE
   ========================================================================== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 110;
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
  padding: 0.5rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  cursor: pointer;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  pointer-events: none;
}

html:not(.dark) .theme-toggle .icon-sun { display: none !important; }
html:not(.dark) .theme-toggle .icon-moon { display: block !important; color: #334155; }
html.dark .theme-toggle .icon-sun { display: block !important; color: #fbbf24; }
html.dark .theme-toggle .icon-moon { display: none !important; }

/* ==========================================================================
   SCROLL-TO-TOP BUTTON THEME (MATCHING CAROUSEL GOLD GLOW)
   ========================================================================== */

/* Base Light Mode Shell */
.scroll-to-top-btn {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

.scroll-to-top-btn .scroll-progress-track {
  stroke: #e2e8f0 !important;
}

/* Switch Progress Ring Blue (#38bdf8) to Warm Gold (#d69e36) */
.scroll-to-top-btn .scroll-progress-ring {
  stroke: #d69e36 !important;
}

/* Dark Mode Shell */
html.dark .scroll-to-top-btn {
  background-color: #1e293b !important; /* Rich Slate-800 shell */
  color: #ffffff !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html.dark .scroll-to-top-btn .scroll-progress-track {
  stroke: #334155 !important;
}

html.dark .scroll-to-top-btn .scroll-progress-ring {
  stroke: #fbbf24 !important; /* Luminous Amber-Gold Progress Ring in Dark Mode */
}

/* Luminous Gold Hover Glow Effect (Both Themes) */
.scroll-to-top-btn:hover {
  border-color: #fbbf24 !important;
  color: #d97706 !important;
  box-shadow: 0 0 20px 4px rgba(245, 158, 11, 0.5) !important;
}

.scroll-to-top-btn:hover .scroll-progress-ring {
  stroke: #f59e0b !important;
}

html.dark .scroll-to-top-btn:hover {
  border-color: #fbbf24 !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 22px 5px rgba(245, 158, 11, 0.55) !important;
}

html.dark .scroll-to-top-btn:hover .scroll-progress-ring {
  stroke: #fbbf24 !important;
}

/* ==========================================================================
   AIRLINE PARTNERS STRIP THEME (FULL COLOR & GOLD GLOW)
   ========================================================================== */

/* Light Mode: Clean off-white card shell with smooth transition hooks */
.airline-logo-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

/* Dark Mode: Soft light-slate card fill so dark/navy airline logos remain crisp */
html.dark .airline-logo-card {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Logo image: Full vibrant color by default */
.airline-logo-img {
  filter: none !important;
  opacity: 0.95;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.airline-logo-img {
  opacity: 1;
  transform: scale(1.08); /* Expanded logo scale on hover */
}