/* Theme Management System Variables */

:root {
    /* Sapphire Aurora (Default Dark Mode) */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --glass-blur: blur(16px);
    --shadow-3d: 0 20px 45px -12px rgba(99, 102, 241, 0.25);
    --header-bg: linear-gradient(135deg, #090d16 0%, #111827 100%);
    --card-shadow-hover: 0 25px 50px -12px rgba(99, 102, 241, 0.35);
    --dropdown-bg: #1f2937;
    --dropdown-text: #f3f4f6;
    --dropdown-hover: #374151;
    --text-muted: #cbd5e1;
}

body.theme-emerald {
    /* Emerald Executive (Light Mode) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --accent: #10b981;
    --accent-hover: #059669;
    --glass-blur: none;
    --shadow-3d: 0 15px 30px -10px rgba(16, 185, 129, 0.15);
    --header-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-shadow-hover: 0 20px 40px -10px rgba(16, 185, 129, 0.25);
    --dropdown-bg: #ffffff;
    --dropdown-text: #1e293b;
    --dropdown-hover: #f1f5f9;
    --text-muted: #64748b;
}

body.theme-cyberpunk {
    /* Cyberpunk Neon (3D Dark Mode) */
    --bg-primary: #05050a;
    --bg-secondary: #0d0d1a;
    --text-primary: #00ffcc;
    --text-secondary: #ff007f;
    --card-bg: rgba(13, 13, 26, 0.85);
    --card-border: rgba(255, 0, 127, 0.3);
    --accent: #ff007f;
    --accent-hover: #ff3399;
    --glass-blur: blur(8px);
    --shadow-3d: 0 0 25px rgba(255, 0, 127, 0.3);
    --header-bg: linear-gradient(135deg, #030307 0%, #0d0d1a 100%);
    --card-shadow-hover: 0 0 35px rgba(0, 255, 204, 0.5);
    --dropdown-bg: #0d0d1a;
    --dropdown-text: #00ffcc;
    --dropdown-hover: #1f1f3d;
    --text-muted: #ff007f;
}

body.theme-slate {
    /* Minimalist Slate (Modern Matte) */
    --bg-primary: #e2e8f0;
    --bg-secondary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: #f8fafc;
    --card-border: #cbd5e1;
    --accent: #475569;
    --accent-hover: #334155;
    --glass-blur: none;
    --shadow-3d: 0 10px 25px -5px rgba(71, 85, 105, 0.12);
    --header-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --card-shadow-hover: 0 15px 30px -5px rgba(71, 85, 105, 0.2);
    --dropdown-bg: #f8fafc;
    --dropdown-text: #1e293b;
    --dropdown-hover: #e2e8f0;
    --text-muted: #64748b;
}

body.theme-inkwash {
    /* Ink Wash (Matte Dark Charcoal) */
    --bg-primary: #252525;
    --bg-secondary: #1a1a1a;
    --text-primary: #CFCFCF;
    --text-secondary: #7D7D7D;
    --card-bg: #2a2a2a;
    --card-border: #545454;
    --accent: #CFCFCF;
    --accent-hover: #7D7D7D;
    --glass-blur: none;
    --shadow-3d: 0 15px 30px rgba(0,0,0,0.5);
    --header-bg: linear-gradient(135deg, #181818 0%, #252525 100%);
    --card-shadow-hover: 0 20px 40px rgba(0,0,0,0.7);
    --dropdown-bg: #1a1a1a;
    --dropdown-text: #CFCFCF;
    --dropdown-hover: #545454;
    --text-muted: #7D7D7D;
}

body.theme-nightfall {
    /* Sapphire Nightfall Whisper (Vibrant Navy & Midnight Sky) */
    --bg-primary: #262B40;
    --bg-secondary: #1d2030;
    --text-primary: #A8C4EC;
    --text-secondary: #5379AE;
    --card-bg: rgba(38, 43, 64, 0.7);
    --card-border: rgba(168, 196, 236, 0.2);
    --accent: #0474C4;
    --accent-hover: #06457F;
    --glass-blur: blur(12px);
    --shadow-3d: 0 15px 30px rgba(4, 116, 196, 0.2);
    --header-bg: linear-gradient(135deg, #06457F 0%, #262B40 100%);
    --card-shadow-hover: 0 20px 40px rgba(4, 116, 196, 0.35);
    --dropdown-bg: #1d2030;
    --dropdown-text: #A8C4EC;
    --dropdown-hover: #2c334f;
    --text-muted: #5379AE;
}

body.theme-frosted {
    /* Frosted Aura (Cool Frosted Light Theme) */
    --bg-primary: #D4DDE2;
    --bg-secondary: #FFFFFF;
    --text-primary: #2c3e47;
    --text-secondary: #5C7E8F;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(92, 126, 143, 0.2);
    --accent: #5C7E8F;
    --accent-hover: #4a6775;
    --glass-blur: blur(10px);
    --shadow-3d: 0 15px 30px rgba(92, 126, 143, 0.1);
    --header-bg: linear-gradient(135deg, #5C7E8F 0%, #84a2b2 100%);
    --card-shadow-hover: 0 20px 40px rgba(92, 126, 143, 0.2);
    --dropdown-bg: #FFFFFF;
    --dropdown-text: #2c3e47;
    --dropdown-hover: #eef2f4;
    --text-muted: #A2A2A2;
}

body.theme-opaline {
    /* Opaline (Minimalist White & Vibrant Coral) */
    --bg-primary: #F4F4F6;
    --bg-secondary: #FFFFFF;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --card-bg: #FFFFFF;
    --card-border: #E7E7E7;
    --accent: #FF634A;
    --accent-hover: #e54e36;
    --glass-blur: none;
    --shadow-3d: 0 15px 30px rgba(255, 99, 74, 0.08);
    --header-bg: linear-gradient(135deg, #1d1d1f 0%, #3a3a3c 100%);
    --card-shadow-hover: 0 20px 40px rgba(255, 99, 74, 0.15);
    --dropdown-bg: #FFFFFF;
    --dropdown-text: #1d1d1f;
    --dropdown-hover: #F4F4F6;
    --text-muted: #D2D2D4;
}

/* Base Override Rules using CSS Variables */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header {
    background: var(--header-bg) !important;
    transition: background 0.3s ease;
}

/* Dynamic card styling with 3D tilt support */
.card, .depth-card-3d {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: var(--shadow-3d) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border-radius: 24px !important;
    padding: 24px;
    margin-bottom: 24px;
    transition: border 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.1s cubic-bezier(0.25, 1, 0.5, 1);
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg)) scale3d(var(--scale, 1), var(--scale, 1), var(--scale, 1));
    will-change: transform;
}

.card:hover, .depth-card-3d:hover {
    box-shadow: var(--card-shadow-hover) !important;
}

/* Form controls variables override */
.form-group input, .form-group select, .form-group textarea {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--card-border) !important;
}

/* Text overrides */
.text-slate-900, .text-slate-800, .text-slate-700 {
    color: var(--text-primary) !important;
}
.text-slate-600, .text-slate-500, .text-slate-400 {
    color: var(--text-secondary) !important;
}
.text-slate-300, .text-slate-200, .text-slate-100 {
    color: var(--text-muted) !important;
}

/* Dropdown styling */
.dropdown-menu {
    background-color: var(--dropdown-bg) !important;
    border-color: var(--card-border) !important;
    color: var(--dropdown-text) !important;
}
.dropdown-menu a,
.dropdown-menu button,
.dropdown-menu div,
.dropdown-menu span {
    color: var(--dropdown-text) !important;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background-color: var(--dropdown-hover) !important;
    color: var(--accent) !important;
}
.dropdown-menu a:hover span,
.dropdown-menu button:hover span {
    color: var(--accent) !important;
}

/* Background utilities and card border overrides */
.bg-white {
    background-color: var(--bg-secondary) !important;
}
.bg-slate-50, .bg-slate-100 {
    background-color: var(--bg-primary) !important;
}
.bg-slate-50\/30 {
    background-color: var(--bg-primary) !important;
}
.border-slate-100, .border-slate-200, .border-slate-50, .border-slate-300 {
    border-color: var(--card-border) !important;
}

/* Responsive Viewport Resolution Auto-Scaling */
html {
    font-size: 16px;
    transition: font-size 0.2s ease;
}
@media (max-width: 1440px) {
    html {
        font-size: 15px; /* Scale down slightly on standard laptops */
    }
}
@media (max-width: 1200px) {
    html {
        font-size: 14px; /* Scale down on smaller laptop monitors / tablet landscape */
    }
}
@media (max-width: 768px) {
    html {
        font-size: 13px; /* Mobile standard base scaling */
    }
}
@media (min-width: 1800px) {
    html {
        font-size: 17px; /* Scale up slightly on QHD/large monitors */
    }
    .container {
        max-width: 1600px !important; /* Utilize extra width on large screens */
    }
}
@media (min-width: 2200px) {
    html {
        font-size: 18px; /* Scale up further on 4K / ultrawide displays */
    }
    .container {
        max-width: 1800px !important; /* Maximize layout utility on 4K */
    }
}

