/* Theme Switcher Styles */
[data-theme-switcher] {
    position: relative;
    display: inline-block;
}

.theme-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    color: var(--theme-text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.theme-switcher-btn:hover {
    background: var(--theme-hover);
    transform: scale(1.05);
    border-color: var(--siamez-gold);
}

.theme-label {
    font-size: 13px;
}

.theme-switcher-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

[data-theme-switcher].open .theme-switcher-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--theme-text);
    font-size: 14px;
}

.theme-option:hover {
    background: var(--theme-hover);
}

.theme-option.active {
    background: var(--theme-active);
    font-weight: 600;
}

.theme-option-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Dark Mode CSS Variables */
:root {
    /* Light mode (default) */
    --theme-bg: #ffffff;
    --theme-surface: #ffffff;
    --theme-text: #1e293b;
    --theme-text-secondary: #64748b;
    --theme-border: #e2e8f0;
    --theme-hover: #f1f5f9;
    --theme-active: #e0e7ff;
    --theme-shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark mode */
    --theme-bg: #0f172a;
    --theme-surface: #1e293b;
    --theme-text: #f1f5f9;
    --theme-text-secondary: #94a3b8;
    --theme-border: #334155;
    --theme-hover: #334155;
    --theme-active: #475569;
    --theme-shadow: rgba(0, 0, 0, 0.3);
}

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

html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}

html[data-theme="light"],
html[data-theme="light"] body {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

/* Header - Must override inline styles with maximum specificity */
html[data-theme="dark"] #main-header,
html[data-theme="dark"] header#main-header,
[data-theme="dark"] #main-header,
[data-theme="dark"] header#main-header,
body[data-theme="dark"] #main-header {
    background-color: var(--theme-surface) !important;
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-bottom-color: var(--siamez-gold) !important;
    box-shadow: 0 2px 8px var(--theme-shadow) !important;
}

/* Override any inline style attributes */
html[data-theme="dark"] #main-header[style],
[data-theme="dark"] #main-header[style] {
    background-color: var(--theme-surface) !important;
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

[data-theme="dark"] .nav-link,
[data-theme="dark"] .mobile-link,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .mobile-link {
    color: var(--theme-text) !important;
}

/* Light mode header */
[data-theme="light"] #main-header,
html[data-theme="light"] #main-header {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #1e293b !important;
}

[data-theme="light"] .nav-link,
[data-theme="light"] .mobile-link {
    color: var(--siamez-blue) !important;
}

/* Service cards and boxes */
[data-theme="dark"] .service-box,
[data-theme="dark"] .service-card,
[data-theme="dark"] .stat-mini-1, 
[data-theme="dark"] .stat-mini-2, 
[data-theme="dark"] .stat-mini-3, 
[data-theme="dark"] .stat-mini-4,
[data-theme="dark"] .contact-card-1, 
[data-theme="dark"] .contact-card-2, 
[data-theme="dark"] .contact-card-3 {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
    box-shadow: 0 4px 12px var(--theme-shadow) !important;
}

/* Light mode service cards */
[data-theme="light"] .service-box,
[data-theme="light"] .service-card {
    background: #ffffff !important;
    color: #333 !important;
}

.service-card h3,
.service-card p {
    color: var(--theme-text) !important;
}

.service-card p {
    color: var(--theme-text-secondary) !important;
}

/* Form elements */
input, select, textarea {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--theme-text-secondary) !important;
}

/* Booking form container */
#booking-form-container {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--siamez-gold) !important;
}

/* Cart summary */
.cart-summary {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--siamez-gold) !important;
}

.cart-item-name {
    color: var(--theme-text) !important;
}

/* Search and filter section */
.search-filter-section {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

.search-box input {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

.category-btn {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

.category-btn:hover {
    border-color: var(--siamez-blue) !important;
}

/* Main content areas */
.main-content {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}

/* Info cards */
.info-card {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

.info-card h2 {
    color: var(--theme-text) !important;
}

/* Services section background */
#services {
    background: var(--theme-bg) !important;
}

/* Override gradient backgrounds in dark mode for better readability */
[data-theme="dark"] #services {
    background: var(--theme-bg) !important;
    background-image: none !important;
}

[data-theme="dark"] #contact {
    background: var(--theme-bg) !important;
    background-image: none !important;
}

/* Disclaimer section in dark mode */
[data-theme="dark"] section.bg-gradient-to-r {
    background: var(--theme-bg) !important;
    background-image: none !important;
}

[data-theme="dark"] section.bg-gradient-to-r .bg-white {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

/* About section */
#about {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}

/* Contact section */
#contact {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}

/* Disclaimer section */
section.bg-gradient-to-r {
    background: var(--theme-bg) !important;
}

section.bg-gradient-to-r .bg-white {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

/* Results count */
.results-count {
    color: var(--theme-text-secondary) !important;
}

/* Empty cart */
.empty-cart {
    color: var(--theme-text-secondary) !important;
}

/* Hero section - keep gradient but adjust text if needed */
.hero-pattern {
    /* Keep the gradient, but ensure text is readable */
    color: #ffffff !important;
}

/* Override hero section background in dark mode if needed */
[data-theme="dark"] .hero-pattern {
    background: linear-gradient(135deg, var(--siamez-blue) 0%, var(--siamez-gold) 100%) !important;
    color: #ffffff !important;
}

/* Footer - keep gradient */
#site-footer {
    /* Keep the gradient footer */
    background: linear-gradient(135deg, var(--siamez-blue) 0%, var(--siamez-gold) 100%) !important;
    color: #fff !important;
}

/* Stat cards in hero - keep white text */
.stat-card {
    color: #fff !important;
}

/* Mobile menu */
#mobile-nav {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

/* Theme switcher styling - already handled by CSS variables */

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Ensure logo area adapts to dark mode */
[data-theme="dark"] .logo-img {
    filter: brightness(1.1);
}

/* Override any white backgrounds in dark mode */
[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white {
    background-color: var(--theme-surface) !important;
    background: var(--theme-surface) !important;
}

/* Ensure text is readable in dark mode */
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900 {
    color: var(--theme-text) !important;
}

/* Thank you page dark mode */
[data-theme="dark"] body {
    background: var(--theme-bg) !important;
    background-image: none !important;
}

[data-theme="dark"] .thankyou-container {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

[data-theme="dark"] .thankyou-container h1 {
    color: var(--theme-text) !important;
}

[data-theme="dark"] .thankyou-container p {
    color: var(--theme-text-secondary) !important;
}

/* Override specific elements that should maintain their colors */
.service-icon,
.contact-icon-1, .contact-icon-2, .contact-icon-3,
.check-icon-1, .check-icon-2, .check-icon-3 {
    /* Keep gradient backgrounds for icons */
    transition: none;
}

/* Service price gradient text - adjust for dark mode */
[data-theme="dark"] .service-price,
[data-theme="dark"] .cart-item-price,
[data-theme="dark"] .cart-total .total-price {
    background: linear-gradient(135deg, var(--siamez-gold) 0%, var(--siamez-blue-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
