/* Tab System Styles */
.tab-bar-container {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: 38px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

.tab-bar-container::-webkit-scrollbar {
    height: 4px;
}

.tab-bar-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    margin-right: 2px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    max-width: 200px;
    position: relative;
    transition: all 0.2s ease;
}

.tab-item:hover {
    background: #fff;
}

.tab-item.active {
    background: #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -1px;
    color: #ff6600;
    font-weight: 500;
}

.tab-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.tab-item-close {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.tab-item-close:hover {
    background: #dc3545;
    color: #fff;
}

.tab-content-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    min-height: calc(100vh - 120px);
}

.tab-content-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    display: none;
    background: #fff;
}

.tab-content-panel.active {
    display: block;
}

.tab-content-panel iframe {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 120px);
    border: none;
    display: block;
}

.tab-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tab-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-tabs-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-size: 16px;
}

.no-tabs-message i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Keep active tab strip visible while scrolling under the fixed header. */
.content .tab-bar-container {
    position: sticky;
    top: 3.13rem;
    left: auto;
    right: auto;
    z-index: 30;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 10px;
    height: 38px;
    margin: 0 0 10px;
}

.left-panel-collapsed .tab-bar-container {
    left: auto;
}
