/**
 * 3D Scene Builder Pro - Styles
 * Versión 2.0 - Modos Unificados
 */

/* ===================================
   MODO CONTENEDOR
   =================================== */
.tdsbp-scene-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: #1a1a1a;
}

/* ===================================
   MODO FONDO ABSOLUTO
   =================================== */
.tdsbp-background-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

/* Canvas */
.tdsbp-scene-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===================================
   LOADING SCREEN
   =================================== */
.tdsbp-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(26, 26, 26, 0.9);
    z-index: 10;
    transition: opacity 0.3s ease;
}

/* Loading para modo fondo */
.tdsbp-background-scene .tdsbp-loading {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

/* Spinner animado */
.tdsbp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tdsbp-spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Texto de loading */
.tdsbp-loading-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    margin: 10px 0;
    text-align: center;
}

/* Barra de progreso */
.tdsbp-progress-bar-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.tdsbp-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a9eff 0%, #6eb6ff 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

/* Texto de progreso (opcional, oculto por defecto) */
.tdsbp-loading-progress {
    color: #aaaaaa;
    font-size: 12px;
    margin: 8px 0 0 0;
    display: none; /* Oculto por defecto, se puede mostrar si se prefiere */
}

/* ===================================
   ERROR STATE
   =================================== */
.tdsbp-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ff4444;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    max-width: 90%;
    z-index: 20;
}

.tdsbp-error p {
    margin: 10px 0;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .tdsbp-scene-container {
        height: 400px;
    }
    
    .tdsbp-spinner {
        width: 40px;
        height: 40px;
    }
    
    .tdsbp-loading-text {
        font-size: 14px;
    }
    
    .tdsbp-progress-bar-container {
        width: 150px;
    }
    
    .tdsbp-loading-progress {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .tdsbp-scene-container {
        height: 300px;
    }
    
    .tdsbp-spinner {
        width: 35px;
        height: 35px;
        border-width: 3px;
    }
    
    .tdsbp-progress-bar-container {
        width: 120px;
        height: 3px;
    }
}

/* ===================================
   ELEMENTOR EDITOR MODE
   =================================== */
.elementor-editor-active .tdsbp-scene-container,
.elementor-editor-active .tdsbp-background-scene {
    min-height: 300px;
}

.elementor-editor-active .tdsbp-background-scene {
    position: relative;
    height: 500px;
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */
.tdsbp-scene-canvas {
    will-change: transform;
    transform: translateZ(0);
}

/* GPU acceleration para modo fondo */
.tdsbp-background-scene {
    will-change: contents;
    transform: translateZ(0);
}

/* ===================================
   ACCESSIBILITY
   =================================== */
@media (prefers-reduced-motion: reduce) {
    .tdsbp-spinner {
        animation: none;
    }
    
    .tdsbp-loading {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tdsbp-loading {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .tdsbp-loading-text {
        font-weight: 600;
    }
    
    .tdsbp-spinner {
        border-width: 5px;
    }
}

/* ===================================
   DARK MODE SUPPORT
   =================================== */
@media (prefers-color-scheme: dark) {
    .tdsbp-scene-container {
        background: #0a0a0a;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.tdsbp-no-pointer-events {
    pointer-events: none;
}

.tdsbp-full-height {
    height: 100vh;
}

.tdsbp-relative {
    position: relative;
}

.tdsbp-fixed {
    position: fixed;
}

/* ===================================
   Z-INDEX MANAGEMENT
   =================================== */
/* 
   Estos valores pueden ser sobrescritos por los ajustes
   de Z-index en el panel de Elementor
*/
.tdsbp-background-scene[style*="z-index"] {
    /* Z-index controlado por inline styles desde Elementor */
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .tdsbp-background-scene {
        display: none !important;
    }
    
    .tdsbp-scene-container {
        page-break-inside: avoid;
    }
}

