/**
 * GPR Viewer - 3D Split View Styles
 * Styles pour la visualisation 3D en mode split (2D | 3D)
 */

/* =============================================
   SPLIT VIEW CONTAINER
   ============================================= */

.split-view-container {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

/* Override le radargram-panel quand il est dans le split-view */
.split-view-container > .radargram-panel {
    flex: 1;
    min-width: 200px;
}

.split-view-container.split-active > .radargram-panel {
    flex: none;
    /* La largeur sera définie par JS via style.width */
}

/* Canvas 3D - remplit le conteneur */
#gpr3dCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* =============================================
   SPLIT VIEW - SEPARATEUR
   ============================================= */

.split-handle-3d {
    width: 6px;
    background: var(--border);
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}

.split-handle-3d:hover,
.split-handle-3d.dragging {
    background: var(--primary);
}

.split-handle-3d::after {
    content: '\22EE'; /* ⋮ */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 12px;
}

.split-handle-3d:hover::after {
    color: #fff;
}

/* =============================================
   CONTENEUR 3D
   ============================================= */

.canvas-3d-wrapper {
    flex: 1;
    background: #0a0a0a;
    position: relative;
    min-width: 200px;
    display: none;
}

.canvas-3d-wrapper.visible {
    display: block;
}

/* =============================================
   CONTROLES 3D (overlay)
   ============================================= */

.gpr3d-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 10;
    max-width: calc(100% - 20px);
}

.gpr3d-controls button {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
    transition: all 0.15s;
}

.gpr3d-controls button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--primary);
}

.gpr3d-controls button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* =============================================
   PANNEAU DE COUPES
   ============================================= */

.gpr3d-slices-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    width: 200px;
    z-index: 10;
    display: none;
}

.gpr3d-slices-panel.visible {
    display: block;
}

.gpr3d-slices-panel h4 {
    font-size: 12px;
    margin-bottom: 10px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gpr3d-slice-control {
    margin-bottom: 10px;
}

.gpr3d-slice-control:last-child {
    margin-bottom: 0;
}

.gpr3d-slice-control label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-bottom: 4px;
    color: var(--text-muted);
    cursor: pointer;
}

.gpr3d-slice-control label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.gpr3d-slice-control input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 4px;
}

.gpr3d-slice-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.gpr3d-slice-control input[type="range"]:disabled {
    opacity: 0.4;
}

.gpr3d-slice-control .value {
    font-size: 10px;
    color: var(--text);
    text-align: right;
    font-family: monospace;
    margin-top: 2px;
}

/* Couleurs par axe */
.gpr3d-slice-control[data-axis="x"] label span { color: #e74c3c; }
.gpr3d-slice-control[data-axis="y"] label span { color: #2ecc71; }
.gpr3d-slice-control[data-axis="z"] label span { color: #3498db; }

/* =============================================
   COORDONNEES 3D
   ============================================= */

.gpr3d-coords {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    color: var(--text-muted);
    z-index: 10;
}

/* =============================================
   WIZARD (MODAL CONFIG GRILLE)
   ============================================= */

.gpr3d-wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9500;
    display: none;
    align-items: center;
    justify-content: center;
}

.gpr3d-wizard-overlay.active {
    display: flex;
}

.gpr3d-wizard {
    background: var(--bg-panel);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gpr3d-wizard-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gpr3d-wizard-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.gpr3d-wizard-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.gpr3d-wizard-close:hover {
    color: var(--text);
}

/* Steps indicator */
.gpr3d-wizard-steps {
    display: flex;
    padding: 12px 20px;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

.gpr3d-wizard-step {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.gpr3d-wizard-step.active {
    background: var(--primary);
    color: #fff;
}

.gpr3d-wizard-step.completed {
    background: var(--success);
    color: #fff;
}

.gpr3d-wizard-step-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.gpr3d-wizard-step-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Wizard content */
.gpr3d-wizard-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.gpr3d-wizard-page {
    display: none;
}

.gpr3d-wizard-page.active {
    display: block;
}

.gpr3d-wizard-page h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text);
}

.gpr3d-wizard-page p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

/* Wizard cards (type selection) */
.gpr3d-wizard-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.gpr3d-wizard-card {
    flex: 1;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.gpr3d-wizard-card:hover {
    background: rgba(74, 144, 217, 0.1);
    border-color: rgba(74, 144, 217, 0.5);
}

.gpr3d-wizard-card.selected {
    background: rgba(74, 144, 217, 0.15);
    border-color: var(--accent);
}

.gpr3d-wizard-card-icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.gpr3d-wizard-card.selected .gpr3d-wizard-card-icon {
    opacity: 1;
}

.gpr3d-wizard-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.gpr3d-wizard-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.gpr3d-wizard-separator {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* Wizard grid columns (mode Grille) */
.gpr3d-wizard-grid-columns {
    display: flex;
    gap: 16px;
    height: 350px;
}

.gpr3d-wizard-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.gpr3d-wizard-column-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
}

.gpr3d-wizard-column-header.horizontal {
    background: rgba(46, 204, 113, 0.15);
    border-bottom: 2px solid #2ecc71;
    color: #2ecc71;
}

.gpr3d-wizard-column-header.vertical {
    background: rgba(230, 126, 34, 0.15);
    border-bottom: 2px solid #e67e22;
    color: #e67e22;
}

.gpr3d-wizard-column-icon {
    font-size: 16px;
    font-weight: bold;
}

.gpr3d-wizard-column-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.gpr3d-wizard-column .gpr3d-wizard-files {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.gpr3d-wizard-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* File item in grid mode */
.gpr3d-wizard-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 6px;
    transition: background 0.15s;
}

.gpr3d-wizard-file:hover {
    background: rgba(0, 0, 0, 0.35);
}

.gpr3d-wizard-file-actions,
.gpr3d-wizard-file-actions-left {
    display: flex;
    gap: 4px;
}

.gpr3d-wizard-file-actions-left {
    margin-right: 4px;
}

.gpr3d-file-move-btn,
.gpr3d-file-transfer-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
}

.gpr3d-file-move-btn:hover {
    background: rgba(74, 144, 217, 0.3);
    border-color: var(--accent);
    color: var(--text);
}

.gpr3d-file-transfer-btn {
    background: rgba(74, 144, 217, 0.2);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: bold;
}

.gpr3d-file-transfer-btn:hover {
    background: var(--accent);
    color: white;
}

/* Wizard form */
.gpr3d-wizard-field {
    margin-bottom: 14px;
}

.gpr3d-wizard-field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.gpr3d-wizard-field input,
.gpr3d-wizard-field select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
}

.gpr3d-wizard-field input:focus,
.gpr3d-wizard-field select:focus {
    outline: none;
    border-color: var(--primary);
}

.gpr3d-wizard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* File list */
.gpr3d-wizard-files {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.gpr3d-wizard-file {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gpr3d-wizard-file:last-child {
    border-bottom: none;
}

.gpr3d-wizard-file input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gpr3d-wizard-file-name {
    flex: 1;
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gpr3d-wizard-file-order {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.gpr3d-wizard-file-move {
    display: flex;
    gap: 4px;
}

.gpr3d-wizard-file-move button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
}

.gpr3d-wizard-file-move button:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

/* Preview canvas */
.gpr3d-wizard-preview {
    width: 100%;
    height: 180px;
    background: #111;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-top: 12px;
}

.gpr3d-wizard-preview canvas {
    width: 100%;
    height: 100%;
}

/* Wizard footer */
.gpr3d-wizard-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gpr3d-wizard-footer-left {
    color: var(--text-muted);
    font-size: 12px;
}

.gpr3d-wizard-footer-right {
    display: flex;
    gap: 8px;
}

/* =============================================
   WIZARD - BANNIERE DZX DETECTE
   ============================================= */

.gpr3d-wizard-dzx-banner {
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.15), rgba(46, 160, 67, 0.08));
    border: 1px solid rgba(46, 160, 67, 0.4);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: dzxBannerSlide 0.3s ease;
}

@keyframes dzxBannerSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gpr3d-wizard-dzx-banner span {
    color: #2ea043;
    font-size: 13px;
    font-weight: 500;
}

.gpr3d-wizard-dzx-goto {
    background: rgba(46, 160, 67, 0.2);
    border: 1px solid rgba(46, 160, 67, 0.5);
    color: #2ea043;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.gpr3d-wizard-dzx-goto:hover {
    background: rgba(46, 160, 67, 0.35);
    border-color: #2ea043;
}

/* =============================================
   EXPORT MODAL
   ============================================= */

.gpr3d-export-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9600;
    display: none;
    align-items: center;
    justify-content: center;
}

.gpr3d-export-modal.active {
    display: flex;
}

.gpr3d-export-content {
    background: var(--bg-panel);
    border-radius: 12px;
    width: 380px;
    max-width: 90%;
    padding: 24px;
}

.gpr3d-export-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gpr3d-export-section {
    margin-bottom: 16px;
}

.gpr3d-export-section-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gpr3d-export-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gpr3d-export-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.gpr3d-export-option:hover {
    background: rgba(0, 0, 0, 0.3);
}

.gpr3d-export-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.gpr3d-export-option label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
}

.gpr3d-export-radio-group {
    display: flex;
    gap: 16px;
}

.gpr3d-export-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.gpr3d-export-radio input {
    width: 16px;
    height: 16px;
}

.gpr3d-export-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* =============================================
   BOUTONS GENERIQUES 3D
   ============================================= */

.gpr3d-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-height: 36px;
    background: linear-gradient(to bottom, #404040, #333);
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    color: #ddd;
    font-size: 13px;
    transition: all 0.15s;
}

.gpr3d-btn:hover {
    background: linear-gradient(to bottom, #4a4a4a, #3a3a3a);
    border-color: #666;
}

.gpr3d-btn:active {
    transform: scale(0.98);
}

.gpr3d-btn.active,
.gpr3d-btn.primary {
    background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: #fff;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
    /* Split view vertical sur mobile */
    .split-view-container {
        flex-direction: column;
    }

    .split-view-container .radargram-panel {
        min-height: 200px;
        min-width: unset;
    }

    .split-handle-3d {
        width: 100%;
        height: 6px;
        cursor: row-resize;
    }

    .split-handle-3d::after {
        content: '\22EF'; /* ⋯ */
    }

    .canvas-3d-wrapper {
        min-height: 200px;
        min-width: unset;
    }

    .gpr3d-wizard {
        width: 95%;
        max-height: 90vh;
    }

    .gpr3d-wizard-steps {
        flex-wrap: nowrap;
    }

    .gpr3d-wizard-step-name {
        display: none;
    }

    .gpr3d-controls {
        flex-wrap: wrap;
    }

    .gpr3d-controls button {
        padding: 4px 8px;
        font-size: 10px;
    }

    .gpr3d-slices-panel {
        width: 160px;
        padding: 10px;
    }
}
