/* ========================================
   SIDEBAR NAVIGATION
   Left sidebar with document links
   ======================================== */

.sidebar {
    width: 280px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    transition: transform 0.3s ease, left 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
    left: -280px;
    display: block !important;
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--surface-color);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Sidebar Title */
.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Navigation List */
.nav-list {
    list-style: none;
}

.nav-list-utility {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: rgba(64, 224, 208, 0.08);
    color: var(--accent-color);
    transform: translateX(2px);
    border-left: 2px solid var(--accent-color);
    padding-left: calc(0.75rem - 2px);
}

.nav-link.active {
    background: linear-gradient(135deg, #008888 0%, #00E5D0 100%);
    background-size: 200% auto;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(64, 224, 208, 0.4), 0 0 15px rgba(64, 224, 208, 0.2);
    border: 1px solid rgba(64, 224, 208, 0.3);
    animation: activeGradient 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: activeLinkShine 3s ease-in-out infinite;
}

@keyframes activeGradient {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

@keyframes activeLinkShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Empty State */
.nav-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.nav-empty code {
    background-color: var(--code-background);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* ========================================
   SIDEBAR EXPORT BUTTON
   Export button integrated in sidebar
   ======================================== */

.sidebar-export {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #008888 0%, #00E5D0 100%);
    background-size: 200% auto;
    color: white;
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(64, 224, 208, 0.3);
    position: relative;
    overflow: hidden;
    animation: exportGradient 3s ease-in-out infinite;
}

.sidebar-export-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: exportShine 3s ease-in-out infinite;
}

@keyframes exportGradient {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

@keyframes exportShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.sidebar-export-btn:hover {
    background: linear-gradient(135deg, #008080 0%, #66E6DD 100%);
    box-shadow: 0 4px 12px rgba(64, 224, 208, 0.5), 0 0 20px rgba(64, 224, 208, 0.3);
    transform: translateY(-2px);
    animation: none;
}

.sidebar-export-btn:active {
    transform: translateY(0);
}

.sidebar-export-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.sidebar-export-btn span {
    position: relative;
    z-index: 1;
}

.sidebar-export-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

[data-theme="light"] .nav-link:hover {
    background-color: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    border-left-color: #0f766e;
}

[data-theme="light"] .nav-link.active {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.2);
}

[data-theme="light"] .sidebar-export-btn {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.2);
}

[data-theme="light"] .sidebar-export-btn:hover {
    background: linear-gradient(135deg, #0d655f 0%, #0ea597 100%);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.25);
}
