/* =================================
   Navbar - x0ne.training
   Minimal, sober design matching login
   ================================= */

/* Monitoring Bar (Top strip) */
#monitoringbar {
    background: rgba(10, 10, 11, 0.95);
    backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.25);
    font-family: var(--font-mono);
    font-size: 10px;
    display: flex;
    justify-content: flex-start;
    text-align: left;
    line-height: 22px;
    margin: 0;
    padding: 0 var(--space-lg);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 22px;
    z-index: 1001;
    border-bottom: 1px solid rgba(74, 144, 217, 0.08);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

#monitoringbar.scrolled {
    border-bottom: none;
}

#monitoringbar span,
#monitoringbar p {
    display: inline;
    margin: 0;
    font-size: 10px;
}

#monitoringbar .bar-accent {
    color: rgba(74, 144, 217, 0.7);
}

#monitoringbar .bar-purple {
    color: rgba(167, 139, 250, 0.6);
}

#monitoringbar .bar-yellow {
    color: rgba(251, 191, 36, 0.6);
}

#monitoringbar .bar-yellow-pale {
    color: rgba(251, 191, 36, 0.5);
}

#monitoringbar .bar-yellow-pale.quota-low {
    color: rgba(251, 191, 36, 0.8);
}

#monitoringbar .bar-yellow-pale.quota-empty {
    color: rgba(239, 68, 68, 0.7);
}

#monitoringbar .bar-success {
    color: rgba(74, 222, 128, 0.6);
}

#monitoringbar .bar-warning {
    color: rgba(251, 191, 36, 0.6);
}

/* Runner dots */
#monitoringbar .runner-dot-on {
    color: rgba(74, 222, 128, 0.9);
    cursor: pointer;
    margin: 0 1px;
}

#monitoringbar .runner-dot-off {
    color: rgba(251, 191, 36, 0.9);
    cursor: pointer;
    margin: 0 1px;
}

#monitoringbar .runner-dot-key {
    color: rgba(244, 67, 54, 0.9);
    cursor: pointer;
    margin: 0 1px;
    font-size: 0.7rem;
}

#monitoringbar .runner-dot-stale {
    opacity: 0.4;
}

#monitoringbar .bar-clickable {
    cursor: pointer;
}

#monitoringbar .bar-clickable:hover,
#monitoringbar .runner-dot-on:hover,
#monitoringbar .runner-dot-off:hover,
#monitoringbar .runner-dot-key:hover {
    opacity: 0.7;
}

#monitoringbar .bar-loading {
    color: rgba(74, 144, 217, 0.8);
    animation: pulse 0.5s ease-in-out infinite;
}

#monitoringbar .bar-error {
    color: rgba(239, 68, 68, 0.8);
    cursor: pointer;
}

/* Active Batches */
#monitoringbar .batch-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    cursor: default;
}

#monitoringbar .batch-name {
    color: rgba(167, 139, 250, 0.6);
    font-size: 9px;
}

#monitoringbar .batch-progress {
    width: 32px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

#monitoringbar .batch-fill {
    height: 100%;
    background: rgba(74, 222, 128, 0.7);
    transition: width 0.3s ease;
}

#monitoringbar .batch-pct {
    color: rgba(74, 222, 128, 0.6);
    font-size: 9px;
    min-width: 24px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

#monitoringbar .bar-user {
    color: rgba(255, 255, 255, 0.5);
}

#monitoringbar .bar-separator {
    color: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

#monitoringbar .bar-muted {
    color: rgba(255, 255, 255, 0.2);
    opacity: 0.5;
}

#monitoringbar .bar-team {
    color: rgba(74, 222, 128, 0.6);
}

/* Main Navbar Container */
#navbar {
    margin: 0;
    padding: 0 var(--space-xl);
    position: fixed;
    top: 22px;
    left: 0;
    right: 0;
    width: 100%;
    height: 54px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    transition: all 0.3s ease;
    border-bottom: none;
}

/* Navbar Scrolled State */
#navbar.scrolled {
    background: rgba(10, 10, 11, 0.95);
    backdrop-filter: blur(12px);
    height: 48px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
}

/* Logo Wrapper */
#navbar > a {
    display: block;
}

/* Logo */
#logo {
    height: 36px;
    padding: 0;
    transition: all 0.25s ease;
    opacity: 0.55;
    filter: brightness(0) invert(1) sepia(0.15) saturate(2) hue-rotate(188deg);
}

#logo:hover {
    opacity: 0.85;
    filter: brightness(0) invert(1) sepia(0.1) saturate(1.5) hue-rotate(188deg);
}

#navbar.scrolled #logo {
    height: 26px;
    opacity: 0.6;
}

/* =================================
   Menu - Minimal Style
   ================================= */

.menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.menu a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    text-transform: lowercase;
    padding: 6px 0;
    display: flex;
    align-items: center;
    line-height: 1;
}

.menu a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.menu a.current {
    color: rgba(74, 144, 217, 0.8);
}

.menu a.current::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(74, 144, 217, 0.4);
}

/* Logout - subtle */
.menu a.logout {
    color: rgba(255, 255, 255, 0.25);
    padding: 6px 0;
    transition: all 0.25s ease;
}

.menu a.logout:hover {
    color: rgba(255, 107, 107, 0.6);
}

/* Dropdown in menu — padding-bottom acts as hover bridge to the menu */
.menu .dropdown {
    padding: 0 0 8px 0;
    margin-bottom: -8px;
}

/* Dropdown trigger — same baseline as plain links */
.menu .dropdown-trigger {
    padding-bottom: 6px;
    margin-bottom: 0;
}

.dropdown-trigger .menu-arrow {
    font-size: 0.6em;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.dropdown:hover .dropdown-trigger .menu-arrow {
    opacity: 0.8;
}

/* Hamburger Icon (Hidden on Desktop) */
.menu .icon {
    display: none !important;
    font-size: 1.1rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
}

/* =================================
   Mobile Menu - Minimal Style
   ================================= */

@media screen and (max-width: 800px) {
    #monitoringbar {
        font-size: 9px;
        padding: 0 var(--space-md);
    }

    #navbar {
        padding: 0 var(--space-md);
    }

    .menu a:not(.icon),
    .menu .dropdown,
    .menu .dropdown-trigger {
        display: none;
    }

    .menu .icon {
        display: block !important;
        z-index: 10001;
        position: relative;
    }

    .menu.responsive {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 260px;
        background: rgba(10, 10, 11, 0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 70px;
        padding-bottom: 24px;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
        transform: translateX(0);
        z-index: 10000;
        border-left: 1px solid rgba(74, 144, 217, 0.1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .menu.responsive a:not(.icon) {
        display: block;
        width: 100%;
        padding: 14px 24px;
        border-bottom: 1px solid rgba(74, 144, 217, 0.06);
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.55);
        transition: all 0.2s ease;
    }

    .menu.responsive a:hover {
        background: rgba(74, 144, 217, 0.05);
        color: rgba(255, 255, 255, 0.8);
        padding-left: 28px;
    }

    .menu.responsive .dropdown {
        display: block;
        width: 100%;
    }

    .menu.responsive .dropdown-trigger {
        display: flex;
        width: 100%;
        padding: 14px 24px;
        font-size: 0.8rem;
        justify-content: space-between;
        border-bottom: 1px solid rgba(74, 144, 217, 0.06);
        color: rgba(255, 255, 255, 0.55);
    }

    .menu.responsive .dropdown-menu {
        display: block;
        position: static;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        border: none;
        border-radius: 0;
        width: 100%;
        padding: 0;
    }

    .menu.responsive .dropdown-menu a {
        padding: 12px 24px 12px 40px;
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.45);
        border-radius: 0;
    }

    .menu.responsive .dropdown-menu a:hover {
        background: rgba(74, 144, 217, 0.08);
        color: rgba(255, 255, 255, 0.7);
    }

    .menu.responsive .icon {
        position: fixed;
        top: 28px;
        right: var(--space-md);
    }
}

/* Very small screens */
@media screen and (max-width: 480px) {
    #monitoringbar {
        font-size: 8px;
        padding: 0 var(--space-sm);
        height: 20px;
        line-height: 20px;
    }
    
    #navbar {
        top: 20px;
        height: 48px;
        padding: 0 var(--space-sm);
    }
    
    #logo {
        height: 28px;
    }
    
    #navbar.scrolled #logo {
        height: 22px;
    }
    
    .menu.responsive {
        width: 100%;
        padding-top: 60px;
    }
    
    .menu.responsive a:not(.icon) {
        padding: 16px 20px;
        font-size: 0.9rem;
    }
    
    .menu.responsive .dropdown-trigger {
        padding: 16px 20px;
        font-size: 0.9rem;
    }
    
    .menu.responsive .dropdown-menu a {
        padding: 14px 20px 14px 36px;
        font-size: 0.85rem;
    }
}
