/* ===== VOYGER TAB BAR ===== */
.voyger-tab-bar {
    display: flex;
    align-items: flex-end;
    gap: 0;
    background-color: #e8e8ec;
    border-bottom: 1px solid #d0d0d5;
    position: sticky;
    top: 50px; /* fallback — JS sets the exact value via _syncTabBarTop() */
    z-index: 899;
    min-height: 40px;
    padding: 0 6px;
    padding-top: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    flex-shrink: 0;
}

.voyger-tab-bar::-webkit-scrollbar {
    display: none;
}

/* ===== INDIVIDUAL TAB ===== */
.voyger-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    min-width: 0;
    max-width: 240px;
    height: 38px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    margin-bottom: -1px;
}

.voyger-tab:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: #333;
}

.voyger-tab.active {
    color: var(--dash-primary, #4f46e5);
    background-color: #f4f6f9;
    border-color: #d0d0d5;
    font-weight: 600;
    z-index: 1;
}

/* Tab icon */
.voyger-tab-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

/* Tab title */
.voyger-tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

/* Tab close button */
.voyger-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.voyger-tab:hover .voyger-tab-close,
.voyger-tab.active .voyger-tab-close {
    opacity: 1;
}

.voyger-tab-close:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Hide close button when only one tab remains */
.voyger-tab-bar[data-tab-count="1"] .voyger-tab-close {
    display: none;
}

/* ===== ADD TAB BUTTON ===== */
.voyger-tab-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #777;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 4px;
    margin-bottom: 3px;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.voyger-tab-add:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: #333;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .voyger-tab-bar {
        top: 42px;
        min-height: 36px;
        padding: 0 3px;
        padding-top: 3px;
    }

    .voyger-tab {
        padding: 6px 10px;
        height: 34px;
        font-size: 0.8rem;
        max-width: 180px;
    }

    .voyger-tab-title {
        max-width: 120px;
    }

    .voyger-tab-icon {
        font-size: 0.75rem;
    }

    .voyger-tab-add {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .voyger-tab-bar {
        top: 38px;
    }

    .voyger-tab {
        padding: 4px 8px;
        height: 32px;
        font-size: 0.75rem;
        max-width: 140px;
    }

    .voyger-tab-title {
        max-width: 80px;
    }
}

/* ===== NEW TAB PLACEHOLDER ===== */
.new-tab-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px 12px;
    max-width: 1000px;
    margin: 0 auto;
}

.new-tab-header {
    text-align: center;
    margin-bottom: 14px;
}

.new-tab-header .new-tab-icon {
    font-size: 1.6rem;
    color: var(--dash-primary, #4f46e5);
    opacity: 0.5;
    margin-bottom: 4px;
}

.new-tab-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 2px 0;
    font-family: 'Inter', sans-serif;
}

.new-tab-header p {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

.new-tab-modules {
    width: 100%;
}

.new-tab-category {
    margin-bottom: 10px;
}

.new-tab-category-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin: 0 0 4px 0;
    padding-left: 4px;
}

.new-tab-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 5px;
}

.new-tab-module-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    color: #444;
    font-size: 0.76rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    position: relative;
}

.new-tab-module-btn i:first-child {
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
    color: var(--dash-primary, #4f46e5);
    flex-shrink: 0;
}

.new-tab-module-btn:hover:not(:disabled) {
    background: #fff;
    border-color: var(--dash-primary, #4f46e5);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
    color: #222;
}

.new-tab-module-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.new-tab-module-btn.disabled,
.new-tab-module-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.02);
}

.new-tab-lock-icon {
    font-size: 0.6rem;
    color: #bbb;
    margin-left: auto;
}

@media (max-width: 600px) {
    .new-tab-placeholder {
        padding: 12px 10px;
    }

    .new-tab-module-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 4px;
    }

    .new-tab-module-btn {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
}

/* ===== TAB PANE HOST ===== */
#tab-pane-host {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;   /* scrollable container for regular (non-fullscreen) modules */
}

/* Each tab's content pane */
.tab-pane {
    width: 100%;
    min-height: 0;
}

.tab-pane[style*="display: none"] {
    /* Hidden panes stay in DOM for preservation */
    pointer-events: none;
}
