:root {
    --primary: #f0aa2b;
    --primary-gold: #f0aa2b;
    --primary-glow: rgba(240, 170, 43, 0.4);
    --bg-dark: #050505;
    --bg-gradient: radial-gradient(circle at top, #111 0%, #000 100%);
    --card-bg: rgba(20, 20, 20, 0.6);
    
    /* Premium Glassmorphic Tokens */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: rgba(240, 170, 43, 0.1);
    
    --sidebar-width: 280px;
    --header-height: 70px;
    --banner-offset: 0px; 
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Modern Typography Stack */
    --font-main: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-dark);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--banner-offset);
}

/* --- Standard Sidebar --- */
.sidebar {
    position: fixed;
    left: 0;
    top: calc(var(--header-height) + var(--banner-offset));
    bottom: 0;
    width: var(--sidebar-width);
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 25px 0;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.logo {
    padding: 10px 30px;
    margin-bottom: 25px;
}

.logo-img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(240, 170, 43, 0.3));
}

.nav-item {
    padding: 14px 20px;
    margin: 5px 15px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.nav-item.active {
    color: var(--primary-gold) !important;
    background: rgba(240, 170, 43, 0.08);
    border: 1px solid rgba(240, 170, 43, 0.2);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 18px;
    transition: var(--transition);
}

.nav-item:hover i {
    color: var(--primary-gold);
    transform: scale(1.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: var(--primary-gold);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary-gold);
}

.nav-item.active .nav-icon {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(240, 170, 43, 0.3);
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sign-out {
    margin-top: auto;
    color: #ff4444 !important;
}

.sign-out:hover {
    background: rgba(255, 68, 68, 0.1) !important;
}

/* --- Standard Header (Full Width) --- */
.header-section {
    position: fixed;
    top: var(--banner-offset);
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 990;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-content-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo-mobile {
    display: none;
    height: 40px;
    filter: drop-shadow(0 0 8px rgba(240, 170, 43, 0.3));
}

.page-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to bottom, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.header-content-right {
    display: flex;
    align-items: center;
    gap: 25px;
}



/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: calc(var(--header-height) + 30px) 30px 40px;
    transition: var(--transition);
    min-height: 100vh;
}

.sidebar.collapsed~.main-content {
    margin-left: 0;
}

/* --- Common Components --- */
.back-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(240, 170, 43, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Dashboard Watermark --- */
.dashboard-watermark {
    position: fixed;
    top: 50%;
    left: calc(50% + 140px);
    transform: translate(-50%, -50%);
    width: 650px;
    height: auto;
    opacity: 0.8;
    /* Increased from 0.6 */
    pointer-events: none;
    z-index: 0;
    transition: var(--transition);
    filter: blur(0.5px) drop-shadow(0 0 40px rgba(240, 170, 43, 0.05));
    animation: watermarkPulse 8s ease-in-out infinite;
}

@keyframes watermarkPulse {

    0%,
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

.leaderboard-card-watermark {
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 150px;
    height: auto;
    opacity: 0.4;
    /* Increased from 0.25 */
    pointer-events: none;
    transform: rotate(-10deg);
    z-index: 0;
    transition: var(--transition);
}

.program-watermark {
    position: absolute;
    width: 140px;
    height: 140px;
    background-size: contain;
    opacity: 0.8;
    /* Increased from 0.6 */
    right: -20px;
    bottom: -20px;
    transform: rotate(-15deg);
    pointer-events: none;
    transition: all 0.4s ease;
}

.program-card:hover .program-watermark {
    opacity: 0.9;
    transform: rotate(-5deg) scale(1.1);
    right: -10px;
}

.sidebar.collapsed~.dashboard-watermark {
    left: 50%;
}

/* --- Search & Notifications --- */
.search-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 260px;
    height: 46px;
    transition: var(--transition);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.search-container:focus-within {
    border-color: rgba(240, 170, 43, 0.4);
    background: rgba(255, 255, 255, 0.05);
    width: 280px;
}

.search-icon {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.search-input {
    background: none; border: none; color: #fff; width: 100%; outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.notif-wrapper {
    position: relative;
    display: inline-block;
}

.notification-btn {
    width: 50px; height: 50px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.3) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.7); cursor: pointer; position: relative;
    transition: all 0.3s ease;
}
.notification-btn:hover {
    border-color: rgba(240, 170, 43, 0.6); color: #f0aa2b;
}
.notif-dot {
    position: absolute; top: 8px; right: 8px; width: 10px; height: 10px;
    background: #ff4444; border-radius: 50%; box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
    animation: notif-pulse 2s infinite ease-in-out;
}
@keyframes notif-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Notification Dropdown UI */
.notif-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 320px;
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(240, 170, 43, 0.3);
    border-top: 1px solid rgba(240, 170, 43, 0.6);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}

.notif-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header .clear-all {
    font-size: 12px;
    color: #f0aa2b;
    cursor: pointer;
    font-weight: 500;
}

.notif-list {
    list-style: none;
    max-height: 350px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

/* Scrollbar styling for notification list */
.notif-list::-webkit-scrollbar {
    width: 6px;
}
.notif-list::-webkit-scrollbar-thumb {
    background: rgba(240, 170, 43, 0.3);
    border-radius: 10px;
}
.notif-list::-webkit-scrollbar-thumb:hover {
    background: rgba(240, 170, 43, 0.6);
}

.notif-item {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-icon.system {
    background: rgba(240, 170, 43, 0.1);
    color: #f0aa2b;
    border: 1px solid rgba(240, 170, 43, 0.2);
}

.notif-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.notif-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.notif-message {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    line-height: 1.4;
}

/* --- Menu Button --- */
.menu-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-btn span {
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: var(--transition);
}

/* --- Responsive Layout --- */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 250px;
    }

    .sidebar {
        transform: translateX(-100%);
        top: var(--banner-offset);
        height: calc(100vh - var(--banner-offset));
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: calc(var(--header-height) + 20px) 20px 20px;
    }

    .dashboard-watermark {
        left: 50%;
    }
}

@media (max-width: 480px) {
    .header-section {
        padding: 0 12px;
        gap: 10px;
    }

    .header-content-left {
        gap: 10px;
    }

    .header-content-right {
        gap: 10px;
        flex: 1;
        justify-content: flex-end;
    }

    .search-container {
        flex: 1;
        max-width: 180px;
        height: 38px;
        padding: 0 10px;
        gap: 6px;
    }

    .search-input {
        font-size: 13px;
    }

    .notification-btn,
    .menu-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .page-title {
        font-size: 18px;
    }

    .main-content {
        padding: calc(var(--header-height) + 15px) 15px 30px;
    }

    .dashboard-watermark {
        left: 50%;
        width: 320px;
        opacity: 0.4;
    }
}

@media (max-width: 414px) {
    .header-section {
        padding: 0 8px;
        gap: 6px;
    }
    
    .header-content-left, .header-content-right {
        gap: 6px;
    }

    .search-container {
        max-width: 150px;
    }

    .page-title {
        font-size: 16px;
    }

    /* Retain 40x40 minimum touch size for standard elements */
    .notification-btn,
    .menu-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .logo-img {
        height: 30px; /* if it exists in mobile views */
    }

    .main-content {
        padding: calc(var(--header-height) + 15px) 8px 30px;
    }
}

/* --- Contextual Tooltips --- */
.info-hotspot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    cursor: pointer;
    vertical-align: middle;
    transition: color 0.3s ease;
    z-index: 100;
}

.info-hotspot:hover, .info-hotspot.active {
    color: var(--primary);
}

.info-tooltip {
    position: absolute;
    width: 260px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.3s, margin-top 0.3s;
    z-index: 9999;
    transform: translate(-50%, -100%);
    margin-top: 10px;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.1) transparent transparent transparent;
}

/* JS toggled state */
.info-tooltip.show {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}

/* ====== GLOBAL TRONEX MODAL ====== */
.tronex-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.tronex-modal-overlay.active {
    opacity: 1;
}
.tronex-modal-content {
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.9), rgba(15, 15, 20, 0.95));
    border: 1px solid rgba(240, 170, 43, 0.3);
    border-radius: 32px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(240, 170, 43, 0.05);
}
.tronex-modal-overlay.active .tronex-modal-content {
    transform: translateY(0);
}
.tronex-modal-icon {
    font-size: 60px;
    color: #f0aa2b;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 15px rgba(240, 170, 43, 0.4));
}
.tronex-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff, #f0aa2b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tronex-modal-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}
.tronex-modal-btn {
    background: linear-gradient(135deg, #f0aa2b, #d8941a);
    color: #000;
    border: none;
    padding: 15px 40px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(240, 170, 43, 0.2);
    font-family: 'Outfit', sans-serif;
}
.tronex-modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(240, 170, 43, 0.3);
    filter: brightness(1.1);
}
.tronex-modal-close {
    position: absolute;
    top: 20px; right: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
}
.tronex-modal-close:hover {
    color: #f0aa2b;
}