/* Navbar container styling */
.navbar {
    position: fixed; /* Makes the navbar fixed at the top of the viewport */
    top: 0;
    left: 0;
    width: 100%; /* Spans the full width */
    background: linear-gradient(135deg, #dc3545, #c82333); /* Red gradient background */
    color: white; /* White text color */
    z-index: 1000; /* Ensures it appears above other elements */
    display: flex; /* Align items */
    justify-content: space-between; /* Space between logo and links */
    align-items: center; /* Vertically center items */
    padding: 15px 25px; /* Add some padding */
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3); /* Red shadow for better visuals */
    backdrop-filter: blur(10px);
}

/* Logo styling */
.nav-logo img, .logo {
    max-height: 50px; /* Adjust logo height */
    height: 50px;
    width: auto;
    display: block;
    filter: brightness(1.1); /* Slightly brighten logo for visibility */
    transition: transform 0.3s ease;
}

.nav-logo img:hover, .logo:hover {
    transform: scale(1.05);
}

/* Navigation links */
.nav-links {
    display: flex;
    gap: 20px; /* Space between links */
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    color: white; /* White link color */
    text-decoration: none; /* Remove underline */
    font-size: 16px; /* Adjust font size */
    font-weight: 600;
    padding: 8px 12px; /* Add padding for clickable area */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease; /* Smooth hover effect */
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Light background on hover */
    color: #f8f9fa; /* Brighter white on hover */
    border-radius: 5px; /* Slightly rounded edges */
    transform: translateY(-1px);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

/* Index / landing: red bar + Wikipedia-style sidebar menu */
.navbar.navbar-index {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 10px 16px;
    gap: 12px;
    overflow: visible;
}

.navbar-index .nav-brand {
    flex: 0 0 auto;
}

.navbar-index .nav-brand .logo {
    height: 44px;
    width: auto;
    max-width: 50px;
    object-fit: contain;
    display: block;
}

.navbar-index .nav-auth-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.navbar-index .nav-auth-bar .btn-nav {
    font-size: 13px;
    padding: 8px 14px;
    white-space: nowrap;
}

.nav-toggle {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    flex-shrink: 0;
    padding: 8px 14px 8px 12px;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.nav-toggle:hover {
    background: #f3f4f6;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

.nav-toggle:active {
    transform: scale(0.98);
}

.nav-toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 18px;
    flex-shrink: 0;
}

.nav-toggle-label {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    color: #1a1a1a;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #1a1a1a;
    border-radius: 1px;
}

/* Sidebar panel (Wikipedia-style) */
.nav-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
}

.nav-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 88vw);
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    background: #fff;
    z-index: 1050;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.25s ease, visibility 0.25s ease;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-sidebar:not([hidden]) {
    visibility: visible;
    pointer-events: auto;
}

.nav-sidebar.is-open {
    transform: translateX(0);
}

.nav-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eaecf0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.nav-sidebar-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #202122;
    line-height: 1.3;
}

.nav-sidebar-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #c8ccd1;
    border-radius: 4px;
    background: #fff;
    color: #202122;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.nav-sidebar-close:hover {
    background: #eaecf0;
}

.nav-sidebar-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-sidebar-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-sidebar-links li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eaecf0;
}

.nav-sidebar-links a {
    display: block;
    padding: 14px 16px;
    color: #3366cc;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    text-shadow: none;
    transition: background 0.15s ease;
}

.nav-sidebar-links a:hover {
    background: #f8f9fa;
    color: #447ff5;
    transform: none;
}

body.nav-sidebar-open {
    overflow: hidden;
}

/* Legacy – unused on index */
.navbar-index-menu,
.navbar-index-inner,
.navbar-index-top {
    display: none;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-nav {
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-nav-outline {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-nav-outline:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #fff;
    color: #fff;
}

.btn-nav-primary {
    color: #c82333;
    background: #fff;
    border: 2px solid #fff;
}

.btn-nav-primary:hover {
    background: #f8f9fa;
    border-color: #f8f9fa;
    color: #a71d2a;
}

/* Add spacing to prevent content overlap */
body {
    margin-top: 80px; /* Add space equal to navbar height */
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        margin-top: 100px; /* Extra space for mobile wrapping */
    }

    .navbar {
        flex-wrap: wrap;
        padding: 12px 20px;
    }

    .navbar.navbar-index {
        padding: 8px 12px;
        gap: 10px;
    }

    .navbar-index .nav-auth-bar .btn-nav {
        font-size: 12px;
        padding: 7px 10px;
    }

    .nav-toggle {
        min-height: 40px;
        padding: 7px 11px 7px 10px;
        gap: 6px;
    }

    .nav-toggle-label {
        font-size: 0.8125rem;
    }

    .nav-toggle-icon {
        width: 16px;
        gap: 3px;
    }

    .btn-nav {
        padding: 8px 14px;
        font-size: 14px;
    }

    .nav-logo img, .logo {
        max-height: 40px;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        margin-top: 0.5rem;
        width: 100%;
    }

    .nav-links a {
        font-size: 14px;
        padding: 6px 10px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 5px;
        backdrop-filter: blur(5px);
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.25);
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 10px 15px;
    }

    .nav-logo img {
        max-height: 35px;
    }

    .nav-links {
        gap: 12px;
        margin-top: 0.5rem;
    }

    .nav-links a {
        font-size: 13px;
        padding: 5px 8px;
    }
}