/* ===== Sidebar Navigation ===== */

/* Hamburger button */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1001;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--accent-cyan);
}

.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--accent-cyan);
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Sidebar panel */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-nav.open {
    transform: translateX(0);
}

/* Sidebar header */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .sidebar-logo-icon {
    font-size: 1.4rem;
}

.sidebar-header .sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Sidebar sections */
.sidebar-section {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 4px 20px 8px;
    font-weight: 600;
}

/* Sidebar links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(6, 182, 212, 0.3);
}

.sidebar-link.active {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.06);
    border-left-color: var(--accent-cyan);
    font-weight: 600;
}

.sidebar-link .link-emoji {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .link-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide the old header-nav on all pages when sidebar is active */
.header-nav {
    display: none !important;
}

/* Adjust header to show hamburger */
.header-inner,
.container.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Hide back-link on proto pages (replaced by sidebar) */
.back-link {
    display: none !important;
}