:root {
    --bg-dark: #05070a;
    --primary: #00f2ff;
    --secondary: #bd00ff;
    --accent: #4e00b3;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-bg: rgba(20, 25, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #eab308;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

/* Backgrounds */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -2;
    pointer-events: none;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.3;
    animation: floatOrb 15s infinite ease-in-out alternate;
    pointer-events: none;
}

.orb-1 {
    top: -15%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--secondary);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: var(--primary);
    animation-delay: -7s;
}

@keyframes floatOrb {
    to {
        transform: translate(40px, 60px);
    }
}

/* Glass Components */
.glass-card {
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.6), rgba(15, 20, 30, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy hover */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-nav {
    background-color: #050810;
    background-image: linear-gradient(135deg, rgba(10, 15, 30, 0.9), rgba(5, 8, 15, 0.95));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid rgba(0, 242, 255, 0.15);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
}

/* Sidebar Active Tab */
.tab-active {
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--primary);
    color: #fff !important;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
    box-shadow: inset 10px 0 20px -10px rgba(0, 242, 255, 0.3);
}

/* Typography & Effects */
.gradient-text {
    background: linear-gradient(to right, #fff, var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shineText 4s linear infinite;
}

@keyframes shineText {
    to {
        background-position: 200% center;
    }
}

/* Page Transitions */
.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(15px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #000;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Global Form & Table Enhancements */
input,
select,
textarea {
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.25);
    border-color: var(--primary) !important;
    outline: none;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 242, 255, 0.05) 50%, rgba(255, 255, 255, 0.05) 100%);
    transform: scale(1.005);
}

.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.6);
}

.btn-glow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Stats */
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), #fff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--primary), 0 0 40px var(--primary);
    }

    50% {
        box-shadow: 0 0 40px var(--primary), 0 0 80px var(--primary);
    }
}

/* Utility */
.hidden {
    display: none;
}

/* Glass Interactions */
.glass-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(145deg, #1a1f2e, #0d0f15);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    text-align: center;
}

/* Common Components */
.stat-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notice-card {
    background: linear-gradient(135deg, rgba(189, 0, 255, 0.15), rgba(0, 242, 255, 0.1));
    border: 1px dashed var(--secondary);
    border-radius: 12px;
    padding: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .glass-nav {
        /* Hide sidebar off-screen by default */
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
        /* Max z-index to be above everything */

        /* MOBILE REWRITE: Robust Background */
        background: #0d1220 !important;
        /* Fallback solid color */
        background: linear-gradient(180deg, #0f172a 0%, #0a0f1a 90%, #000000 100%) !important;

        /* Ensure specific dimensions and positioning */
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        /* Full viewport height */
        width: 80%;
        /* Wider on mobile for better touch targets */
        max-width: 320px;

        /* Reset any glass effects that might cause issues on low-end devices */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;

        /* Visual separation */
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.95);
        border-right: 1px solid rgba(0, 242, 255, 0.1);
    }

    /* Add a pseudo-element for the glass effect if supported, but separate layering */
    @supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
        .glass-nav {
            background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 26, 0.99) 100%) !important;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }
    }

    /* Show sidebar when active */
    .glass-nav.active {
        transform: translateX(0);
    }

    /* Main content should use full width on mobile */
    main {
        margin-left: 0 !important;
        padding: 1rem !important;
        overflow-x: hidden !important;
        max-width: 100vw !important;
        box-sizing: border-box;
    }

    /* Prevent any horizontal overflow on mobile */
    body {
        overflow-x: hidden;
    }

    /* Dark overlay when sidebar is open */
    .mobile-nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-nav-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    /* Responsive button sizing */
    .btn-glow {
        padding: 10px 20px;
        font-size: 0.875rem;
    }

    /* ====== COMPACT MOBILE UI ENHANCEMENTS ====== */

    /* Tighter glass cards on mobile */
    .glass-card {
        border-radius: 12px;
    }

    /* Smaller stat values on mobile */
    .stat-value {
        font-size: 1.125rem;
    }

    /* Compact header title */
    h1.gradient-text {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    /* Subtitle text */
    main p.text-slate-400 {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    /* Reduce margins on mobile */
    .mb-8 {
        margin-bottom: 0.75rem;
    }

    .mb-6 {
        margin-bottom: 0.5rem;
    }

    /* Ensure long titles can wrap */
    h1,
    h2,
    h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* ====== BOTTOM NAVIGATION BAR (Mobile Only) ====== */
    .bottom-nav {
        display: none !important;
    }

    /* Add bottom padding to main content to prevent overlap */
    main {
        padding-bottom: 2rem !important;
        /* Standard padding */
    }
}

/* ====== BOTTOM NAVIGATION BAR ====== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: none !important;
    /* Hidden Globally */

    /* Glassmorphism styling */
    background: linear-gradient(180deg, rgba(10, 15, 30, 0.95) 0%, rgba(5, 7, 10, 0.98) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);

    /* Border and shadow */
    border-top: 1px solid rgba(0, 242, 255, 0.2);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);

    /* Safe area for modern mobile devices (iPhone notch, etc.) */
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    padding: 0.5rem 0.25rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    max-width: 80px;
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.bottom-nav-item span {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.3s ease;
    text-align: center;
}

/* Active state */
.bottom-nav-item.active {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.15), rgba(189, 0, 255, 0.15));
    border: 1px solid rgba(0, 242, 255, 0.3);
}

.bottom-nav-item.active i {
    color: var(--primary);
    transform: scale(1.1);
}

.bottom-nav-item.active span {
    color: var(--primary);
    font-weight: 600;
}

/* Hover state (for tablets with pointer) */
@media (hover: hover) {
    .bottom-nav-item:hover:not(.active) {
        background: rgba(255, 255, 255, 0.05);
        transform: translateY(-2px);
    }

    .bottom-nav-item:hover:not(.active) i {
        color: rgba(0, 242, 255, 0.7);
    }
}

/* Tap feedback animation */
.bottom-nav-item:active {
    transform: scale(0.95);
}