/* ═══ VISOR 3D DE SONDAJE — Modal + Canvas ═══ */

/* Modal overlay */
.modal-3d-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(5, 10, 25, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: modal3dFadeIn 0.25s ease-out;
}

.modal-3d-overlay.active {
    display: flex;
}

@keyframes modal3dFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Layout principal */
.modal-3d-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Panel lateral (leyenda + controles) */
.dh3d-sidebar {
    width: 220px;
    background: rgba(15, 23, 42, 0.85);
    border-right: 1px solid rgba(52, 211, 153, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.dh3d-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(52, 211, 153, 0.15);
}

.dh3d-sidebar-header h3 {
    font-size: 0.85rem;
    font-weight: 800;
    color: #34d399;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dh3d-sidebar-header .dh3d-hole-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: -0.3px;
}

.dh3d-sidebar-header .dh3d-hole-meta {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
}

/* Leyenda de litologías */
.dh3d-legend {
    padding: 12px 16px;
    flex: 1;
}

.dh3d-legend-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 10px;
}

.dh3d-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.75rem;
    color: #e2e8f0;
}

.dh3d-legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.dh3d-legend-code {
    font-weight: 700;
    color: #94a3b8;
    width: 40px;
}

/* Panel 3D (canvas) */
.dh3d-canvas-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.dh3d-canvas-area canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Botón cerrar */
.dh3d-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 9010;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(15, 23, 42, 0.8);
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dh3d-close:hover {
    background: rgba(244, 63, 94, 0.3);
    border-color: rgba(244, 63, 94, 0.5);
    color: #f87171;
}

/* Barra de info inferior */
.dh3d-info-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid rgba(52, 211, 153, 0.15);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 20px;
    font-size: 0.72rem;
    color: #94a3b8;
}

.dh3d-info-bar .info-tag {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dh3d-info-bar .info-tag strong {
    color: #e2e8f0;
}

/* Controles de vista */
.dh3d-controls {
    padding: 12px 16px;
    border-top: 1px solid rgba(52, 211, 153, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dh3d-controls label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
}

.dh3d-btn-reset {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dh3d-btn-reset:hover {
    background: rgba(52, 211, 153, 0.2);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.15);
}

/* Toggle rows de capas */
.dh3d-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    padding: 3px 0;
}

.dh3d-toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #34d399;
    cursor: pointer;
    flex-shrink: 0;
}

.dh3d-toggle-row span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}
@media (max-width: 768px) {
    .dh3d-sidebar {
        width: 160px;
    }
}

/* Botón "Ver en 3D" en el reporte */
.btn-3d {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(139, 92, 246, 0.5) !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.btn-3d:hover {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%) !important;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.45);
    transform: translateY(-1px);
}

.btn-3d i {
    font-size: 1.1rem;
}
