/* ===========================
   DARK MODE STYLING
   =========================== */

/* Dark mode color variables */
:root[data-theme="dark"] {
    --primary:          #00D9FF;
    --primary-dark:     #0099CC;
    --primary-light:    #00F5FF;
    --secondary:        #FF8844;
    --secondary-dark:   #FF6622;
    --accent:           #FFD700;
    --teal:             #06D6A0;
    --emerald:          #2D6A4F;

    /* Dark mode neutral palette */
    --dark:             #E5E5E5;
    --gray-900:         #F0F0F0;
    --gray-800:         #D0D0D0;
    --gray-600:         #B0B0B0;
    --gray-400:         #808080;
    --gray-200:         #404040;
    --gray-100:         #2A2A2A;
    --white:            #1A1A1A;
    --light-bg:         #242424;

    /* Semantic (dark mode) */
    --success:          #34D399;
    --warning:          #FBBF24;
    --danger:           #F87171;

    /* Text colors reversed */
    --text-dark:        #F0F0F0;
    --text-light:       #B0B0B0;
    --border-color:     #404040;
    --shadow:           0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover:     0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Background */
:root[data-theme="dark"] body {
    background-color: #1a1a1a;
    color: #F0F0F0;
}

:root[data-theme="dark"] .site-main,
:root[data-theme="dark"] .content-area,
:root[data-theme="dark"] .page-content,
:root[data-theme="dark"] .page-header,
:root[data-theme="dark"] .page-header .container,
:root[data-theme="dark"] section,
:root[data-theme="dark"] .container,
:root[data-theme="dark"] .section-header,
:root[data-theme="dark"] .section-subtitle {
    color: #F0F0F0;
}

:root[data-theme="dark"] .page-header,
:root[data-theme="dark"] .content-area,
:root[data-theme="dark"] .breadcrumbs,
:root[data-theme="dark"] .single-tour-header,
:root[data-theme="dark"] .booking-hero,
:root[data-theme="dark"] .booking-trust-strip {
    background: #1f1f1f;
}

/* Header */
:root[data-theme="dark"] .site-header {
    background: #242424;
    border-bottom-color: #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .site-header .main-header,
:root[data-theme="dark"] body:not(.home) .site-header .main-header,
:root[data-theme="dark"] body.home .site-header.scrolled .main-header {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] body.home .site-header:not(.scrolled) .main-header {
    background: transparent;
    box-shadow: none;
}

:root[data-theme="dark"] .main-navigation a {
    color: #F0F0F0;
}

:root[data-theme="dark"] .primary-menu li a,
:root[data-theme="dark"] .main-navigation .menu a,
:root[data-theme="dark"] body:not(.home) .primary-menu li a,
:root[data-theme="dark"] body:not(.home) .main-navigation .menu a {
    color: #E8E8E8;
}

:root[data-theme="dark"] body.home .site-header:not(.scrolled) .primary-menu li a,
:root[data-theme="dark"] body.home .site-header:not(.scrolled) .main-navigation .menu a {
    color: #F8F8F8;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .primary-menu li a:hover,
:root[data-theme="dark"] .main-navigation .menu a:hover,
:root[data-theme="dark"] .primary-menu li.current-menu-item a,
:root[data-theme="dark"] .primary-menu li.current_page_item a {
    background: #2e2e2e;
    color: #00D9FF;
}

:root[data-theme="dark"] .main-navigation a:hover {
    color: #00D9FF;
}

:root[data-theme="dark"] .menu-button {
    background: #353535;
    color: #F0F0F0;
}

/* Hero Section */
:root[data-theme="dark"] .hero-section {
    position: relative;
}

:root[data-theme="dark"] .hero-overlay {
    background: rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .hero-title {
    color: #F0F0F0;
}

:root[data-theme="dark"] .hero-subtitle {
    color: #B0B0B0;
}

:root[data-theme="dark"] .hero-badge {
    background: rgba(0, 217, 255, 0.1);
    color: #00D9FF;
    border-color: #00D9FF;
}

/* Hero Search (home) */
:root[data-theme="dark"] .hero-search-form {
    background: linear-gradient(145deg, rgba(20, 28, 38, 0.92), rgba(14, 20, 29, 0.92));
    border: 1px solid rgba(122, 223, 255, 0.22);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
}

:root[data-theme="dark"] .hero-search-field {
    border-right-color: rgba(122, 223, 255, 0.18);
}

:root[data-theme="dark"] .hero-search-label {
    color: #9fe8ff;
}

:root[data-theme="dark"] .hero-search-input {
    color: #f6faff;
    font-weight: 600;
}

:root[data-theme="dark"] .hero-search-input::placeholder {
    color: #7f97b0;
}

:root[data-theme="dark"] .hero-search-field:focus-within {
    background: rgba(24, 35, 48, 0.72);
}

:root[data-theme="dark"] .hero-search-input[type="date"] {
    color-scheme: dark;
}

:root[data-theme="dark"] .hero-search-btn {
    background: linear-gradient(135deg, #16c3ea, #008fc0);
    color: #f7fbff;
    border: 1px solid rgba(151, 232, 255, 0.35);
    box-shadow: 0 12px 28px rgba(0, 153, 204, 0.52);
}

:root[data-theme="dark"] .hero-search-btn:hover {
    background: linear-gradient(135deg, #38d4f7, #00a8dd);
    box-shadow: 0 14px 30px rgba(0, 153, 204, 0.65);
}

@media (max-width: 768px) {
    :root[data-theme="dark"] .hero-search-form {
        background: linear-gradient(145deg, rgba(18, 25, 35, 0.95), rgba(14, 19, 28, 0.95));
    }

    :root[data-theme="dark"] .hero-search-field {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    }

    :root[data-theme="dark"] .hero-search-field:last-of-type {
        border-bottom: none;
    }
}

/* Buttons */
:root[data-theme="dark"] .btn-primary {
    background: #00B4D8;
    color: #1A1A1A;
}

:root[data-theme="dark"] .btn-primary:hover {
    background: #00D9FF;
}

:root[data-theme="dark"] .btn-light {
    background: #353535;
    color: #F0F0F0;
    border-color: #404040;
}

:root[data-theme="dark"] .btn-light:hover {
    background: #404040;
    border-color: #505050;
}

/* Cards & Containers */
:root[data-theme="dark"] .tour-card,
:root[data-theme="dark"] .section-box,
:root[data-theme="dark"] .widget,
:root[data-theme="dark"] .modal {
    background: #2A2A2A;
    border-color: #404040;
    color: #F0F0F0;
}

:root[data-theme="dark"] .about-hero,
:root[data-theme="dark"] .about-story,
:root[data-theme="dark"] .about-values,
:root[data-theme="dark"] .about-team,
:root[data-theme="dark"] .about-cta,
:root[data-theme="dark"] .about-card,
:root[data-theme="dark"] .about-stat,
:root[data-theme="dark"] .value-card {
    background: #252525;
    border-color: #3f3f3f;
}

:root[data-theme="dark"] .tour-card:hover {
    background: #353535;
}

:root[data-theme="dark"] .why-choose-badge {
    background: rgba(30, 30, 30, 0.9);
    border-color: #3f3f3f;
}

:root[data-theme="dark"] .why-choose-badge-text strong,
:root[data-theme="dark"] .why-choose-mini-card strong {
    color: #F4F4F4;
}

:root[data-theme="dark"] .why-choose-badge-text span,
:root[data-theme="dark"] .why-choose-mini-card span {
    color: #B8B8B8;
}

:root[data-theme="dark"] .why-choose-mini-card {
    background: rgba(34, 34, 34, 0.88);
    border-color: #3f3f3f;
}

:root[data-theme="dark"] .why-choose-mini-icon {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.18), rgba(110, 231, 183, 0.2));
    color: #b8f4ff;
}

/* Forms */
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
    background: #2A2A2A;
    color: #F0F0F0;
    border-color: #404040;
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] textarea:focus,
:root[data-theme="dark"] select:focus {
    background: #353535;
    border-color: #00D9FF;
}

:root[data-theme="dark"] input::placeholder {
    color: #808080;
}

/* Tables */
:root[data-theme="dark"] table {
    color: #F0F0F0;
}

:root[data-theme="dark"] th {
    background: #2A2A2A;
    border-color: #404040;
    color: #F0F0F0;
}

:root[data-theme="dark"] td {
    border-color: #404040;
}

:root[data-theme="dark"] tr:hover {
    background: #353535;
}

/* Code blocks */
:root[data-theme="dark"] pre,
:root[data-theme="dark"] code {
    background: #2A2A2A;
    color: #F0F0F0;
    border-color: #404040;
}

/* Breadcrumbs */
:root[data-theme="dark"] .breadcrumbs {
    color: #B0B0B0;
}

:root[data-theme="dark"] .breadcrumbs-inner {
    background: rgba(30,30,30,0.70);
    border-color: rgba(255,255,255,0.08);
}

:root[data-theme="dark"] .breadcrumbs a,
:root[data-theme="dark"] .breadcrumbs-link {
    color: #00D9FF;
}

:root[data-theme="dark"] .breadcrumbs a:hover,
:root[data-theme="dark"] .breadcrumbs-link:hover {
    color: #00F5FF;
}

:root[data-theme="dark"] .breadcrumbs-current {
    color: #909090;
}

/* Testimonials */
:root[data-theme="dark"] .testimonial {
    background: #2A2A2A;
    border-color: #404040;
}

/* Navbar text in dark mode */
:root[data-theme="dark"] .menu-link {
    color: #F0F0F0;
}

:root[data-theme="dark"] .menu-link:hover {
    color: #00D9FF;
}

/* Footer */
:root[data-theme="dark"] .site-footer {
    background: #1a1a1a;
    border-top-color: #404040;
    color: #B0B0B0;
}

:root[data-theme="dark"] .site-footer a {
    color: #00D9FF;
}

:root[data-theme="dark"] .site-footer a:hover {
    color: #00F5FF;
}

/* Scrollbar */
:root[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
}

:root[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #2A2A2A;
}

:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #505050;
    border-radius: 5px;
}

:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5,
:root[data-theme="dark"] h6,
:root[data-theme="dark"] .page-title,
:root[data-theme="dark"] .section-title {
    color: #F4F4F4;
}

:root[data-theme="dark"] p,
:root[data-theme="dark"] li,
:root[data-theme="dark"] .page-description,
:root[data-theme="dark"] .section-subtitle {
    color: #C7C7C7;
}

/* Dark mode toggle button */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    padding: 0;
}

.theme-toggle:hover {
    background: var(--gray-100);
}

:root[data-theme="dark"] .theme-toggle:hover {
    background: #353535;
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.theme-toggle:hover i {
    color: var(--primary);
    transform: rotate(20deg) scale(1.1);
}

/* Animation for theme switch */
@keyframes themeSwitch {
    0% {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }
    100% {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.theme-toggle.switched i {
    animation: themeSwitch 0.3s var(--ease) forwards;
}

/* Smooth transition when switching theme */
body,
body * {
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

/* Don't animate on page load */
body.prefers-reduced-motion *,
body.prefers-reduced-motion {
    transition: none !important;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    body,
    body * {
        transition: none !important;
        animation: none !important;
    }
}
