/**
 * Experiture Help System - Shared Sidebar Navigation Styles
 * Include this CSS file in all help documents to get consistent sidebar styling
 */

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
    width: 280px;
    position: fixed;
    left: 0;
    top: 55px;
    height: calc(100vh - 55px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    -moz-backdrop-filter: blur(50px);
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 2px 0 8px rgba(18, 170, 226, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 90;
    padding: 20px 0;
}

.sidebar-category {
    margin-bottom: 8px;
}

.sidebar-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #0C3D62;
    transition: all 0.2s ease;
    user-select: none;
}

.sidebar-category-header:hover {
    background: rgba(18, 170, 226, 0.1);
    color: #12AAE2;
}

.sidebar-category-header.active {
    background: rgba(18, 170, 226, 0.15);
    color: #12AAE2;
}

.sidebar-category-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.sidebar-category.open .sidebar-category-icon {
    transform: rotate(90deg);
}

.sidebar-icon {
    font-size: 16px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

.sidebar-articles {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-category.open .sidebar-articles {
    max-height: 1000px;
}

.sidebar-article-link {
    display: block;
    padding: 10px 20px 10px 40px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-article-link:hover {
    background: rgba(18, 170, 226, 0.08);
    color: #0C3D62;
    border-left-color: rgba(18, 170, 226, 0.3);
}

.sidebar-article-link.current {
    background: rgba(18, 170, 226, 0.15);
    color: #12AAE2;
    font-weight: 600;
    border-left-color: #12AAE2;
}

/* Layout adjustments for sidebar */
/* These styles apply when sidebar-navigation.css is included */
.page-wrapper {
    display: flex !important;
}

.content {
    flex: 1 !important;
    margin-left: 280px !important;
    margin-top: 50px !important; /* Updated for compact header height */
    max-width: calc(100vw - 320px) !important; /* Prevent content overflow - 280px sidebar + 40px padding */
    overflow-x: hidden !important; /* Prevent horizontal scroll */
}

.compact-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* ===== BURGER MENU (NOW IN COMPACT HEADER) ===== */
.sidebar-burger {
    display: none; /* Hidden by default - only show on mobile */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
    position: relative;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-direction: column;
}

.sidebar-burger:hover span {
    background: #12AAE2;
}

.sidebar-burger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #0C3D62;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.sidebar-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.sidebar-burger.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}


/* ===== TABLE OF CONTENTS TAB & PANEL (DISABLED) ===== */
/* Side tab removed - TOC now in header dropdown */
.toc-tab {
    display: none !important;
}

/* TOC Panel removed - using header dropdown instead */
.toc-panel {
    display: none !important;
}

.toc-panel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    color: #0C3D62;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
}

.toc-panel-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.toc-panel h3 {
    color: #0C3D62;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    margin-top: 10px;
    padding-right: 40px;
    position: relative;
    z-index: 100;
}

.toc-panel ul {
    list-style: none;
    padding-left: 0;
    position: relative;
    z-index: 100;
}

.toc-panel li {
    margin-bottom: 10px;
    position: relative;
    z-index: 100;
}

.toc-panel a {
    color: #12AAE2;
    text-decoration: none;
    padding: 12px 16px;
    display: block;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    position: relative;
    z-index: 100;
    background: rgba(255, 255, 255, 0.3);
    margin: 4px 0;
}

.toc-panel a:hover {
    color: #0C3D62;
    background: rgba(18, 170, 226, 0.15);
    transform: translateX(4px);
}

/* Ensure TOC content is always on top */
.toc-panel .toc {
    position: relative;
    z-index: 100;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.toc-panel .toc::before {
    display: none;
}

/* TOC overlay removed - using header dropdown instead */
.toc-overlay {
    display: none !important;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Show burger menu on mobile */
    .sidebar-burger {
        display: flex !important;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        width: 100%;
        left: -100%;
        transition: left 0.3s ease;
        z-index: 100;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    /* Show sidebar when active */
    .sidebar.mobile-open {
        left: 0;
    }

    /* Show overlay when sidebar is open */
    .sidebar-overlay {
        display: block;
    }
    
    /* Touch-optimized spacing for mobile */
    .sidebar-category-header {
        padding: 16px 20px;
        font-size: 15px;
        min-height: 48px; /* Minimum touch target size */
    }

    .sidebar-article-link {
        padding: 14px 20px 14px 50px;
        font-size: 14px;
        min-height: 44px; /* Minimum touch target size */
        display: flex;
        align-items: center;
    }

    .sidebar-icon {
        font-size: 18px;
        margin-right: 10px;
    }

    /* Remove content margin and fix width on mobile */
    .content {
        margin-left: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Adjust compact header on mobile - reduced padding for more screen space */
    .compact-header {
        padding: 0 10px !important;
    }
}

