/* Navigation Bar Styles - Responsive Vertical Sidebar */

/* Hamburger toggle button - only visible on mobile */
.navbar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.navbar-toggle:hover {
    background: rgba(0, 0, 0, 1);
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar-toggle-icon {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Main navbar container */
.navbar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: rgba(0, 0, 0, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.nav-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px;
    height: 100%;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
    height: auto;
    width: 100%;
    display: block;
}

.nav-links {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: block;
    padding: 12px 16px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-primary, rgba(255, 255, 255, 0.95));
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.nav-auth {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-auth {
    padding: 12px 20px;
    background: linear-gradient(135deg, #004BFF 0%, #31EDF3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    width: 100%;
    box-shadow: 0 4px 14px rgba(0, 75, 255, 0.35);
    position: relative;
}

.btn-auth::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(hsla(0, 0%, 100%, 0.5), hsla(0, 0%, 100%, 0.25)) border-box;
    mask: linear-gradient(black, black) border-box, linear-gradient(black, black) padding-box;
    mask-composite: subtract;
    -webkit-mask-composite: destination-out;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 75, 255, 0.5);
}

/* Admin Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    font-size: 0.8em;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: relative;
    left: 0;
    top: 0;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    max-height: 400px;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.95em;
}

.dropdown-menu a:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: white !important;
    transform: translateX(3px);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
    list-style: none;
}

/* Add left margin to body content to account for sidebar */
body {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Show hamburger button on mobile */
    .navbar-toggle {
        display: block;
    }
    
    /* Hide navbar off-screen by default on mobile */
    .navbar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    /* Show navbar when active class is added */
    .navbar.active {
        transform: translateX(0);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    /* Remove body margin on mobile */
    body {
        margin-left: 0;
    }
    
    /* Adjust navbar width for smaller screens */
    .navbar {
        width: 280px;
        max-width: 80vw;
    }
    
    /* Mobile dropdown styles - already positioned correctly */
    .dropdown-menu {
        margin-left: 16px;
        margin-top: 8px;
        max-height: 0;
    }
    
    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown.open .dropdown-menu {
        max-height: 400px;
    }
}

/* Extra small devices (iPhone SE, etc) */
@media (max-width: 480px) {
    .navbar {
        width: 260px;
        max-width: 85vw;
    }
    
    .nav-title {
        font-size: 1rem;
    }
    
    .nav-logo {
        height: auto;
        width: 100%;
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 10px 14px;
    }
    
    .btn-auth {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .navbar {
        width: 220px;
    }
    
    body {
        margin-left: 220px;
    }
    
    .nav-title {
        font-size: 1rem;
    }
    
    .nav-logo {
        height: auto;
        width: 100%;
    }
}
