﻿/* Navigation bar logo */

.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
}

    .navbar-brand img {
        max-height: 40px;
        width: auto;
        object-fit: contain;
        filter: brightness(1.1);
    }

/* Adjust logo for dark theme */

@media (prefers-color-scheme: dark) {
    .navbar-brand img {
        filter: brightness(1.2);
    }
}

[data-color-scheme="dark"] .navbar-brand img {
    filter: brightness(1.2);
}

/* Make logo stand out with hover effect */

.navbar-brand:hover img {
    filter: brightness(1.3);
    transition: filter var(--duration-fast) var(--ease-standard);
}

/* Top navigation bar used in sidebar header (logo + burger) */

.top-row {
    background-color: var(--color-charcoal-black) !important;
    border-bottom: 2px solid var(--color-slate-grey);
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

/* Container for logo header + nav list inside sidebar */

.nav-container {
    height: 100%;
}

/* Sidebar navigation */

.nav-scrollable {
    background-color: var(--color-charcoal-black);
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 1rem 0;
    display: block; /* NEW: visible by default on desktop */
}

.nav-sections {
    padding-top: 8px;
    padding-bottom: 8px;
}

.nav-section {
    margin-bottom: 10px;
}

.nav-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    padding: 4px 16px 2px 16px;
    margin: 0;
    border-bottom: 1px solid rgba(160, 164, 167, 0.25);
}

.nav-item {
    margin: 0;
}

    .nav-item.px-3 {
        padding-left: 16px;
        padding-right: 16px;
    }

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin: 0;
    font-size: 12px;
    color: var(--color-platinum-grey) !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

    /* Hover and active states */

    .nav-link:hover {
        background-color: var(--color-gunmetal-grey);
        color: var(--color-solar-yellow) !important;
    }

    .nav-link.active {
        background-color: var(--color-gunmetal-grey);
        color: var(--color-solar-yellow) !important;
        border-left: 3px solid var(--color-solar-yellow);
        padding-left: 13px; /* 16px total including border */
    }

/* Logout button styled like a link */

.nav-link-button {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

    .nav-link-button:focus {
        outline: none;
    }

/* Navigation icons */

.nav-link span[class*="bi-"] {
    font-size: 18px;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Username row uses normal nav-link layout + ellipsis */

.nav-link.user-link {
    overflow: hidden;
}

    .nav-link.user-link .user-name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* Layout around sidebar */

.main {
    background-color: var(--color-deep-black) !important;
    color: var(--color-platinum-grey);
}

.page {
    display: flex;
    min-height: 100vh;
}

/* Ensure site background matches main area */

body {
    background-color: var(--color-deep-black) !important;
}

/* Fix any Bootstrap default styling */

.navbar-dark {
    background-color: var(--color-charcoal-black) !important;
}

/* Sidebar width (desktop) */

.sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* Main content padding */

.main > div,
.content {
    padding: 24px;
}

/* Scrollbar for sidebar */

.nav-scrollable::-webkit-scrollbar {
    width: 6px;
}

.nav-scrollable::-webkit-scrollbar-track {
    background: var(--color-charcoal-black);
}

.nav-scrollable::-webkit-scrollbar-thumb {
    background: var(--color-slate-grey);
    border-radius: 3px;
}

    .nav-scrollable::-webkit-scrollbar-thumb:hover {
        background: var(--color-ash-grey);
    }

/* --------- Responsive behaviour ---------- */

/* Tablet: slightly narrower sidebar */

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
}

/* Mobile: burger + slide-down drawer */

@media (max-width: 768px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .top-row {
        height: 56px;
        justify-content: space-between;
    }

    /* Drawer: slide-down under header */
    .nav-scrollable {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        background-color: var(--color-charcoal-black);
        z-index: 1000;
        overflow-y: auto;
    }

        .nav-scrollable.nav-closed {
            display: none !important; /* NEW: force hidden */
        }

        .nav-scrollable.nav-open {
            display: block !important; /* NEW: force visible */
        }
}