/* nested-view.css - Material 3 style bottom sheet, mobile only */

#nested-scrim {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s;
    pointer-events: none;
}

#nested-scrim.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nested-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 501;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(100%);
    transition:
        transform 0.32s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.32s cubic-bezier(0.25, 1, 0.5, 1),
        border-radius 0.25s ease;
    will-change: transform, height;
    overflow: hidden;
}

.nested-sheet.dragging {
    transition: none !important;
}

.nested-sheet.fullscreen {
    border-radius: 0;
}

.nested-sheet.fullscreen .nested-sheet-header {
    padding-top: env(safe-area-inset-top);
}

.nested-sheet-handle {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 24px;
    touch-action: none;
    cursor: grab;
}

.nested-handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--text-muted);
    opacity: 0.6;
}

.nested-sheet-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 4px 16px 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.nested-sheet-title {
    flex-grow: 1;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nested-close-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nested-close-btn:active {
    background: rgba(255, 255, 255, 0.18);
}

.nested-sheet-content {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom);
    color: var(--text-color);
}

/* Tab bar for switching between multiple open sheets, mirrors the desktop dock */
#nested-tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 600;
    display: flex;
    gap: 10px;
    padding: 10px calc(14px + env(safe-area-inset-left))
        calc(10px + env(safe-area-inset-bottom))
        calc(14px + env(safe-area-inset-left));
    background: rgba(26, 16, 37, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    overflow-x: auto;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

#nested-tab-bar.tab-bar-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.nested-tab {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nested-tab.active {
    background: var(--accent-hover);
    box-shadow: 0 0 0 2px var(--text-color) inset;
}

@media (min-width: 900px) {
    /* Safety net if this file is accidentally loaded on desktop widths */
    #nested-scrim,
    .nested-sheet,
    #nested-tab-bar {
        display: none;
    }
}
