/* ==========================================================================
   Divalux Resort & Spa - Luxury Christmas & New Year Theme
   Self-contained styles (all prefixed with .xmas-).
   To disable: set CHRISTMAS_THEME_ENABLED = false in config.php
   ========================================================================== */

/* Full-screen Snow & Sparkle Canvas */
#xmas-snow-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1040;
    transition: opacity 0.45s ease;
}

#xmas-snow-canvas.xmas-hidden {
    opacity: 0;
}

/* Top Luxury Fairy Lights Garland (Zero layout shift, non-blocking) */
.xmas-garland {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    pointer-events: none;
    z-index: 1050;
    overflow: hidden;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.xmas-garland.xmas-hidden {
    opacity: 0;
    transform: translateY(-100%);
}

.xmas-garland-wire {
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 24px;
    background: repeating-radial-gradient(
        ellipse 60px 18px at 50% 0,
        transparent 0,
        transparent 16px,
        rgba(201, 169, 97, 0.45) 16.5px,
        rgba(201, 169, 97, 0.45) 18px,
        transparent 18.5px
    );
    background-size: 120px 24px;
}

.xmas-lights-row {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    width: 100%;
    padding: 0 8px;
    margin: 0;
    list-style: none;
}

.xmas-bulb {
    position: relative;
    width: 8px;
    height: 13px;
    margin-top: 4px;
    border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
    animation: xmas-twinkle 2.8s ease-in-out infinite;
    transform-origin: top center;
}

.xmas-bulb::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 4px;
    background: linear-gradient(180deg, #9a7b38, #c9a961);
    border-radius: 2px 2px 0 0;
}

.xmas-bulb:nth-child(4n + 1) {
    background: #ffe08a;
    box-shadow: 0 0 10px 2px rgba(255, 224, 138, 0.85), 0 0 22px 4px rgba(201, 169, 97, 0.45);
    animation-delay: 0s;
}

.xmas-bulb:nth-child(4n + 2) {
    background: #fff9ea;
    box-shadow: 0 0 10px 2px rgba(255, 249, 234, 0.9), 0 0 20px 4px rgba(255, 244, 214, 0.45);
    animation-delay: 0.7s;
    margin-top: 8px;
}

.xmas-bulb:nth-child(4n + 3) {
    background: #e04f54;
    box-shadow: 0 0 10px 2px rgba(224, 79, 84, 0.8), 0 0 20px 4px rgba(179, 32, 41, 0.4);
    animation-delay: 1.4s;
}

.xmas-bulb:nth-child(4n + 4) {
    background: #4ab37f;
    box-shadow: 0 0 10px 2px rgba(74, 179, 127, 0.8), 0 0 20px 4px rgba(30, 77, 59, 0.4);
    animation-delay: 2.1s;
    margin-top: 8px;
}

@keyframes xmas-twinkle {
    0%, 100% {
        opacity: 0.95;
        transform: scale(1) rotate(-2deg);
    }
    50% {
        opacity: 0.42;
        transform: scale(0.9) rotate(2deg);
    }
}

/* Floating Festive Widget Container (bottom-left, avoids music button & right FABs) */
.xmas-widget {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9998;
    font-family: var(--font-body, 'Prompt', 'Montserrat', sans-serif);
}

.xmas-widget.xmas-above-music {
    bottom: 84px;
}

/* Floating Festive Trigger Button */
.xmas-fab {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1.5px solid rgba(230, 196, 115, 0.9);
    background: linear-gradient(145deg, #8b1e24 0%, #5c1116 55%, #1b3b6f 100%);
    color: #fff6dc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 6px 20px rgba(27, 59, 111, 0.35), 0 0 14px rgba(201, 169, 97, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    padding: 0;
}

.xmas-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 26px rgba(139, 30, 36, 0.45), 0 0 22px rgba(230, 196, 115, 0.75);
}

.xmas-fab:focus-visible {
    outline: 2px solid #e6c473;
    outline-offset: 3px;
}

.xmas-fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: xmas-gentle-spin 14s linear infinite;
}

.xmas-fab-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(230, 196, 115, 0.55);
    animation: xmas-pulse-ring 2.6s ease-out infinite;
    pointer-events: none;
}

@keyframes xmas-gentle-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes xmas-pulse-ring {
    0% { transform: scale(0.95); opacity: 0.75; }
    70% { transform: scale(1.24); opacity: 0; }
    100% { transform: scale(1.24); opacity: 0; }
}

/* First-visit Subtle Festive Toast */
.xmas-toast {
    position: absolute;
    left: 62px;
    bottom: 6px;
    background: linear-gradient(135deg, rgba(21, 45, 84, 0.96) 0%, rgba(16, 33, 62, 0.96) 100%);
    color: #fff8e7;
    border: 1px solid rgba(201, 169, 97, 0.55);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.xmas-toast.xmas-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    cursor: pointer;
}

/* Popover Holiday Card */
.xmas-card {
    position: absolute;
    left: 0;
    bottom: 62px;
    width: 315px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(160deg, #162c52 0%, #0f1f3a 58%, #1d1522 100%);
    color: #f8f4ea;
    border: 1px solid rgba(201, 169, 97, 0.65);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(8, 15, 30, 0.55), 0 0 30px rgba(201, 169, 97, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.96);
    transform-origin: bottom left;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.xmas-card.xmas-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.xmas-card-banner {
    position: relative;
    padding: 18px 18px 14px;
    background: linear-gradient(135deg, rgba(139, 30, 36, 0.85) 0%, rgba(27, 59, 111, 0.85) 100%);
    border-bottom: 1px solid rgba(201, 169, 97, 0.35);
    text-align: center;
}

.xmas-card-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: #fff6dc;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.xmas-card-close:hover {
    background: rgba(201, 169, 97, 0.35);
    transform: rotate(90deg);
}

.xmas-badge {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #f3d78d;
    border: 1px solid rgba(243, 215, 141, 0.45);
    border-radius: 999px;
    padding: 3px 10px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.18);
}

.xmas-card-title {
    margin: 0 0 4px;
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
}

.xmas-card-sub {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 246, 224, 0.85);
    line-height: 1.45;
}

.xmas-card-body {
    padding: 15px 18px 18px;
}

/* Countdown Grid */
.xmas-countdown-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: #e6c473;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.xmas-countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.xmas-cd-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 169, 97, 0.28);
    border-radius: 8px;
    padding: 7px 4px;
    text-align: center;
}

.xmas-cd-num {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff6dc;
    line-height: 1.15;
}

.xmas-cd-unit {
    display: block;
    font-size: 10px;
    color: rgba(255, 246, 220, 0.65);
    margin-top: 2px;
}

.xmas-holiday-banner {
    text-align: center;
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: rgba(201, 169, 97, 0.14);
    border: 1px solid rgba(201, 169, 97, 0.45);
    color: #ffe7a8;
    font-weight: 600;
    font-size: 0.92rem;
}

/* Toggle Switches */
.xmas-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.xmas-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.84rem;
    color: #f3eee2;
    cursor: pointer;
    user-select: none;
}

.xmas-switch {
    position: relative;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}

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

.xmas-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    transition: background 0.25s ease;
}

.xmas-slider::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.25s ease;
}

.xmas-switch input:checked + .xmas-slider {
    background: linear-gradient(135deg, #c9a961, #e6c473);
}

.xmas-switch input:checked + .xmas-slider::before {
    transform: translateX(18px);
}

/* Action Buttons */
.xmas-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.xmas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    border: none;
    text-align: center;
}

.xmas-btn-sparkle {
    background: linear-gradient(135deg, #c9a961 0%, #e0c178 100%);
    color: #162238;
}

.xmas-btn-sparkle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(201, 169, 97, 0.45);
}

.xmas-btn-offers {
    background: rgba(255, 255, 255, 0.1);
    color: #fff6dc;
    border: 1px solid rgba(201, 169, 97, 0.45);
}

.xmas-btn-offers:hover {
    background: rgba(201, 169, 97, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Subtle Santa-Hat / Festive Shimmer on Mobile & Accessibility */
@media (max-width: 768px) {
    .xmas-widget {
        left: 14px;
        bottom: 14px;
    }

    .xmas-widget.xmas-above-music {
        bottom: 78px;
    }

    .xmas-fab {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }

    .xmas-toast {
        display: none;
    }

    .xmas-bulb:nth-child(even) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xmas-bulb,
    .xmas-fab-icon,
    .xmas-fab-ring {
        animation: none !important;
    }
}
