﻿/* ===================================================================
   SplitContent — right-side split panel with its own tab system
   =================================================================== */

.split-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #c2cfd3;
    border-left: 0px solid var(--border);
    min-width: 0;
    overflow: hidden;
    margin-left: 15px;
    box-shadow: inset 2px 0px 2px rgba(0, 0, 0, 0.1);
}

/* --- Resize handle (left edge) --- */

.split-content__handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 15px;
    cursor: col-resize;
    z-index: 10;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: white;
    padding: 25px 0;
}

.split-content__handle-bar {
    width: 2px;
    height: 100%;
    border-radius: 2px;
    background: var(--tertiary);
        opacity: 0.3;
    transition: background 0.15s, opacity 0.15s;
}

.split-content__handle:hover .split-content__handle-bar,
.split-content--dragging .split-content__handle-bar {    
    opacity: 1;
}

/* --- Tab bar --- */

.split-content__tabs {
    display: flex;
    align-items: center;
    height: 40px;
    min-height: 40px;
    border-bottom: 1px solid var(--secondary);
    background: var(--gray-100);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    user-select: none;
    padding: 0 4px;
}

.split-content__tabs::-webkit-scrollbar {
    display: none;
}

.split-content__tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-foreground);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
    height: 100%;
    box-sizing: border-box;
    border-bottom: 4px solid transparent;
    max-width: 220px;
    min-width: 0;
    background: white;
    margin: 0 2px;
}

.split-content__tab:hover {
    background: var(--secondary-hover);
    color: var(--primary);
}

.split-content__tab--active {
    color: var(--primary);
    border-bottom-color: var(--secondary);
    font-weight: 500;
    background: white;
    cursor: default;
}
.split-content__tab--active:hover {
    background: white;
    color: var(--primary)
}
    
.split-content__tab-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.split-content__tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.split-content__tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    font-size: 1rem;
    padding: 0;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.split-content__tab:hover .split-content__tab-close {
    opacity: 1;
}

.split-content__tab-close:hover {
    background: var(--danger-bg, rgba(192, 57, 43, 0.1));
    color: var(--danger);
}

/* --- Close-all button --- */

.split-content__close-all {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    /* min-width: 18px; */
    height: 24px;
    border: none;
    border-radius: var(--radius-full);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.15s, background 0.15s;
    margin-left: auto;
    flex-shrink: 0;
}

.split-content__close-all:hover {
    color: var(--danger);
    background: var(--danger-bg, rgba(192, 57, 43, 0.1));
}

/* --- Content area --- */

.split-content__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.split-content__pane {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- Wrapper in MainLayout --- */

.split-content-wrapper {
    position: relative;
    flex-shrink: 0;
    height: 100%;    
}

/* --- Drag state on body --- */

.split-content--dragging {
    cursor: col-resize;
}

.split-content--dragging .split-content__body {
    pointer-events: none;
}