/* navigation.css - Side Sidebar & Navigation System */

/* =========================================
   SIDE SYSTEM (Left Sidebar)
   ========================================= */

.side-system {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.side-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-right: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    width: 52px;
    max-height: 85vh;
    padding-bottom: 20px;
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    transition: transform var(--tr-smooth);
    position: relative;
    z-index: 20;
}

.side-panel.collapsed {
    transform: translateX(-100%);
}

.side-tabs {
    position: absolute;
    left: 52px;
    /* Flush with panel edge (panel border-right removed) */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    align-items: flex-start;
    /* Ensure tabs are flush with the panel */
}

.side-system.closed .side-panel {
    transform: translateX(-100%);
}

.side-system.closed .side-tabs {
    transform: translateY(-50%) translateX(-52px);
}

.side-tab {
    width: 32px;
    height: 44px;
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    font-size: 1rem;
    color: var(--text-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-glass);
    border: 1px solid var(--border-glass);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    opacity: 0.8;
}

.side-tab:hover {
    width: 38px;
    opacity: 1;
    color: var(--text-main);
}

.side-tab.active {
    width: 40px;
    height: 48px;
    margin: -2px 0;
    background: var(--bg-surface-solid);
    opacity: 1;
    z-index: 100;
    box-shadow: var(--shadow-main);
}

/* Specific Colors & Indicator Strips on the RIGHT */
#tab-draw.active {
    color: var(--primary);
    border-right: 4px solid var(--primary);
}

#tab-insert.active {
    color: #10b981;
    border-right: 4px solid #10b981;
}

#tab-background.active {
    color: #8b5cf6;
    border-right: 4px solid #8b5cf6;
}

#tab-math.active {
    color: #f59e0b;
    border-right: 4px solid #f59e0b;
}

#tab-classroom.active {
    color: #ef4444;
    border-right: 4px solid #ef4444;
}

#tab-animation.active {
    color: #e879f9;
    border-right: 4px solid #e879f9;
}

/* =========================================
   NAVIGATION SYSTEM (Right Sidebar)
   ========================================= */

.nav-system {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    align-items: stretch;
    /* Both bar and tabs will match the tallest column */
    flex-direction: row;
    /* Tabs first (left), Panel second (right) */
    gap: 0;
    /* They will be flush */
}

.nav-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-left: none;
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    width: 52px;
    /* Standardize width to match translateX logic */
    height: auto;
    max-height: 90vh;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    /* Center content inside the bar */
    transition: transform var(--tr-smooth);
    z-index: 20;
    position: relative;
    overflow: hidden;
    height: auto;
    min-height: 220px;
    justify-content: center;
    padding: 14px 0;
}

/* Panel height expands slightly when library is active to show class list */
.nav-system.lib-active .nav-panel {
    height: auto;
    max-height: 85vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.nav-system.closed .nav-panel {
    transform: translateX(100%);
}

.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    align-items: flex-end;
    justify-content: center;
    /* Keep tabs centered vertically within the system block */
    padding: 20px 0;
    z-index: 10;
}

.nav-system.closed .nav-tabs {
    transform: translateX(52px);
    /* Moves tabs to be flush with edge (panel width) */
}

.nav-tab {
    width: 28px;
    height: 44px;
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    color: var(--text-muted);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-glass);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 5;
    opacity: 0.6;
}

.nav-tab:hover {
    width: 36px;
    opacity: 1;
}

.nav-tab.active {
    width: 40px;
    height: 48px;
    margin: -2px 0;
    background: var(--bg-surface-solid);
    opacity: 1;
    border-left: 4px solid var(--primary);
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 50;
}

/* Specific Colors per Nav Tab */
#tab-nav-library.active {
    color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

#tab-nav-view.active {
    color: #8b5cf6;
    border-left: 4px solid #8b5cf6;
}

#tab-nav-slides.active {
    color: #6366f1;
    border-left: 4px solid #6366f1;
}


/* Navigation Buttons & Sections */
.nav-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    gap: 12px;
    width: 100%;
    min-height: 100%;
}

.nav-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.nav-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0 10px;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
    background: var(--bg-item);
    color: var(--primary);
    transform: scale(1.1);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 131, 246, 0.3);
    transform: scale(1.05);
}

/* Sync Indicator has been removed */
.divider {
    width: 22px;
    height: 1.5px;
    background: var(--slate-100);
    margin: 4px 0;
}

/* Slide Thumbnails List */
.slide-thumbnails-container {
    width: 100%;
    margin-bottom: 4px;
}

.slide-thumbnails-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    padding: 2px 4px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.slide-thumbnails-list::-webkit-scrollbar {
    width: 8px;
}

.slide-thumbnails-list::-webkit-scrollbar-track {
    background: rgba(128, 128, 128, 0.06);
    border-radius: 4px;
}

.slide-thumbnails-list::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
    min-height: 40px;
}

.slide-thumbnails-list::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.5);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.slide-mini-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    background: var(--bg-surface-solid);
    box-shadow: var(--shadow-glass);
    transition: margin-top var(--tr-smooth), box-shadow var(--tr-fast), border-color var(--tr-fast);
    flex-shrink: 0;
}

.slide-mini-thumb * {
    pointer-events: none;
}

.slide-mini-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), var(--shadow-main);
    transform: scale(1.02);
}

.slide-mini-thumb:hover {
    transform: scale(1.02);
}

.slide-mini-thumb.dragging {
    opacity: 0.4;
}

.slide-mini-thumb.drag-over {
    margin-top: 60px;
}

.slide-mini-thumb.drag-over::before {
    content: "";
    position: absolute;
    top: -56px;
    left: 0;
    width: 100%;
    height: 52px;
    border: 2px dashed var(--primary);
    background: rgba(59, 131, 246, 0.05);
    border-radius: 6px;
}

/* ─── Sidebar & nav responsive layout → responsive-scale.css §10–12 ───
   Side/nav systems reposition and resize at 768px and 480px breakpoints;
   all rules are centralized in responsive-scale.css for one-file editing. */