@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Primary Color: Electric Blue */
    --primary: 220 90% 56%;
    /* Secondary Color: Vibrant Cyan */
    --secondary: 190 90% 50%;
    /* Surface Colors */
    --surface-light: 0 0% 100%;
    --surface-dim: 210 20% 98%;
    /* Text Colors */
    --text-main: 220 20% 20%;
    --text-muted: 220 10% 60%;
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(220, 90%, 56%), hsl(260, 90%, 60%));
    --gradient-surface: linear-gradient(to bottom right, #ffffff, #f8f9fa);

    --sidebar-width: 260px;
}

html,
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: hsl(var(--text-main));
    background-color: #f3f4f6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: hsl(var(--text-main));
    letter-spacing: -0.02em;
}

a,
.btn-link {
    color: hsl(var(--primary));
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: hsl(220, 90%, 46%);
}

.btn-primary {
    color: #fff;
    background-image: var(--gradient-primary);
    border: none;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background-image: linear-gradient(135deg, hsl(220, 90%, 50%), hsl(260, 90%, 55%));
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border-radius: 16px;
}

/* --- Layout Styles --- */

:root {
    --sidebar-width: 320px;
    --navbar-height: 64px;
}

.custom-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1060;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Higher than Sidebar to stay on top - REVERSED: Sidebar is now higher (1070) */
    height: var(--navbar-height);
    background: #ffffff;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #e2e8f0;
    padding: 0 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.custom-navbar .toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000000 !important;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: background 0.2s;
    margin-right: 1rem;
}

.custom-navbar .toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    z-index: 1070;
    left: 0;
    background-color: #1e293b;
    /* Dark Slate */
    color: #cbd5e1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);

    /* Scrollbar Polish */
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

#sidebar .nav-link {
    color: #94a3b8;
    transition: all 0.2s;
}

#sidebar .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

#sidebar .nav-link.active-nav-link {
    background: #3b82f6;
    color: #ffffff !important;
}

.content-area {
    padding-top: var(--navbar-height);
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

/* Desktop Behavior (>992px) */
@media (min-width: 992px) {
    #sidebar {
        transform: translateX(0);
        box-shadow: 1px 0 10px rgba(0, 0, 0, 0.1);
    }

    .custom-navbar.sidebar-expanded {
        left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }

    .custom-navbar.sidebar-collapsed {
        left: 0;
        width: 100%;
    }

    /* Collapsed State */
    #sidebar:not(.active) {
        transform: translateX(-100%);
    }

    .sidebar-expanded {
        padding-left: var(--sidebar-width);
    }

    .sidebar-collapsed {
        padding-left: 0;
    }
}

/* Mobile Behavior (<992px) */
@media (max-width: 991.98px) {
    #sidebar {
        width: 75%;
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    #sidebar.active {
        transform: translateX(0);
    }

    .content-area {
        padding-left: 0 !important;
    }

    .custom-navbar.sidebar-expanded,
    .custom-navbar.sidebar-collapsed {
        left: 0 !important;
        width: 100% !important;
    }

    .overlay.active {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1065;
        /* Below sidebar (1070) but above navbar (1060) */
        backdrop-filter: blur(2px);
    }
}

.text-gradient {
    color: #000000 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}