/* Split Pane Layout */


.split-view-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* CV Pane */

.cv-pane {
    flex: 1;
    min-width: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fafafa;
    position: relative;
}

.cv-pane .cv-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Editor Pane */

.editor-pane {
    flex: 1;
    min-width: 300px;
    overflow: hidden;
    background: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

.editor-pane .editor-panel {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    box-shadow: none;
    transition: none;
    display: flex;
    flex-direction: column;
}

/* Override editor panel defaults for split-pane mode */

.editor-pane .editor-panel.open {
    right: 0;
}

/* Fullscreen mode */

.split-view-container.fullscreen .divider {
    display: none !important;
}

.split-view-container.fullscreen .cv-pane {
    display: none !important;
}

.split-view-container.fullscreen .editor-pane {
    flex: 1 1 100% !important;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
}

.split-view-container.fullscreen-cv .divider {
    display: none !important;
}

.split-view-container.fullscreen-cv .editor-pane {
    display: none !important;
}

.split-view-container.fullscreen-cv .cv-pane {
    flex: 1 1 100% !important;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
}

/* Divider */

.divider {
    width: 8px;
    background: var(--border-color);
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
    z-index: 100;
}

.divider:hover {
    background: var(--accent-color);
}

.divider.dragging {
    background: var(--accent-color);
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 48px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.divider-handle::before {
    content: '';
    width: 3px;
    height: 24px;
    background: repeating-linear-gradient(
        to bottom,
        var(--text-muted) 0px,
        var(--text-muted) 2px,
        transparent 2px,
        transparent 5px
    );
}

/* Mobile Layout */

@media (max-width: 768px) {
    .split-view-container {
        flex-direction: column;
    }

    .divider {
        display: none;
    }

    .cv-pane {
        width: 100%;
        height: 100vh;
        min-width: 0;
    }

    .editor-pane {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        min-width: 0;
        z-index: 999;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .editor-pane.open {
        transform: translateY(0);
    }

    .editor-pane .editor-panel {
        box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    }
}

/* Desktop: Split-screen always on */

@media (min-width: 769px) {
    .editor-pane {
        flex: 1;
        width: auto;
        min-width: 300px;
    }

    .divider {
        display: block;
    }
}
