/* ==========================================================================
   THE WAN HOUSE - SEASONAL DYNAMIC THEME SYSTEM (FLAT & SOLID THEME ENGINE)
   Clean, Solid Single Colors (No Gradients), Ultra-High Contrast Typography
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DEFAULT THEME (The Wan House Signature)
   -------------------------------------------------------------------------- */
body[data-theme="default"],
body:not([data-theme]) {
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --border-card: rgba(2, 132, 199, 0.16);
    --text-primary: #0f172a;       /* Deep slate */
    --text-secondary: #475569;     /* Medium charcoal */
    --accent-color: #0284c7;
    --accent-hover: #0369a1;
    --accent-glow: rgba(2, 132, 199, 0.18);
    --theme-color: #0284c7;
    --theme-color-rgba: rgba(2, 132, 199, 0.12);
    --theme-color-light: rgba(2, 132, 199, 0.06);
    --primary-grad: #0284c7;       /* Solid Single Color */
    background-color: #f0f4f8 !important;
    background-image: none !important;
}

body[data-theme="default"][data-role="admin"] {
    --bg-main: #faf6ee;
    --bg-card: #ffffff;
    --border-card: rgba(217, 119, 6, 0.18);
    --text-primary: #1c1917;       /* Deep obsidian */
    --text-secondary: #44403c;     /* Dark charcoal */
    --accent-color: #b45309;
    --accent-hover: #92400e;
    --accent-glow: rgba(217, 119, 6, 0.20);
    --theme-color: #d97706;
    --theme-color-rgba: rgba(217, 119, 6, 0.14);
    --theme-color-light: rgba(217, 119, 6, 0.07);
    --primary-grad: #d97706;       /* Solid Single Color */
    background-color: #faf6ee !important;
    background-image: none !important;
}

/* --------------------------------------------------------------------------
   2. CHRISTMAS THEME (คริสต์มาส: Pine Emerald & Crimson Red)
   -------------------------------------------------------------------------- */
body[data-theme="christmas"] {
    --bg-main: #f2fbf5;
    --bg-card: #ffffff;
    --border-card: rgba(22, 163, 74, 0.18);
    --text-primary: #14532d;       /* Rich Deep Pine Green */
    --text-secondary: #334155;     /* Dark Charcoal Slate */
    --accent-color: #dc2626;       /* Festive Crimson */
    --accent-hover: #b91c1c;
    --accent-glow: rgba(220, 38, 38, 0.20);
    --theme-color: #16a34a;        /* Emerald Green */
    --theme-color-rgba: rgba(22, 163, 74, 0.14);
    --theme-color-light: rgba(22, 163, 74, 0.07);
    --primary-grad: #16a34a;       /* Solid Single Color */
    background-color: #f2fbf5 !important;
    background-image: none !important;
}

body[data-theme="christmas"][data-role="admin"] {
    --bg-main: #f0f8f3;
    --bg-card: #ffffff;
    --border-card: rgba(21, 128, 61, 0.22);
    --text-primary: #064e3b;       /* Deep Forest Pine */
    --text-secondary: #1e293b;     /* Deep Slate */
    --accent-color: #dc2626;
    --accent-hover: #991b1b;
    --accent-glow: rgba(220, 38, 38, 0.25);
    --theme-color: #15803d;
    --theme-color-rgba: rgba(21, 128, 61, 0.16);
    --theme-color-light: rgba(21, 128, 61, 0.08);
    --primary-grad: #15803d;       /* Solid Single Color */
    background-color: #f0f8f3 !important;
    background-image: none !important;
}

/* --------------------------------------------------------------------------
   3. NEW YEAR THEME (ปีใหม่: Midnight Indigo & Royal Gold)
   -------------------------------------------------------------------------- */
body[data-theme="newyear"] {
    --bg-main: #fdfbf7;
    --bg-card: #ffffff;
    --border-card: rgba(217, 119, 6, 0.18);
    --text-primary: #1e1b4b;       /* Deep Midnight Indigo */
    --text-secondary: #334155;     /* Dark Charcoal Slate */
    --accent-color: #d97706;       /* Royal Gold */
    --accent-hover: #b45309;
    --accent-glow: rgba(217, 119, 6, 0.20);
    --theme-color: #d97706;
    --theme-color-rgba: rgba(217, 119, 6, 0.14);
    --theme-color-light: rgba(217, 119, 6, 0.07);
    --primary-grad: #d97706;       /* Solid Single Color */
    background-color: #fdfbf7 !important;
    background-image: none !important;
}

body[data-theme="newyear"][data-role="admin"] {
    --bg-main: #faf7f0;
    --bg-card: #ffffff;
    --border-card: rgba(180, 83, 9, 0.22);
    --text-primary: #0f172a;       /* Obsidian Black */
    --text-secondary: #1e293b;     /* Deep Slate */
    --accent-color: #b45309;
    --accent-hover: #78350f;
    --accent-glow: rgba(180, 83, 9, 0.25);
    --theme-color: #b45309;
    --theme-color-rgba: rgba(180, 83, 9, 0.16);
    --theme-color-light: rgba(180, 83, 9, 0.08);
    --primary-grad: #b45309;       /* Solid Single Color */
    background-color: #faf7f0 !important;
    background-image: none !important;
}

/* --------------------------------------------------------------------------
   4. HALLOWEEN THEME (ฮัลโลวีน: Midnight Violet & Pumpkin Orange)
   -------------------------------------------------------------------------- */
body[data-theme="halloween"] {
    --bg-main: #faf6fd;
    --bg-card: #ffffff;
    --border-card: rgba(234, 88, 12, 0.18);
    --text-primary: #2e1065;       /* Deep Mysterious Violet */
    --text-secondary: #334155;     /* Dark Charcoal Slate */
    --accent-color: #ea580c;       /* Rich Pumpkin Orange */
    --accent-hover: #c2410c;
    --accent-glow: rgba(234, 88, 12, 0.22);
    --theme-color: #9333ea;        /* Purple Accent */
    --theme-color-rgba: rgba(147, 51, 234, 0.14);
    --theme-color-light: rgba(147, 51, 234, 0.07);
    --primary-grad: #ea580c;       /* Solid Single Color */
    background-color: #faf6fd !important;
    background-image: none !important;
}

body[data-theme="halloween"][data-role="admin"] {
    --bg-main: #f7f2fb;
    --bg-card: #ffffff;
    --border-card: rgba(194, 65, 12, 0.22);
    --text-primary: #1e0a3c;       /* Ultra Dark Violet */
    --text-secondary: #1e293b;     /* Deep Slate */
    --accent-color: #c2410c;
    --accent-hover: #9a3412;
    --accent-glow: rgba(194, 65, 12, 0.26);
    --theme-color: #7e22ce;
    --theme-color-rgba: rgba(126, 34, 206, 0.16);
    --theme-color-light: rgba(126, 34, 206, 0.08);
    --primary-grad: #c2410c;       /* Solid Single Color */
    background-color: #f7f2fb !important;
    background-image: none !important;
}

/* --------------------------------------------------------------------------
   5. SONGKRAN THEME (สงกรานต์: Fresh Lagoon Blue & Lotus Pink)
   -------------------------------------------------------------------------- */
body[data-theme="songkran"] {
    --bg-main: #f0fdfc;
    --bg-card: #ffffff;
    --border-card: rgba(8, 145, 178, 0.18);
    --text-primary: #164e63;       /* Deep Lagoon Cyan */
    --text-secondary: #334155;     /* Dark Charcoal Slate */
    --accent-color: #0891b2;       /* Fresh Cyan */
    --accent-hover: #0e7490;
    --accent-glow: rgba(8, 145, 178, 0.20);
    --theme-color: #0891b2;
    --theme-color-rgba: rgba(8, 145, 178, 0.14);
    --theme-color-light: rgba(8, 145, 178, 0.07);
    --primary-grad: #0891b2;       /* Solid Single Color */
    background-color: #f0fdfc !important;
    background-image: none !important;
}

body[data-theme="songkran"][data-role="admin"] {
    --bg-main: #edf9f9;
    --bg-card: #ffffff;
    --border-card: rgba(14, 116, 144, 0.22);
    --text-primary: #083344;       /* Deep Obsidian Ocean */
    --text-secondary: #1e293b;     /* Deep Slate */
    --accent-color: #0e7490;
    --accent-hover: #155e75;
    --accent-glow: rgba(14, 116, 144, 0.25);
    --theme-color: #0e7490;
    --theme-color-rgba: rgba(14, 116, 144, 0.16);
    --theme-color-light: rgba(14, 116, 144, 0.08);
    --primary-grad: #0e7490;       /* Solid Single Color */
    background-color: #edf9f9 !important;
    background-image: none !important;
}

/* --------------------------------------------------------------------------
   GLOBAL TYPOGRAPHY & ELEMENT STYLING ENFORCEMENT
   -------------------------------------------------------------------------- */
body {
    color: var(--text-primary) !important;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-primary) !important;
    font-weight: 700;
}

p, span, label, td, th, li, div {
    color: inherit;
}

.text-muted,
.stat-info h3,
.table th,
.table td,
.sidebar-link {
    color: var(--text-secondary) !important;
}

.table th {
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.02) !important;
}

.table tbody tr:hover td {
    color: var(--text-primary) !important;
}

.glass-card {
    background: var(--bg-card, #ffffff) !important;
    border: 1px solid var(--border-card) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-card) !important;
}

.sidebar {
    background: #ffffff !important;
    border-right: 1px solid var(--border-card) !important;
}

.dropdown-menu {
    background: #ffffff !important;
    border: 1px solid var(--border-card) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10) !important;
}

.dropdown-menu a,
.dropdown-menu button {
    color: var(--text-primary) !important;
}

.theme-festive-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid var(--border-card);
    color: var(--accent-color);
    box-shadow: 0 2px 6px var(--accent-glow);
}

/* --------------------------------------------------------------------------
   SUBTLE MICRO-ANIMATIONS (Non-distracting, pure CSS GPU)
   -------------------------------------------------------------------------- */
@keyframes festiveSnow {
    0% { transform: translateY(-10px) translateX(0); opacity: 0.7; }
    50% { transform: translateY(50vh) translateX(15px); opacity: 0.5; }
    100% { transform: translateY(105vh) translateX(-15px); opacity: 0.1; }
}

.festive-canvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Strictly isolate video player and prevent any particles from covering videos */
.video-wrapper,
#hls-player,
.player-section,
.video-card,
.glass-card,
.navbar,
.sidebar {
    position: relative;
    z-index: 10;
}

.player-section .video-wrapper {
    z-index: 20 !important;
}

/* Suppress all falling particles on player page */
body:has(#hls-player) .festive-canvas-overlay,
body:has(.player-section) .festive-canvas-overlay {
    display: none !important;
    visibility: hidden !important;
}

.snowflake-particle {
    position: absolute;
    top: -10px;
    color: rgba(22, 163, 74, 0.4);
    opacity: 0.5;
    user-select: none;
    animation: festiveSnow linear infinite;
    z-index: 0;
}

body[data-theme="christmas"] .snowflake-particle {
    color: #15803d;
}

body[data-theme="newyear"] .snowflake-particle {
    color: #d97706;
}

body[data-theme="christmas"] .nav-brand::after {
    content: " 🎄";
    font-size: 14px;
}

body[data-theme="newyear"] .nav-brand::after {
    content: " ✨";
    font-size: 14px;
}

body[data-theme="halloween"] .nav-brand::after {
    content: " 🎃";
    font-size: 14px;
}

body[data-theme="songkran"] .nav-brand::after {
    content: " 💦";
    font-size: 14px;
}
