﻿/* 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;
    position: relative;
    z-index: 1000;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

/* Container for logo header + nav list inside sidebar */

.nav-container {
    height: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1000;
}

/* Sidebar navigation */

.nav-scrollable {
    background-color: var(--color-charcoal-black);
    height: calc(100vh - 60px);
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
    display: block;
    position: relative;
    z-index: 1000;
}

.nav-sections {
    padding-top: 4px;
    padding-bottom: 4px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.nav-section {
    margin-left: 0;
    padding-left: 0;
    margin-bottom: 6px;
    position: relative;
}

.nav-section:not(:last-child)::after {
    content: "";
    display: block;
    height: 1px;
    margin: 6px 16px 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.nav-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 700;
    padding: 10px 16px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(160, 164, 167, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-section-toggle:hover {
    color: var(--color-solar-yellow);
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-section-toggle[aria-expanded="true"] {
    color: var(--color-solar-yellow);
    background: rgba(241, 196, 15, 0.08);
    border-color: rgba(241, 196, 15, 0.25);
    box-shadow: inset 0 0 0 1px rgba(241, 196, 15, 0.18);
}

.nav-section-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.15);
}

.nav-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 14px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.section-chevron {
    transition: transform 0.2s ease;
}

.section-chevron.is-open {
    transform: rotate(180deg);
}

.nav-section-content.section-closed {
    display: none;
}

.nav-section-content.section-open {
    display: block;
}

.nav-section-content {
    margin: 8px 12px 12px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(18, 18, 18, 0.8);
    border: 1px solid rgba(113, 124, 126, 0.25);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.nav-section-content .nav-item + .nav-item {
    margin-top: 4px;
}

.nav-section-content .nav-link {
    padding: 9px 12px;
    border-radius: 7px;
}

.nav-item {
    margin: 0;
    padding: 0;
}

    .nav-item.px-3 {
        padding-left: 16px;
        padding-right: 16px;
    }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--color-platinum-grey) !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-solar-yellow) !important;
}

.nav-link.active {
    background-color: rgba(255, 199, 44, 0.16);
    color: var(--color-solar-yellow) !important;
    border-left: 3px solid var(--color-solar-yellow);
    padding-left: 11px;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.3);
}

.nav-link:focus-visible {
    outline: 2px solid var(--color-solar-yellow);
    outline-offset: 2px;
}

/* 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 .bi {
    font-size: 16px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.section-icon {
    font-size: 15px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 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;
    position: relative;
    min-height: 100vh;
    z-index: 1000;
}

/* 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%;
        min-height: auto;
    }

    .nav-container {
        min-height: auto;
    }

    .top-row {
        height: 56px;
        justify-content: space-between;
    }

    /* Drawer: slide-down under header */
    .nav-scrollable {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        background-color: var(--color-charcoal-black);
        z-index: 1000;
        overflow-y: auto;
    }

        .nav-scrollable.nav-closed {
            display: none !important;
        }

        .nav-scrollable.nav-open {
            display: block !important;
        }
}

.nav-sections {
    padding-top: 4px;
    padding-bottom: 4px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.nav-item-root {
    margin: 0 8px;
}

.nav-link-root {
    font-weight: 600;
    font-size: 13px;
    padding: 12px 14px;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 3px solid transparent;
}

.nav-link-root:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--color-solar-yellow);
}

.nav-link-root.active {
    background-color: rgba(255, 199, 44, 0.16);
    border-left-color: var(--color-solar-yellow);
}

.nav-divider {
    height: 1px;
    margin: 8px 16px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border: none;
}

.account-section {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 199, 44, 0.25);
    position: relative;
}

.account-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-solar-yellow), transparent);
    opacity: 0.5;
}

.account-toggle {
    background: rgba(241, 196, 15, 0.08) !important;
    border: 1px solid rgba(241, 196, 15, 0.2) !important;
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.1);
}

.account-toggle:hover {
    background: rgba(241, 196, 15, 0.12) !important;
    border-color: rgba(241, 196, 15, 0.3) !important;
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.15);
}

.account-toggle[aria-expanded="true"] {
    background: rgba(241, 196, 15, 0.15) !important;
    border-color: rgba(241, 196, 15, 0.35) !important;
    box-shadow: 0 4px 16px rgba(241, 196, 15, 0.2), inset 0 0 0 1px rgba(241, 196, 15, 0.2);
}

.account-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin: 10px 10px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.14), rgba(243, 156, 18, 0.1));
    border: 1px solid rgba(241, 196, 15, 0.3);
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 20px rgba(241, 196, 15, 0.05);
    overflow: hidden;
    max-width: 100%;
    width: calc(100% - 20px);
    transition: all 0.3s ease;
    position: relative;
}

.account-summary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-solar-yellow), transparent);
    opacity: 0.6;
}

.account-summary::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(241, 196, 15, 0.4), transparent);
}

.account-summary:hover {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.18), rgba(243, 156, 18, 0.14));
    border-color: rgba(241, 196, 15, 0.4);
    box-shadow: 0 6px 16px rgba(241, 196, 15, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 30px rgba(241, 196, 15, 0.08);
    transform: translateY(-1px);
}

.account-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
    min-width: 44px;
}

.account-avatar {
    font-size: 40px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-solar-yellow);
    filter: drop-shadow(0 3px 8px rgba(241, 196, 15, 0.5));
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.account-summary:hover .account-avatar {
    transform: scale(1.08) rotate(-5deg);
    filter: drop-shadow(0 4px 12px rgba(241, 196, 15, 0.6));
}

.account-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: 2px solid var(--color-charcoal-black);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

.account-summary-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 4px;
    overflow: hidden;
    width: 0;
}

.account-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
    width: 100%;
    display: block;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.account-caption {
    font-size: 10px;
    color: var(--color-solar-yellow);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.account-menu-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Enhanced account navigation links */
.account-nav-link {
    padding: 11px 14px !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.account-nav-link:hover {
    background: rgba(255, 199, 44, 0.1) !important;
    color: #ffffff !important;
    transform: translateX(3px);
    padding-left: 17px !important;
}

.account-nav-link.active {
    background: rgba(255, 199, 44, 0.18) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.4);
    border-left: 3px solid var(--color-solar-yellow);
    padding-left: 11px !important;
}

.account-nav-link.active .bi {
    color: var(--color-solar-yellow);
    filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.6));
}

.account-nav-link .bi {
    font-size: 16px;
    transition: all 0.2s ease;
}

.account-nav-link:hover .bi {
    color: var(--color-solar-yellow);
    transform: scale(1.1);
}

/* Sign Out Button Enhancement */
.account-signout-item {
    margin-top: 12px !important;
    padding-top: 12px;
    border-top: 1px solid rgba(113, 124, 126, 0.25);
    position: relative;
}

.account-signout-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.account-signout-button {
    background: none !important;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px !important;
    padding: 11px 14px !important;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-platinum-grey) !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.account-signout-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(231, 76, 60, 0.1), transparent);
    transition: left 0.4s ease;
}

.account-signout-button:hover::before {
    left: 100%;
}

.account-signout-button:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(192, 57, 43, 0.12)) !important;
    color: #ff6b6b !important;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2), inset 0 0 0 1px rgba(231, 76, 60, 0.3);
    padding-left: 17px !important;
}

.account-signout-button .bi {
    color: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
}

.account-signout-button:hover .bi {
    color: #ff6b6b;
    transform: translateX(2px);
    filter: drop-shadow(0 0 4px rgba(255, 107, 107, 0.5));
}

.account-signout-button:focus-visible {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
}

/* Sign In Link for Not Authorized */
.account-signin-container {
    padding: 8px;
}

.account-signin-link {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.12), rgba(39, 174, 96, 0.08)) !important;
    border: 1px solid rgba(46, 204, 113, 0.3);
    padding: 12px 14px !important;
    font-weight: 600;
    color: #2ecc71 !important;
    text-align: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.15);
    transition: all 0.3s ease;
}

.account-signin-link:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.18), rgba(39, 174, 96, 0.14)) !important;
    border-color: rgba(46, 204, 113, 0.4);
    color: #27ae60 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.25);
}

.account-signin-link .bi {
    font-size: 18px;
    color: inherit;
}

/* Ensure account section content doesn't overflow */
.account-section .nav-section-content {
    overflow: hidden;
    padding-bottom: 16px;
}

.account-section .nav-link {
    overflow: hidden;
}

.account-section .nav-link span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}