/* Costa Gym — Theme System (dark / light / blue) */

html[data-theme="dark"] {
    --theme-primary: #ff2a2a;
    --theme-primary-dark: #990000;
    --theme-primary-rgb: 255, 42, 42;
    --theme-bg: #050505;
    --theme-bg-alt: #0a0a0a;
    --theme-card-bg: #0f0f0f;
    --theme-card-bg-elevated: #111111;
    --theme-card-border: #1a1a1a;
    --theme-border: #222222;
    --theme-border-light: #333333;
    --theme-nav-bg: rgba(17, 17, 17, 0.98);
    --theme-text: #ffffff;
    --theme-text-muted: #888888;
    --theme-text-soft: #cccccc;
    --theme-gradient: linear-gradient(135deg, #ff2a2a 0%, #990000 100%);
    --theme-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    --theme-hero-overlay: linear-gradient(to top, rgba(5, 5, 5, 1) 0%, rgba(5, 5, 5, 0.3) 100%);
    --theme-page-hero-overlay: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.5) 100%);
    --theme-header-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    --theme-popular-card-bg: #1a1010;
    --theme-mobile-nav-bg: #111111;
    --theme-footer-bg: #050505;
    --theme-footer-border: #1a1a1a;
    --theme-footer-bottom-bg: #000000;
    --theme-input-bg: #050505;
    --theme-input-border: #333333;
    --theme-review-card-bg: #0a0a0a;
    --theme-overlay-bg: rgba(0, 0, 0, 0.8);
    --theme-primary-glow: rgba(255, 42, 42, 0.35);
    --theme-primary-soft: rgba(255, 42, 42, 0.1);
    --theme-primary-shadow: rgba(255, 42, 42, 0.4);
    --theme-slide-text: #ffffff;
    --theme-icon-on-primary: #ffffff;
    --theme-hero-subtitle: rgba(255, 255, 255, 0.88);
    --theme-vip-card-bg: #0a0a0a;
    --theme-plan-pill-bg: #1a1a1a;
    --theme-plan-pill-text: #cccccc;
    --theme-vision-box-bg: rgba(15, 15, 15, 0.88);
    --theme-form-section-bg: #080808;
    --theme-btn-idle-bg: #2a2a2a;
    --theme-btn-idle-text: #ffffff;
    --theme-input-focus-bg: #000000;
    --theme-quote-icon: rgba(255, 42, 42, 0.08);
}

html[data-theme="light"],
html:not([data-theme]) {
    --theme-primary: #d62828;
    --theme-primary-dark: #9b2222;
    --theme-primary-rgb: 214, 40, 40;
    --theme-bg: #f4f5f7;
    --theme-bg-alt: #ffffff;
    --theme-card-bg: #ffffff;
    --theme-card-bg-elevated: #eef0f4;
    --theme-card-border: #e2e5ea;
    --theme-border: #dde1e7;
    --theme-border-light: #c8cdd6;
    --theme-nav-bg: rgba(255, 255, 255, 0.98);
    --theme-text: #1a1a2e;
    --theme-text-muted: #5c6370;
    --theme-text-soft: #3d4450;
    --theme-gradient: linear-gradient(135deg, #d62828 0%, #9b2222 100%);
    --theme-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    --theme-hero-overlay: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.2) 100%);
    --theme-page-hero-overlay: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.45) 100%);
    --theme-header-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --theme-popular-card-bg: #fff5f5;
    --theme-mobile-nav-bg: #ffffff;
    --theme-footer-bg: #eceef2;
    --theme-footer-border: #d5dae3;
    --theme-footer-bottom-bg: #dde1e7;
    --theme-input-bg: #ffffff;
    --theme-input-border: #c8cdd6;
    --theme-review-card-bg: #f8f9fb;
    --theme-overlay-bg: rgba(255, 255, 255, 0.92);
    --theme-primary-glow: rgba(214, 40, 40, 0.22);
    --theme-primary-soft: rgba(214, 40, 40, 0.08);
    --theme-primary-shadow: rgba(214, 40, 40, 0.25);
    --theme-slide-text: #ffffff;
    --theme-icon-on-primary: #ffffff;
    --theme-hero-subtitle: rgba(255, 255, 255, 0.9);
    --theme-vip-card-bg: #fffdf5;
    --theme-plan-pill-bg: #eef0f4;
    --theme-plan-pill-text: #3d4450;
    --theme-vision-box-bg: rgba(255, 255, 255, 0.96);
    --theme-form-section-bg: #e8eaef;
    --theme-btn-idle-bg: var(--theme-primary);
    --theme-btn-idle-text: #ffffff;
    --theme-input-focus-bg: #ffffff;
    --theme-quote-icon: rgba(214, 40, 40, 0.1);
}

html[data-theme="blue"] {
    --theme-primary: #3b82f6;
    --theme-primary-dark: #1d4ed8;
    --theme-primary-rgb: 59, 130, 246;
    --theme-bg: #0b1220;
    --theme-bg-alt: #111827;
    --theme-card-bg: #151f32;
    --theme-card-bg-elevated: #1a2540;
    --theme-card-border: #243049;
    --theme-border: #2a3655;
    --theme-border-light: #374151;
    --theme-nav-bg: rgba(17, 24, 39, 0.98);
    --theme-text: #f1f5f9;
    --theme-text-muted: #94a3b8;
    --theme-text-soft: #cbd5e1;
    --theme-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --theme-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    --theme-hero-overlay: linear-gradient(to top, rgba(11, 18, 32, 1) 0%, rgba(11, 18, 32, 0.3) 100%);
    --theme-page-hero-overlay: linear-gradient(to bottom, rgba(5, 10, 22, 0.48) 0%, rgba(5, 10, 22, 0.22) 50%, rgba(5, 10, 22, 0.52) 100%);
    --theme-header-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    --theme-popular-card-bg: #152040;
    --theme-mobile-nav-bg: #111827;
    --theme-footer-bg: #0b1220;
    --theme-footer-border: #243049;
    --theme-footer-bottom-bg: #070b14;
    --theme-input-bg: #0f1729;
    --theme-input-border: #2a3655;
    --theme-review-card-bg: #111827;
    --theme-overlay-bg: rgba(11, 18, 32, 0.85);
    --theme-primary-glow: rgba(59, 130, 246, 0.35);
    --theme-primary-soft: rgba(59, 130, 246, 0.12);
    --theme-primary-shadow: rgba(59, 130, 246, 0.4);
    --theme-slide-text: #ffffff;
    --theme-icon-on-primary: #ffffff;
    --theme-hero-subtitle: rgba(255, 255, 255, 0.88);
    --theme-vip-card-bg: #101a30;
    --theme-plan-pill-bg: #1a2540;
    --theme-plan-pill-text: #cbd5e1;
    --theme-vision-box-bg: rgba(21, 31, 50, 0.92);
    --theme-form-section-bg: #080d18;
    --theme-btn-idle-bg: #243049;
    --theme-btn-idle-text: #f1f5f9;
    --theme-input-focus-bg: #0f1729;
    --theme-quote-icon: rgba(59, 130, 246, 0.12);
}

html {
    --primary-color: var(--theme-primary);
    --primary-red: var(--theme-primary);
    --dark-bg: var(--theme-bg);
    --card-bg: var(--theme-card-bg);
    --card-border: var(--theme-card-border);
    --text-light: var(--theme-text);
    --text-muted: var(--theme-text-muted);
    --text-hover: var(--theme-primary);
    --nav-bg: var(--theme-nav-bg);
    --gradient: var(--theme-gradient);
    --shadow: var(--theme-shadow);
    --footer-bg: var(--theme-footer-bg);
    --footer-border: var(--theme-footer-border);
    --footer-bottom-bg: var(--theme-footer-bottom-bg);
    --input-bg: var(--theme-input-bg);
    --accent-gold: #ffc107;
    --vip-gradient: linear-gradient(135deg, #d4af37 0%, #aa7c11 100%);
}

input::placeholder,
textarea::placeholder {
    color: var(--theme-text-muted);
    opacity: 0.85;
}

/* Page hero — خلفية الصفحات الداخلية (باقات، أساطير، إلخ) */
.page-hero {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 4px solid var(--theme-primary);
    overflow: hidden;
    isolation: isolate;
}
.page-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}
.page-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--theme-page-hero-overlay);
    pointer-events: none;
}
.page-hero .page-title {
    position: relative;
    z-index: 2;
    padding: 0 5%;
}
@media (max-width: 768px) {
    .page-hero {
        height: 44vh;
        min-height: 340px;
    }
}

.theme-switcher { position: relative; }

.theme-switch-btn {
    background: transparent;
    color: var(--theme-text);
    border: 2px solid var(--theme-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.3s;
    padding: 0;
}

.theme-switch-btn:hover,
.theme-switch-btn.active {
    background: var(--theme-primary);
    color: var(--theme-icon-on-primary);
    box-shadow: 0 0 14px var(--theme-primary-glow);
}

.theme-switch-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    min-width: 168px;
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-card-border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--theme-shadow);
    display: none;
    z-index: 1100;
}

[dir="ltr"] .theme-switch-menu {
    right: 0;
    left: auto;
}

.theme-switch-menu.open {
    display: block;
    animation: themeMenuIn 0.2s ease;
}

@keyframes themeMenuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.theme-option {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--theme-text);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    transition: 0.2s;
}

[dir="ltr"] .theme-option { text-align: left; }

.theme-option:hover,
.theme-option.active {
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
}

.theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--theme-card-border);
    flex-shrink: 0;
}

.theme-swatch-dark { background: linear-gradient(135deg, #111, #ff2a2a); }
.theme-swatch-light { background: linear-gradient(135deg, #fff, #d62828); }
.theme-swatch-blue { background: linear-gradient(135deg, #0b1220, #3b82f6); }

.mobile-theme-options {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 12px 5% 20px;
    border-bottom: 1px solid var(--theme-border);
}

.mobile-theme-options .theme-option {
    justify-content: flex-start;
    background: var(--theme-bg-alt);
    border: 1px solid var(--theme-border);
}

@media (max-width: 768px) {
    .theme-switcher.desktop-only,
    .header-theme-slot.desktop-only { display: none; }
    .mobile-theme-options { display: flex; }
}

@media (min-width: 769px) {
    .mobile-theme-options { display: none !important; }
}
