/* ==========================================================================
   Room Maker - Elegant & Sober 3D Scene Loader
   Design pulito, sobrio, moderno (Sfondo chiaro/neutro con glassmorphism)
   ========================================================================== */

.editor-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.loader-content {
    position: relative;
    text-align: center;
    z-index: 1;
    max-width: 380px;
    padding: 24px;
}

/* ==========================================================================
   Minimalist 3D Wireframe Cube
   ========================================================================== */

.loader-cube {
    width: 48px;
    height: 48px;
    margin: 0 auto 28px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 7s infinite linear;
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.cube-face {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 1.5px solid rgba(234, 88, 12, 0.75);
    background: rgba(234, 88, 12, 0.03);
    box-sizing: border-box;
}

.cube-front  { transform: translateZ(24px); }
.cube-back   { transform: translateZ(-24px) rotateY(180deg); }
.cube-right  { transform: rotateY(90deg) translateZ(24px); }
.cube-left   { transform: rotateY(-90deg) translateZ(24px); }
.cube-top    { transform: rotateX(90deg) translateZ(24px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(24px); }

/* Remove old heavy grid scanlines */
.loader-grid {
    display: none;
}

/* ==========================================================================
   Loading Typography & Progress Bar
   ========================================================================== */

.loader-text {
    position: relative;
    z-index: 2;
}

.loader-text h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

.loader-progress {
    max-width: 240px;
    margin: 0 auto 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
    border-radius: 9999px;
    width: 0%;
    transition: width 0.25s ease;
}

.loader-status {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.01em;
}

/* Fade out animation */
.editor-loader.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ==========================================================================
   Dark Theme Variant
   ========================================================================== */

body.dark-theme .editor-loader,
body[data-theme="dark"] .editor-loader {
    background: rgba(15, 23, 42, 0.95);
}

body.dark-theme .editor-loader .loader-text h3,
body[data-theme="dark"] .editor-loader .loader-text h3 {
    color: #f8fafc;
}

body.dark-theme .editor-loader .progress-bar,
body[data-theme="dark"] .editor-loader .progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .editor-loader .loader-status,
body[data-theme="dark"] .editor-loader .loader-status {
    color: #94a3b8;
}

body.dark-theme .editor-loader .cube-face,
body[data-theme="dark"] .editor-loader .cube-face {
    border-color: rgba(249, 115, 22, 0.8);
    background: rgba(249, 115, 22, 0.06);
}
