/* Modern Navision Theme v3.1 (Retro Green Bar + Soft Pastels) */
:root {
    /* 1. DEFAULT THEME (Soft Blue/Slate) */
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
    --primary-color: #475569;
    --text-main: #334155;
    --text-muted: #64748b;
    --card-shadow: 0 4px 20px 0 rgba(71, 85, 105, 0.1);
    --nav-bg: #ffffff;
    --nav-text: #334155;
    --font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    --link-color: #475569;
    /* Default Link Color */
}

[data-theme="dark"] {
    /* 2. DARK THEME (Retro Terminal - Calm Green) */
    --bg-gradient: #000000;
    --glass-bg: rgba(0, 0, 0, 0.92);
    --glass-border: #008800;
    --primary-color: #00cc00;
    /* Standard Terminal Green */
    --text-main: #00cc00;
    --text-muted: #006600;
    --card-shadow: 0 0 15px rgba(0, 200, 0, 0.2);
    --nav-bg: #000000;
    --nav-text: #00cc00;
    --font-family: 'Courier New', Courier, 'Lucida Console', monospace;
    --link-color: #e2e8f0;
    /* White/Gray Links for Dark Mode */
}

/* FORCE RETRO FONT ON EVERYTHING IN DARK MODE */
/* FORCE RETRO FONT ON EVERYTHING IN DARK MODE (EXCEPT ICONS) */
[data-theme="dark"] *:not(i) {
    font-family: 'Courier New', Courier, 'Lucida Console', monospace !important;
}

/* 3. NATURE THEME: Organic / Soft (Trebuchet MS) */
[data-theme="nature"] *:not(i) {
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif !important;
}

/* 4. SUNSET THEME: Warm / Friendly (Candara) */
[data-theme="sunset"] *:not(i) {
    font-family: 'Candara', 'Calibri', 'Segoe UI', 'Optima', Arial, sans-serif !important;
}

/* 5. PROFESSIONAL THEME: Crisp / Business (Tahoma) */
[data-theme="professional"] *:not(i) {
    font-family: 'Tahoma', 'Verdana', 'Segoe UI', sans-serif !important;
}

[data-theme="nature"] {
    /* 3. NATURE THEME (Sage/Mint) */
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
    --primary-color: #4d7c0f;
    --text-main: #365314;
    --text-muted: #65a30d;
    --card-shadow: 0 4px 20px 0 rgba(63, 98, 18, 0.1);
    --nav-bg: #f7fee7;
    --nav-text: #365314;
    --font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    --link-color: #4d7c0f;
}

[data-theme="sunset"] {
    /* 4. SUNSET THEME (Peach/Sand) */
    --bg-gradient: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 237, 213, 0.6);
    --primary-color: #c2410c;
    --text-main: #7c2d12;
    --text-muted: #9a3412;
    --card-shadow: 0 4px 20px 0 rgba(194, 65, 12, 0.1);
    --nav-bg: #fffaf0;
    --nav-text: #7c2d12;
    --font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    --link-color: #c2410c;
}

[data-theme="ocean"] {
    /* 5. OCEAN THEME (Sky/Mist) */
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(224, 242, 254, 0.6);
    --primary-color: #0284c7;
    --text-main: #0c4a6e;
    --text-muted: #0369a1;
    --card-shadow: 0 4px 20px 0 rgba(3, 105, 161, 0.1);
    --nav-bg: #f0f9ff;
    --nav-text: #0c4a6e;
    --font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    --nav-text: #0c4a6e;
    --font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    --link-color: #0284c7;
}

[data-theme="professional"] {
    /* 6. PROFESSIONAL THEME (Navy/Slate) */
    --bg-gradient: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(148, 163, 184, 0.6);
    --primary-color: #0f172a;
    /* Slate 900 */
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #475569;
    --card-shadow: 0 4px 20px 0 rgba(15, 23, 42, 0.15);
    /* DARK HEADER FOR CONTRAST */
    --nav-bg: #0f172a;
    --nav-text: #f1f5f9;
    --font-family: 'Tahoma', 'Verdana', 'Segoe UI', sans-serif;
    --link-color: #0f172a;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.4;
    transition: all 0.5s ease;
}

/* Global Link Resets */
a {
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
}

/* Dark Mode Specific Link Overrides */
[data-theme="dark"] a {
    color: var(--link-color) !important;
    text-decoration: underline;
}

[data-theme="dark"] a:hover {
    color: #ffffff !important;
    text-decoration: none;
    background: #003300;
}

[data-theme="dark"] .nav-links a {
    color: #00cc00 !important;
    text-decoration: none;
}

/* Keep nav green */
[data-theme="dark"] .nav-links a:hover {
    color: #000000 !important;
    background: #00cc00;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

/* --- LOGIN PAGE STYLES --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .login-card {
    border: 2px solid #00cc00;
    background: #000000;
}

.login-logo {
    max-width: 140px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

[data-theme="dark"] .login-logo {
    filter: invert(1) hue-rotate(100deg) brightness(1.5);
}

.input-group {
    position: relative;
    margin-bottom: 1.2rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    color: #334155;
}

[data-theme="dark"] .input-group input {
    background: #000000;
    border: 1px solid #00cc00;
    color: #00cc00;
    font-family: 'Courier New', monospace;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1);
}

[data-theme="dark"] .input-group input:focus {
    background: #0a0a0a;
    box-shadow: 0 0 10px #00cc00;
}

.btn-primary {
    width: 100%;
    padding: 0.7rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .btn-primary {
    background: #000000;
    border: 2px solid #00cc00;
    color: #00cc00;
}

[data-theme="dark"] .btn-primary:hover {
    background: #00cc00;
    color: #000000;
}

.btn-primary:hover {
    filter: brightness(110%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- NAVIGATION BAR --- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 1rem;
    background: var(--nav-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    text-decoration: none;
}

.nav-brand img {
    height: 28px;
}

[data-theme="dark"] .nav-brand img {
    filter: grayscale(1) invert(1) sepia(100%) hue-rotate(50deg) saturate(500%);
}

.nav-links {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    list-style: none;
    flex-wrap: wrap;
}

/* --- MOBILE TOGGLE (Restored) --- */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-main);
}

/* --- THEME-SPECIFIC ICON STYLES --- */

/* Base Icon Style */
.nav-icon {
    margin-right: 6px;
    transition: all 0.3s ease;
}

/* MENU TYPOGRAPHY & ANIMATION */
/* MENU TYPOGRAPHY & ANIMATION */
.nav-links a {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 500;
    font-size: 0.55rem;
    /* Reduced by ~30% from 0.7rem */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 50px;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 1. Default: Simple Colored Icon */



/* --- CONTROLS: THEME SELECTOR & LOGOUT --- */

/* Theme Selector - Modern Glass */
.theme-select {
    appearance: none;
    /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.4rem 2rem 0.4rem 1rem;
    border-radius: 20px;
    /* Pill shape */
    border: 1px solid var(--glass-border);
    background-color: var(--glass-bg);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23334155%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 0.65em auto;
    color: var(--text-main);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    outline: none;
    min-width: 140px;
}

.theme-select:hover {
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Logout Button - Pill Style */
.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444 !important;
    padding: 0.2rem 0.6rem;
    /* 50% Reduction */
    border-radius: 15px;
    font-size: 0.65rem;
    /* Smaller font */
    font-weight: 700;
    text-decoration: none !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #ef4444;
    color: white !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- DARK MODE OVERRIDES FOR CONTROLS --- */
[data-theme="dark"] .theme-select {
    background-color: #000000;
    border: 1px solid #00cc00;
    color: #00cc00;
    border-radius: 0;
    /* Retro square */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300cc00%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    font-family: 'Courier New', monospace;
    /* RETRO FONT */
    font-weight: 700;
}

[data-theme="dark"] .logout-btn {
    background: #000000;
    color: #ef4444 !important;
    /* Keep Red for Danger */
    border: 1px solid #ef4444;
    border-radius: 0;
    /* Retro square */
    font-family: 'Courier New', monospace;
    /* RETRO FONT */
    font-weight: 700;
}

[data-theme="dark"] .logout-btn:hover {
    background: #ef4444;
    color: #000000 !important;
}

/* Base Icon Style */
/* Base Icon Style */
.nav-icon {
    margin-right: 0;
    margin-bottom: 4px;
    font-size: 1.25rem;
    /* Reduced by another 15% */
    transition: all 0.3s ease;
    display: inline-block;
}

/* 1. Default: Simple Colored Icon */
.nav-icon {
    color: var(--primary-color);
    opacity: 0.8;
}

.nav-links a:hover .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* 2. Dark Mode: HIDDEN (Retro Text Only) */
[data-theme="dark"] .nav-icon {
    display: none !important;
}

[data-theme="dark"] .nav-links a {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    /* Slightly larger for readability in mono */
    transform: none !important;
    /* No zoom for Retro */
    display: inline-block;
    /* Revert to inline block for Retro */
    min-width: auto;
    padding: 0.3rem 0.5rem;
}

[data-theme="dark"] .nav-links a:hover {
    background: #00cc00;
    color: #000000 !important;
    /* Black text on Green Hover */
    transform: none !important;
    box-shadow: 0 0 10px #00ff00;
}

/* 3. Nature Theme: Circle Background */
[data-theme="nature"] .nav-icon {
    background: rgba(77, 124, 15, 0.15);
    /* Light Green Bg */
    padding: 0;
    /* Remove padding as we center flex */
    border-radius: 50%;
    width: 36px;
    /* Reduced to fit 1.25rem icon */
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    /* Reduced by 15% */
    margin-bottom: 2px;
}

[data-theme="nature"] .nav-links a:hover .nav-icon {
    background: var(--primary-color);
    color: white;
    transform: rotate(15deg) scale(1.1);
}

/* 4. Sunset Theme: Floating / Soft Shadow */
[data-theme="sunset"] .nav-icon {
    text-shadow: 0 2px 4px rgba(194, 65, 12, 0.2);
    position: relative;
    top: -1px;
}

[data-theme="sunset"] .nav-links a:hover .nav-icon {
    top: -3px;
    text-shadow: 0 4px 8px rgba(194, 65, 12, 0.4);
    color: #ea580c;
}

/* 5. Ocean Theme: Underline / Glow Effect */
[data-theme="ocean"] .nav-icon {
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

[data-theme="ocean"] .nav-links a:hover .nav-icon {
    border-bottom-color: var(--primary-color);
    text-shadow: 0 0 5px rgba(2, 132, 199, 0.4);
}

/* 6. Professional Theme: High Contrast White */
[data-theme="professional"] .nav-brand img {
    filter: brightness(0) invert(1);
    /* Pure White Logo */
    opacity: 0.9;
}

[data-theme="professional"] .nav-icon {
    color: #e2e8f0;
    /* Light Slate */
    opacity: 0.8;
}

/* Fix Brand Name Visibility */
[data-theme="professional"] .nav-brand {
    color: #ffffff !important;
}

/* Fix Menu Hover Visibility */
[data-theme="professional"] .nav-links a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15);
    /* Lighten BG */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="professional"] .nav-links a:hover .nav-icon {
    color: #ffffff;
    opacity: 1;
    transform: translateY(-2px);
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
    .nav-links {
        gap: 0.2rem;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0.3rem 0.4rem;
    }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: var(--nav-bg);
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        text-align: center;
        gap: 0.8rem;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* --- DATA TABLES (High Density - Soft) --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--glass-bg);
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
    box-shadow: var(--card-shadow);
    font-size: 0.85rem;
}

[data-theme="dark"] table {
    border: 1px solid #00cc00;
}

th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.5rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] th {
    background: #00cc00 !important;
    /* GREEN HEADER BAR */
    color: #000000 !important;
    /* BLACK TEXT */
    border-bottom: 1px solid #00ff00;
}

td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    color: var(--text-main);

    /* Truncation Logic */
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
}

/* REVEAL FULL TEXT ON HOVER */
td:hover {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    z-index: 100;
    position: relative;
    max-width: none;
    /* Expand width constraint */
    background: inherit;
}

[data-theme="dark"] td {
    border-bottom: 1px solid #003300;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(0, 0, 0, 0.02);
    color: var(--primary-color);
    cursor: pointer;
}

/* Fix Dark Mode Links inside Tables (Grey/Whiteish) */
[data-theme="dark"] table a,
[data-theme="dark"] table a:link,
[data-theme="dark"] table a:visited,
[data-theme="dark"] table a:active {
    color: #aaaaaa !important;
    /* White-ish Grey */
    text-decoration: underline;
}

[data-theme="dark"] table a:hover {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: bold;
}

/* Dark Mode Row Hover: DEEP GREEN BAR */
[data-theme="dark"] tr:hover td {
    background: #003300 !important;
    /* Deep Green */
    color: #ffffff !important;
    /* White Text */
    cursor: pointer;
    box-shadow: 0 0 10px #004d00;
}

/* Ensure links inside hovered row are white for contrast */
[data-theme="dark"] tr:hover td a {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: bold;
}


/* --- PAGE LOADER --- */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
    backdrop-filter: blur(5px);
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* 1. DEFAULT OPENER: QUANTUM RING (Formal Tech) */
.spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;
    border: none;
    box-shadow: none;
    background: transparent;
}

.spinner::before,
.spinner::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.spinner::before {
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-color);
    animation: quantum-spin 1.5s linear infinite;
}

.spinner::after {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border: 3px solid transparent;
    border-bottom-color: var(--text-muted);
    border-left-color: var(--text-muted);
    animation: quantum-spin 1s linear infinite reverse;
}

@keyframes quantum-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- THEME VISIBILITY LOGIC (Hide All -> Show One) --- */
.retro-bar,
.nature-loader,
.sunset-loader,
.prof-loader,
.ocean-loader {
    display: none !important;
}

.default-loader {
    display: block !important;
}

/* 2. DARK MODE: RETRO BAR */
[data-theme="dark"] #page-loader {
    background: #000000 !important;
    backdrop-filter: none;
}

[data-theme="dark"] .default-loader {
    display: none !important;
}

[data-theme="dark"] .retro-bar {
    display: block !important;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00cc00;
    white-space: pre;
}

[data-theme="dark"] .retro-bar::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* 3. NATURE THEME: BOUNCING LEAF */
[data-theme="nature"] #page-loader {
    background: #ecfccb;
}

[data-theme="nature"] .default-loader {
    display: none !important;
}

[data-theme="nature"] .nature-loader {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    color: #4d7c0f;
    font-size: 1.5rem;
    font-weight: bold;
}

[data-theme="nature"] .nature-loader i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite ease-in-out;
    color: #65a30d;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* 4. SUNSET THEME: PULSING SUN */
[data-theme="sunset"] #page-loader {
    background: #fff7ed;
}

[data-theme="sunset"] .default-loader {
    display: none !important;
}

[data-theme="sunset"] .sunset-loader {
    display: flex !important;
    justify-content: center;
}

[data-theme="sunset"] .sunset-loader .sun {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    animation: sun-pulse 2s infinite;
}

@keyframes sun-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* 5. PROFESSIONAL THEME: SLEEK BAR */
[data-theme="professional"] #page-loader {
    background: #f8fafc;
}

[data-theme="professional"] .default-loader {
    display: none !important;
}

[data-theme="professional"] .prof-loader {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: 300px;
}

[data-theme="professional"] .prof-text {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-weight: 600;
}

[data-theme="professional"] .prof-track {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

[data-theme="professional"] .prof-fill {
    height: 100%;
    background: #0f172a;
    width: 0%;
    animation: prof-load 2s ease-in-out infinite;
}

@keyframes prof-load {
    0% {
        width: 0%;
        left: 0;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* 6. OCEAN THEME: BLUE WAVES */
[data-theme="ocean"] #page-loader {
    background: #ecfeff;
}

/* Cyan-50 */
[data-theme="ocean"] .default-loader {
    display: none !important;
}

[data-theme="ocean"] .ocean-loader {
    display: flex !important;
    position: relative;
    width: 100px;
    height: 100px;
    justify-content: center;
    align-items: center;
}

[data-theme="ocean"] .wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #06b6d4;
    /* Cyan-500 */
    opacity: 0;
    animation: wave-ripple 2s linear infinite;
}

[data-theme="ocean"] .wave:nth-child(2) {
    animation-delay: 0.5s;
}

[data-theme="ocean"] .wave:nth-child(3) {
    animation-delay: 1s;
}

@keyframes wave-ripple {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Modern Spinner (Default) */
/* Modern Spinner (Upgraded to Blue Pulse Ripple) */
.spinner {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    position: relative;
    border: none;
    animation: ripple 1.5s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    /* Blue Glow */
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
        /* Start opaque */
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 20px rgba(59, 130, 246, 0);
        /* End transparent */
    }

    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* --- THEME SPECIFIC LOADERS --- */

/* Hide all loaders by default, show specific one */
/* Hide all loaders by default, show specific one */
/* Hide all loaders by default, show specific one */
.retro-bar,
.nature-loader,
.sunset-loader,
.prof-loader,
.ocean-loader {
    display: none !important;
}

.default-loader {
    display: block;
}

/* DARK Override */
[data-theme="dark"] .default-loader {
    display: none !important;
}

[data-theme="dark"] .retro-bar {
    display: block !important;
}

/* NATURE THEME */
[data-theme="nature"] .default-loader {
    display: none !important;
}

[data-theme="nature"] .nature-loader {
    display: flex !important;
}

/* SUNSET THEME */
[data-theme="sunset"] .default-loader {
    display: none !important;
}

[data-theme="sunset"] .sunset-loader {
    display: flex !important;
}

/* PROFESSIONAL THEME */
[data-theme="professional"] .default-loader {
    display: none !important;
}

[data-theme="professional"] .prof-loader {
    display: flex !important;
}

/* OCEAN THEME */
[data-theme="ocean"] .default-loader {
    display: none !important;
}

[data-theme="ocean"] .ocean-loader {
    display: flex !important;
}

[data-theme="nature"] .nature-loader i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite ease-in-out;
    color: #65a30d;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* SUNSET THEME: Pulsing Sun */
[data-theme="sunset"] #page-loader {
    background: #fff7ed;
}

/* Orange-50 */
[data-theme="sunset"] .default-loader {
    display: none;
}

[data-theme="sunset"] .sunset-loader {
    display: flex;
    justify-content: center;
}

[data-theme="sunset"] .sunset-loader .sun {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    animation: sun-pulse 2s infinite;
}

@keyframes sun-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* PROFESSIONAL THEME: Sleek Progress Bar */
[data-theme="professional"] #page-loader {
    background: #f8fafc;
}

/* Slate-50 */
[data-theme="professional"] .default-loader {
    display: none;
}

[data-theme="professional"] .prof-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 300px;
}

[data-theme="professional"] .prof-text {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-weight: 600;
}

[data-theme="professional"] .prof-track {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

[data-theme="professional"] .prof-fill {
    height: 100%;
    background: #0f172a;
    /* Slate-900 */
    width: 0%;
    animation: prof-load 2s ease-in-out infinite;
}

@keyframes prof-load {
    0% {
        width: 0%;
        left: 0;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* OCEAN THEME: Waves */
[data-theme="ocean"] #page-loader {
    background: #ecfeff;
}

/* Cyan-50 */
[data-theme="ocean"] .default-loader {
    display: none !important;
}

[data-theme="ocean"] .ocean-loader {
    display: flex !important;
    position: relative;
    width: 100px;
    height: 100px;
    justify-content: center;
    align-items: center;
}

[data-theme="ocean"] .wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #06b6d4;
    /* Cyan-500 */
    opacity: 0;
    animation: wave-ripple 2s linear infinite;
}

[data-theme="ocean"] .wave:nth-child(2) {
    animation-delay: 0.5s;
}

[data-theme="ocean"] .wave:nth-child(3) {
    animation-delay: 1s;
}

@keyframes wave-ripple {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Dark Mode Retro Fixes (Re-incorporate blink) */
[data-theme="dark"] .retro-bar {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00cc00;
    white-space: pre;
}

[data-theme="dark"] .retro-bar::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}