/**
 * MorningStar Translation MM - Festive Themes System
 * 
 * Modular Theme Format designed for seasonal celebrations:
 * - Thadingyut (သီတင်းကျွတ် - Festival of Lights)
 * - Christmas & Holiday Season (ခရစ်စမတ်)
 * - Future seasons (Thingyan / New Year)
 * 
 * Rule: Base styles remain 100% untouched. All festive overrides are scoped under
 * [data-theme="..."] or .theme-... on the <html> or <body> element.
 */

/* ==========================================================================
   1. FESTIVE CANVAS & FLOATING PARTICLES CONTAINER
   ========================================================================== */
#festive-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 40; /* Below modals (1050) & dropdowns (1000), above background */
    overflow: hidden;
    display: none;
    opacity: 1;
    transition: opacity 2s ease-out;
}

[data-festive-active="true"] #festive-canvas-container {
    display: block;
}

#festive-canvas-container.festive-faded {
    opacity: 0;
    pointer-events: none;
}

#festive-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==========================================================================
   2. THEME: THADINGYUT (သီတင်းကျွတ် မီးထွန်းပွဲတော်)
   Golden Amber, Warm Candlelight, Festive Paper Lantern Glow
   ========================================================================== */
[data-theme="thadingyut"] {
    /* Token overrides for Thadingyut */
    --festive-primary: #f59e0b;
    --festive-primary-glow: rgba(245, 158, 11, 0.45);
    --festive-secondary: #d97706;
    --festive-accent: #fbbf24;
    --festive-light: #fef3c7;
    --festive-border: rgba(245, 158, 11, 0.35);
    --festive-border-strong: rgba(251, 191, 36, 0.6);
    --festive-bg-glow: rgba(245, 158, 11, 0.08);

    /* Smooth transition for theme colors */
    --primarycolor: #f59e0b;
    --footer-primary-color: #f59e0b;
    --footer-accent-color: #d97706;
    --brand-text-color: #fbbf24;
}

/* Navbar Festive Decor */
[data-theme="thadingyut"] .navbar-custom {
    border-bottom: 1px solid var(--festive-border);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.18), 0 1px 0 rgba(251, 191, 36, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Festive string lights accent along navbar bottom */
[data-theme="thadingyut"] .navbar-custom::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(245, 158, 11, 0.3) 15%, 
        rgba(251, 191, 36, 0.9) 50%, 
        rgba(245, 158, 11, 0.3) 85%, 
        transparent 100%
    );
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
    animation: festiveLightPulse 3s ease-in-out infinite alternate;
}

/* Logo Festive Lantern Ornament */
[data-theme="thadingyut"] .navbar-logo {
    position: relative;
}

[data-theme="thadingyut"] .navbar-logo::after {
    content: '🏮';
    display: inline-block;
    margin-left: 6px;
    font-size: 1.4rem;
    animation: festiveLanternSwing 2.5s ease-in-out infinite alternate;
    transform-origin: top center;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
    vertical-align: middle;
}

[data-theme="thadingyut"] .navbar-logo-text {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* Nav Links hover & active state */
[data-theme="thadingyut"] .nav-link:hover,
[data-theme="thadingyut"] .nav-link.active {
    color: var(--festive-accent) !important;
    text-shadow: 0 0 8px var(--festive-primary-glow);
}

/* Stars & Points badge glow */
[data-theme="thadingyut"] .navbar-stars {
    border-color: var(--festive-border);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

[data-theme="thadingyut"] .navbar-stars .star-count {
    color: var(--festive-accent);
}

/* Notification bell badge glow */
[data-theme="thadingyut"] .notification-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

/* Primary buttons and CTAs accent */
[data-theme="thadingyut"] .btn-primary,
[data-theme="thadingyut"] .navbar-auth-signup {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border-color: #d97706 !important;
    color: #0f172a !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

[data-theme="thadingyut"] .btn-primary:hover,
[data-theme="thadingyut"] .navbar-auth-signup:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    color: #0f172a !important;
}

/* Footer border subtle golden warmth */
[data-theme="thadingyut"] .footer,
[data-theme="thadingyut"] footer {
    border-top-color: var(--festive-border) !important;
}

/* ==========================================================================
   3. THEME: CHRISTMAS (ခရစ်စမတ် & နှစ်သစ်ကူး - PRE-CONFIGURED TEMPLATE)
   Holiday Pine Green, Ruby Red, Warm Snow Glow
   ========================================================================== */
[data-theme="christmas"] {
    --festive-primary: #10b981;
    --festive-primary-glow: rgba(16, 185, 129, 0.4);
    --festive-secondary: #ef4444;
    --festive-accent: #34d399;
    --festive-light: #ecfdf5;
    --festive-border: rgba(16, 185, 129, 0.35);
    --festive-border-strong: rgba(239, 68, 68, 0.6);

    --primarycolor: #10b981;
    --footer-primary-color: #10b981;
    --footer-accent-color: #059669;
}

[data-theme="christmas"] .navbar-custom {
    border-bottom: 1px solid var(--festive-border);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

[data-theme="christmas"] .navbar-logo::after {
    content: '🎄';
    display: inline-block;
    margin-left: 6px;
    font-size: 1.4rem;
    animation: festiveLanternSwing 3s ease-in-out infinite alternate;
}

/* ==========================================================================
   4. FESTIVE THEME SWITCHER WIDGET (UI Controls)
   Floating Trigger & Quick Switcher Popup
   ========================================================================== */
.festive-switcher-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 9999px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fef3c7;
    font-size: 1.3rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(245, 158, 11, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
}

.festive-switcher-trigger:hover {
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.9);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.45);
    color: #ffffff;
}

.festive-switcher-trigger .trigger-icon {
    font-size: 1.6rem;
    line-height: 1;
    display: inline-block;
    animation: festiveIconBob 2s ease-in-out infinite alternate;
}

.festive-switcher-trigger .trigger-label {
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: 0.3px;
}

/* Navbar Switcher Pill (Optional Navbar integration) */
.nav-festive-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24 !important;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.nav-festive-btn:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
    color: #ffffff !important;
}

/* Switcher Modal / Popover Sheet */
.festive-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.festive-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.festive-modal-card {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.2);
    padding: 24px;
    color: #eee;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.festive-modal-overlay.active .festive-modal-card {
    transform: scale(1) translateY(0);
}

.festive-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #14b8a6, #f59e0b, #ef4444);
}

.festive-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.festive-modal-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.festive-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.6rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.festive-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.festive-theme-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.festive-theme-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.festive-theme-option:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.festive-theme-option.active {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.18);
}

.festive-theme-option.active[data-theme-key="default"] {
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(20, 184, 166, 0.6);
    box-shadow: 0 0 16px rgba(20, 184, 166, 0.18);
}

.festive-theme-option.active[data-theme-key="christmas"] {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.18);
}

.theme-option-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-option-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.theme-option-text h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 2px 0;
}

.theme-option-text p {
    font-size: 1.2rem;
    color: #94a3b8;
    margin: 0;
}

.theme-option-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
}

.festive-theme-option.active .theme-option-check {
    border-color: currentColor;
    background: currentColor;
}

.festive-theme-option.active .theme-option-check i {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 900;
}

/* Animation toggle switch in modal */
.festive-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.festive-settings-text {
    display: flex;
    flex-direction: column;
}

.festive-settings-label {
    font-size: 1.35rem;
    font-weight: 500;
    color: #e2e8f0;
}

.festive-settings-hint {
    font-size: 1.15rem;
    color: #64748b;
}

/* Custom toggle switch */
.festive-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.festive-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.festive-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.festive-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .festive-slider {
    background-color: #f59e0b;
}

input:checked + .festive-slider:before {
    transform: translateX(20px);
}

/* ==========================================================================
   5. KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes festiveLightPulse {
    0% {
        opacity: 0.6;
        filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.5));
    }
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.9));
    }
}

@keyframes festiveLanternSwing {
    0% {
        transform: rotate(-6deg);
    }
    100% {
        transform: rotate(6deg);
    }
}

@keyframes festiveIconBob {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-3px);
    }
}

/* Respect Accessibility / Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #festive-canvas-container {
        display: none !important;
    }
    [data-theme="thadingyut"] .navbar-logo::after,
    [data-theme="thadingyut"] .navbar-custom::after,
    .festive-switcher-trigger .trigger-icon {
        animation: none !important;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .festive-switcher-trigger {
        bottom: 20px;
        right: 16px;
        padding: 7px 12px;
        font-size: 1.2rem;
    }
    .festive-switcher-trigger .trigger-label {
        display: none; /* Icon-only compact pill on mobile screens */
    }
}
