/* ========================================
   Overview Component Styles
   ======================================== */

:root {
    --overview-header-height: 57px; /* Shared header height for sidebar and content alignment */
    --overview-content-spacing: 8px; /* Shared spacing for sidebar and content body alignment */
}

.overview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-backdrop);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Full screen mode: no backdrop */
.overview-container.overview-fullscreen {
    background: transparent;
    justify-content: stretch;
    align-items: stretch;
}

.overview-modal {
    width: 90%;
    height: 90%;
    max-width: 1400px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-large);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Full screen mode: no rounded corners, no shadow, 100% size */
.overview-modal.overview-modal-fullscreen {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
}


/* Body (Sidebar + Content) */
.overview-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative; /* For ::before positioning */
}

/* Dark gradient background - full width across sidebar and content */
.overview-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--overview-header-height); /* Match header height */
    background: var(--header-gradient);
    z-index: 100; /* Above sidebar/content backgrounds */
    pointer-events: none; /* Allow clicks to pass through */
}

/* Sidebar Navigation */
.overview-sidebar {
    width: 216px; /* 200px + padding */
    min-width: 216px;
    background: var(--bg-secondary);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: var(--overview-content-spacing);
    padding-top: calc(var(--overview-header-height) + var(--overview-content-spacing) + var(--card-header-height)); /* Align with card table border: content-header + spacing + card-header */
    gap: var(--overview-content-spacing);
    position: relative; /* Stack above gradient */
    z-index: 2;
}

/* Sidebar Header (Vehicle ID / Workspace) - styled as mini card */
.overview-sidebar-header {
    height: var(--overview-header-height);
    padding: 0 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    box-sizing: border-box;
    z-index: 101; /* Above gradient */
}

.overview-sidebar-header > button {
    position: absolute;
    inset-inline-end: 12px;
}

/* Header divider between sections */
.overview-sidebar-divider {
    display: none; /* Hidden - sidebar header now has its own border-bottom */
}

/* Add button styling handled by button-component.js */

/* Sidebar Navigation Items - styled as mini card */
.overview-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: var(--shadow-small);
}

/* Hide nav container when empty */
.overview-sidebar-nav:empty {
    display: none;
}

.overview-nav-section {
    border-bottom: 1px solid var(--border-subtle);
}

/* Nav sections use collapsible-section component - style the generic classes */
.overview-nav-section .collapsible-section-header {
    padding: 12px 20px;
}

.overview-nav-section .collapsible-section-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.overview-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 40px 10px 20px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
}

.overview-nav-item:hover {
    background: var(--interactive-hover);
}

.overview-nav-item.active {
    background: var(--interactive-selected);
    color: var(--blue-primary);
    font-weight: 500;
}


/* Top-level nav items (not inside sections) */
.overview-nav-item-top {
    padding: 12px 20px;
}

/* Main Content Area */
.overview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Header + body handle their own scrolling */
    position: relative; /* Stack above gradient */
    z-index: 2;
}

/* Content Header (Board title + actions) */
.overview-content-header {
    height: var(--overview-header-height); /* Matches sidebar header exactly for alignment */
    padding: 0 30px;
    background: transparent;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    box-sizing: border-box;
    position: relative;
    z-index: 101; /* Above gradient */
}

.overview-content-title {
    pointer-events: auto; /* Allow inline-edit clicks */
    position: fixed; /* Position relative to viewport, not parent */
    left: 50%; /* Dead center of viewport */
    transform: translateX(-50%); /* Offset by half its width */
    /* Inherits font styles from parent .overview-content-header */
}

.overview-content-menu {
    opacity: 1; /* Always visible (unlike sidebar menu which fades on hover) */
    position: absolute;
    right: 30px; /* Position menu at right edge */
}

/* Content Body (where groups render) */
.overview-content-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--overview-content-spacing) 30px 30px 30px;
}

/* Footer */
.overview-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-default);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.overview-footer-right {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.overview-footer-left {
    display: flex;
    gap: 12px;
}

.overview-footer-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.overview-footer-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
}

.overview-footer-btn.primary {
    background: var(--blue-primary);
    color: var(--text-inverse);
    border-color: var(--blue-primary);
}

.overview-footer-btn.primary:hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
}

/* ========================================
   Folders Section Styles
   ======================================== */

.overview-folders-section {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    padding-bottom: 12px;
}

.overview-folders-title {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Folders use folder component - only overview-specific styling here */

/* Dot menu hover behavior (workspace header, folders, boards) */
.overview-header-menu,
.collapsible-section-menu,
.overview-board-menu {
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

/* Show on parent hover */
.overview-sidebar-header:hover .overview-header-menu,
.collapsible-section-header:hover .collapsible-section-menu,
.folder-item:hover .overview-board-menu {
    opacity: 1;
    pointer-events: auto;
}

/* Board menu positioning */
.overview-board-menu {
    position: absolute;
    inset-inline-end: 8px;
}

/* Board item specific styling */
.overview-folder-item.current {
    background: var(--interactive-selected);
    color: var(--blue-primary);
}
