/* ===================================
   FUTURISTIC SIDEBAR NAVIGATION
   =================================== */

:root {
    --sidebar-bg: rgba(15, 15, 35, 0.98);
    --sidebar-glass: rgba(255, 255, 255, 0.05);
    --neon-primary: #00d9ff;
    --neon-secondary: #ff00ff;
    --neon-glow: rgba(0, 217, 255, 0.5);
}

/* Hamburger Menu Button */
.hamburger-menu {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
    z-index: 1100;
    background: var(--sidebar-glass);
    border: 2px solid var(--neon-primary);
    border-radius: 12px;
    width: 55px;
    height: 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 20px var(--neon-glow);
}

.hamburger-menu span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--neon-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--neon-glow);
}

.hamburger-menu:hover {
    transform: scale(1.1);
    border-color: #fff;
    box-shadow: 0 0 30px var(--neon-glow);
}

.hamburger-menu:hover span {
    background: #fff;
    box-shadow: 0 0 15px #fff;
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--sidebar-bg);
    backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--neon-primary);
    padding: 0.75rem 0;
    box-shadow: 0 2px 20px var(--neon-glow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem 0 1.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
    overflow: visible;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
}

.header-nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    order: 2;
}

.header-nav-links a {
    color: var(--muted, #94a3b8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
    padding: 0.4rem 0.6rem;
}

.header-nav-links a:hover {
    color: var(--neon-primary, #00d4ff);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
    order: 4;
}

.header-icon {
    position: relative;
    font-size: 1.5rem;
    transition: all 0.3s;
    text-decoration: none;
    filter: drop-shadow(0 0 5px var(--neon-primary));
}

.header-icon:hover {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 15px var(--neon-primary));
}

/* Search Bar */
.header-search {
    flex: 0 1 200px;
    max-width: 300px;
    min-width: 140px;
    order: 3;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--neon-primary);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

.search-form:focus-within {
    border-color: var(--neon-secondary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9rem;
    outline: none;
    padding: 0.25rem 0;
}

.search-input::placeholder {
    color: var(--muted, #64748b);
}

.search-btn {
    background: none;
    border: none;
    color: var(--neon-primary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    margin: 0 0 0 auto;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
}

.search-btn:hover {
    color: var(--neon-secondary);
    transform: scale(1.1);
}

/* Header Links (Login/Create Account) */
.header-link {
    color: var(--muted, #94a3b8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-link:hover {
    color: var(--neon-primary);
}

.header-link-primary {
    background: linear-gradient(135deg, var(--neon-primary, #00d4ff), var(--neon-secondary, #0099ff));
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.header-link-primary:hover {
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.6);
    transform: translateY(-2px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 340px;
    background: var(--sidebar-bg);
    border-right: 2px solid var(--neon-primary);
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 5px 0 50px var(--neon-glow);
    backdrop-filter: blur(30px);
}

.sidebar.active {
    transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--neon-primary);
    background: var(--sidebar-glass);
    box-shadow: 0 2px 20px var(--neon-glow);
}

.sidebar-logo img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 0 10px var(--neon-primary));
}

.sidebar-close {
    background: var(--sidebar-glass);
    border: 2px solid var(--neon-primary);
    color: var(--neon-primary);
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: bold;
    box-shadow: 0 0 15px var(--neon-glow);
}

.sidebar-close:hover {
    background: var(--neon-primary);
    color: #000;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 25px var(--neon-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1rem 0;
    min-height: calc(100vh - 100px);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block !important;
    visibility: visible !important;
}

.sidebar-menu>li {
    position: relative;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0;
    padding: 0;
}

/* Sidebar Links */
.sidebar-link {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    color: #fff !important;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--neon-primary), transparent);
    transition: width 0.3s ease;
    opacity: 0.2;
}

.sidebar-link:hover::before {
    width: 100%;
}

.sidebar-link .icon {
    margin-right: 0.75rem;
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px var(--neon-primary));
}

.sidebar-link:hover {
    background: var(--sidebar-glass);
    border-left-color: var(--neon-primary);
    color: var(--neon-primary) !important;
    transform: translateX(5px);
    box-shadow: inset 0 0 20px var(--neon-glow);
}

.sidebar-link.admin-link {
    color: #ffd700 !important;
}

.sidebar-link.admin-link:hover {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: #ffd700;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.3);
}

.sidebar-link.logout-link:hover {
    background: rgba(255, 68, 68, 0.1);
    border-left-color: #ff4444;
    color: #ff4444 !important;
    box-shadow: inset 0 0 20px rgba(255, 68, 68, 0.3);
}

/* Dropdown Arrow */
.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: auto;
    color: var(--neon-primary);
    text-shadow: 0 0 10px var(--neon-glow);
}

.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Container */
.sidebar-dropdown {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.4);
    border-left: 2px solid var(--neon-primary);
    opacity: 0;
    display: block !important;
}

.sidebar-dropdown.open .sidebar-submenu {
    max-height: 2000px;
    opacity: 1;
}

.sidebar-submenu li {
    position: relative;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-submenu a {
    display: flex !important;
    align-items: center;
    padding: 0.875rem 1.5rem 0.875rem 3rem;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-submenu a::before {
    content: '▸';
    position: absolute;
    left: 2rem;
    color: var(--neon-primary);
    opacity: 0;
    transition: all 0.3s ease;
}

.sidebar-submenu a:hover::before {
    opacity: 1;
    left: 2.2rem;
}

.sidebar-submenu a:hover {
    background: var(--sidebar-glass);
    border-left-color: var(--neon-primary);
    color: var(--neon-primary) !important;
    padding-left: 3.5rem;
    box-shadow: inset 0 0 15px var(--neon-glow);
}

/* Sidebar Divider */
.sidebar-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-primary), transparent);
    margin: 0.75rem 1.5rem;
    box-shadow: 0 0 10px var(--neon-glow);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(8px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Badge positioning */
.sidebar-menu .nav-badge-wrapper {
    position: relative;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-menu .nav-badge-wrapper .sidebar-link {
    display: flex !important;
}

.sidebar-menu .nav-badge-wrapper .nav-badge {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    background: var(--neon-secondary);
    box-shadow: 0 0 15px var(--neon-secondary);
}

.sidebar-submenu .nav-badge-wrapper {
    position: relative;
    display: block !important;
    visibility: visible !important;
}

.sidebar-submenu .nav-badge-wrapper a {
    display: flex !important;
}

.sidebar-submenu .nav-badge-wrapper .nav-badge {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    background: var(--neon-secondary);
    box-shadow: 0 0 15px var(--neon-secondary);
}

/* Main content adjustment */
.main-content {
    margin-top: 115px;
    padding-top: 24px;
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--neon-primary);
    border-radius: 5px;
    box-shadow: 0 0 10px var(--neon-glow);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #fff;
    box-shadow: 0 0 15px #fff;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 3rem 0 3rem;
        gap: 1rem;
    }

    .header-search {
        max-width: 250px;
    }

    .header-actions {
        gap: 1rem;
    }
}

/* Responsive - Desktop */
@media (min-width: 769px) {
    .hamburger-menu {
        display: none !important;
    }
}

/* Responsive - Medium screens (tablets & small laptops) */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-content {
        padding: 0 1.5rem 0 1.5rem;
        gap: 0.75rem;
    }

    .header-nav-links a {
        font-size: 0.85rem;
    }

    .header-search {
        max-width: 240px;
        min-width: 120px;
    }
}

/* Responsive - Mobile Tablet */
@media (max-width: 768px) {
    .hamburger-menu {
        left: auto;
        right: 0.75rem;
    }

    .header-content {
        padding: 0 3.5rem 0 0.5rem;
        gap: 0.5rem;
        flex-wrap: wrap;
        overflow: visible;
    }

    .logo {
        flex-shrink: 0;
        flex: 0 0 auto;
        order: 1;
        margin-right: 0;
    }

    .header-nav-links {
        display: none;
    }

    .header-search {
        display: flex;
        flex: 1 1 150px;
        max-width: 200px;
        min-width: 100px;
        order: 2;
    }

    .header-link {
        display: none;
    }

    .header-actions {
        gap: 0.5rem;
        order: 3;
    }

    .header-icon {
        font-size: 1.3rem;
    }

    .logo-image {
        height: 45px;
        width: auto;
    }

    .sidebar {
        width: 280px;
    }

    .hamburger-menu {
        width: 50px;
        height: 50px;
        top: 0.75rem;
        right: 0.75rem;
        left: auto;
    }

    .hamburger-menu span {
        width: 22px;
        height: 2.5px;
    }

    .sidebar-header {
        padding: 1rem 1.25rem;
    }

    .sidebar-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .sidebar-submenu a {
        padding: 0.75rem 1.25rem 0.75rem 2.5rem;
        font-size: 0.9rem;
    }

    .main-content {
        margin-top: 90px;
        padding: 0 16px;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .hamburger-menu {
        left: auto;
        right: 0.625rem;
    }

    .header-content {
        padding: 0 3rem 0 0.5rem;
        gap: 0.4rem;
    }

    .logo {
        margin-right: 0;
    }

    .header-search {
        flex: 1 1 120px;
        max-width: 150px;
        min-width: 80px;
    }

    .search-form {
        padding: 0.4rem 0.5rem;
        gap: 0.3rem;
    }

    .search-input {
        font-size: 0.8rem;
    }

    .header-link {
        display: none;
    }

    .header-icon {
        font-size: 1.2rem;
    }

    .sidebar {
        width: 85%;
        max-width: 280px;
    }

    .hamburger-menu {
        width: 48px;
        height: 48px;
        top: 0.625rem;
        left: auto;
        right: 0.625rem;
    }

    .hamburger-menu span {
        width: 20px;
        height: 2px;
    }

    .logo-image {
        height: 40px;
        width: auto;
    }

    .sidebar-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .sidebar-submenu a {
        padding: 0.625rem 1rem 0.625rem 2rem;
        font-size: 0.85rem;
    }

    .main-content {
        margin-top: 85px;
        padding: 0 12px;
    }

    .sidebar-header {
        padding: 0.875rem 1rem;
    }
}

/* Ultra-small mobile */
@media (max-width: 375px) {
    .header-content {
        padding: 0 3rem 0 3rem;
    }

    .hamburger-menu {
        width: 44px;
        height: 44px;
        top: 0.5rem;
        left: auto;
        right: 0.5rem;
    }

    .hamburger-menu span {
        width: 18px;
    }

    .logo-image {
        height: 36px;
    }

    .main-content {
        margin-top: 80px;
    }
}

/* Pulsing effect for active menu */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 20px var(--neon-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--neon-glow), 0 0 60px var(--neon-glow);
    }
}

.hamburger-menu {
    animation: pulse 3s infinite;
}

/* Ensure everything is visible by default */
* {
    box-sizing: border-box;
}

.sidebar *,
.sidebar-menu *,
.sidebar-nav * {
    visibility: visible !important;
}

button.sidebar-link,
a.sidebar-link {
    display: flex !important;
}

.sidebar-submenu {
    display: block !important;
}

/* ===================================
   ADMIN HAMBURGER MENU STYLES
   =================================== */

.admin-hamburger-menu {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
    z-index: 1100;
    background: var(--sidebar-glass);
    border: 2px solid #ff6b35;
    border-radius: 12px;
    width: 55px;
    height: 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    animation: pulse-admin 3s infinite;
}

.admin-hamburger-menu span {
    display: block;
    width: 26px;
    height: 3px;
    background: #ff6b35;
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.admin-hamburger-menu:hover {
    transform: scale(1.1);
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.8);
}

.admin-hamburger-menu:hover span {
    background: #fff;
    box-shadow: 0 0 15px #fff;
}

@keyframes pulse-admin {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.8), 0 0 60px rgba(255, 107, 53, 0.5);
    }
}

/* Admin Sidebar Navigation */
.admin-sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 2px solid #ff6b35;
    z-index: 1099;
    overflow-y: auto;
    backdrop-filter: blur(30px);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
    animation: slideInAdmin 0.3s ease;
    padding: 0;
}

@keyframes slideInAdmin {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.admin-sidebar-nav.active {
    display: block;
}

.admin-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #ff6b35;
    background: rgba(255, 107, 53, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-sidebar-header h3 {
    margin: 0;
    color: #ff6b35;
    font-size: 1.3rem;
    font-weight: 700;
}

.admin-sidebar-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #ff6b35;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.admin-sidebar-close:hover {
    color: #fff;
    transform: scale(1.2);
}

/* Admin Navigation Menu */
.admin-nav {
    padding: 0;
}

.admin-section-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ff6b35;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top: 1px solid rgba(255, 107, 53, 0.2);
    margin-top: 0.5rem;
}

.admin-section-title:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0.5rem;
}

.admin-menu-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.admin-menu-list li {
    margin: 0;
    padding: 0;
}

.admin-menu-list a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    gap: 0.75rem;
}

.admin-menu-list a:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
    padding-left: 2rem;
}

.admin-menu-list a.logout-link {
    color: #ff6b35;
    font-weight: 600;
}

.admin-menu-list a.logout-link:hover {
    background: rgba(255, 107, 53, 0.2);
    color: #fff;
}

/* Database Access Section Styling */
.admin-menu-list.database-access a {
    border-left: 3px solid rgba(255, 107, 53, 0.2);
    padding-left: 1.2rem;
}

.admin-menu-list.database-access a:hover {
    border-left-color: #ff6b35;
    background: rgba(255, 107, 53, 0.15);
}

/* Admin Sidebar Overlay */
.admin-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1098;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design for Admin Menu */
@media (max-width: 768px) {
    .admin-sidebar-nav {
        width: 100%;
        max-width: none;
    }

    .admin-sidebar-header h3 {
        font-size: 1.1rem;
    }

    .admin-menu-list a {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    .admin-menu-list a:hover {
        padding-left: 1.75rem;
    }
}

@media (max-width: 480px) {
    .admin-hamburger-menu {
        width: 50px;
        height: 50px;
        gap: 5px;
    }

    .admin-hamburger-menu span {
        width: 22px;
        height: 2.5px;
    }

    .admin-sidebar-nav {
        width: 100vw;
    }

    .admin-sidebar-header {
        padding: 1.25rem;
    }

    .admin-sidebar-header h3 {
        font-size: 1rem;
    }

    .admin-menu-list a {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }

    .admin-menu-list a:hover {
        padding-left: 1.5rem;
    }
}
