* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: #1a1a2e;
    color: #ecf0f1;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#ui-container {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 350px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    pointer-events: auto;
    z-index: 100;
}

#info-panel.visible {
    transform: translateX(0);
}

#controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    padding: 15px 25px;
    border-radius: 15px;
    color: white;
    text-align: center;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    font-size: 16px;
    transition: opacity 0.3s ease;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0c0c1d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    z-index: 1000;
    transition: opacity 0.8s ease;
}

.stand-info h3 {
    margin-top: 0;
    color: #00abe6;
    border-bottom: 2px solid #00abe6;
    padding-bottom: 12px;
    margin-bottom: 18px;
    font-size: 24px;
}

.stand-info p {
    line-height: 1.6;
    font-size: 16px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 26px;
    color: #e74c3c;
    background: rgba(0, 0, 0, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.progress-bar {
    width: 320px;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin-top: 25px;
    overflow: hidden;
    /* Centrado horizontal */
    margin-left: auto;
    margin-right: auto;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, #3498db, #2ecc71, #3498db);
    width: 0%;
    transition: width 0.7s ease;
    background-size: 200% 100%;
    animation: gradientMove 3s infinite linear;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}



/* Cuando la pantalla de instrucciones está visible, ocultar cursor personalizado */
#instructions.visible ~ #fixed-pointer,
#instructions:not([style*="display: none"]) ~ #fixed-pointer {
    display: none !important;
}

/* Mostrar cursor normal en la pantalla de bienvenida */
#instructions {
    cursor: default;
}

/* Cursor pointer para el botón */
#close-instructions {
    cursor: pointer;
}




#instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.92);
    padding: 35px;
    border-radius: 18px;
    text-align: center;
    max-width: 550px;
    width: 85%;
    z-index: 20;
    pointer-events: auto;
    border: 2px solid rgba(52, 152, 219, 0.4);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    display: none;
    
}

#instructions h2 {
    margin-bottom: 25px;
    color: #00abe6;
    font-size: 32px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#instructions p {
    margin-bottom: 18px;
    line-height: 1.7;
    font-size: 18px;
}

#instructions kbd {
    background: #34495e;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#close-instructions {
    background: #3498db;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s;
    font-size: 18px;
    font-weight: 600;
}

#close-instructions:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.notification {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 18px;
    border-radius: 10px;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    pointer-events: auto;
    border-left: 5px solid #2ecc71;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    max-width: 350px;
}

.notification.visible {
    transform: translateX(0);
}

#compass {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 11;
}

.loading-dots:after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.model-loading {
    color: #3498db;
    font-size: 14px;
    margin-top: 10px;
}



/* Para cuando el puntero está sobre objeto interactivo */
#fixed-pointer.highlight {
    transform: translate(-50%, -50%) scale(1.3) !important;
    filter: brightness(2) drop-shadow(0 0 12px #00ff00) !important;
}



/* Estilos para el PDF Viewer */
#pdf-viewer {
    transition: opacity 0.3s ease;
}

#pdf-viewer button:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

#pdf-viewer button:disabled:hover {
    background: #bdc3c7 !important;
    transform: none !important;
}

/* Asegurar que el PDF viewer esté sobre todo */
#pdf-viewer {
    z-index: 10000 !important;
}



/* 📱 ESTILOS PARA MÓVILES - FASE 1 */
@media (max-width: 768px) {
    /* Ocultar controles de escritorio */
    #controls {
        display: none !important;
    }
    
    /* Ajustar notificaciones */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 14px;
        padding: 12px;
    }
    
    /* Panel de información más grande */
    #info-panel {
        max-width: 90%;
        left: 5%;
        top: 10px;
        font-size: 14px;
    }
    
    #info-panel h3 {
        font-size: 18px;
    }
    
    /* Instrucciones más legibles */
    #instructions {
        padding: 20px;
        max-width: 90%;
    }
    
    #instructions h2 {
        font-size: 24px;
    }
    
    #instructions p {
        font-size: 16px;
    }
    
    /* Loading screen ajustada */
    #loading h2 {
        font-size: 20px;
    }
    
    .progress-bar {
        width: 250px;
    }
}

/* Controles móviles - siempre visibles en móvil */
#mobile-controls-overlay {
    display: none;
}

@media (max-width: 768px) {
    #mobile-controls-overlay {
        display: flex;
    }
}

/* Evitar zoom en inputs en iOS */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px; /* Previene zoom en iOS */
    }
}

/* Mejorar áreas táctiles */
@media (max-width: 768px) {
    button, .close-btn, [onclick] {
        min-height: 44px;
        min-width: 44px;
    }
    
    .close-btn {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}

/* 📱 CONTROLES MÓVILES MEJORADOS */
#mobile-controls-overlay {
    display: none;
}

@media (max-width: 768px) {
    #mobile-controls-overlay {
        display: flex;
    }
    
    /* Joystick más visible */
    #joystick-knob {
        background: rgba(52, 152, 219, 0.9) !important;
        border: 2px solid white !important;
    }
    
    /* Botones más grandes en móviles pequeños */
    @media (max-width: 480px) {
        #mobile-controls-overlay .joystick-area {
            width: 100px !important;
            height: 100px !important;
        }
        
        .mobile-action-btn {
            width: 60px !important;
            height: 60px !important;
            font-size: 20px !important;
        }
    }
    
    /* Indicador de área táctil para rotación */
    #mobile-controls-overlay::before {
        content: '';
        position: absolute;
        top: 0;
        left: 30%;
        width: 40%;
        height: 100%;
        /* border: 1px dashed rgba(255,255,255,0.2); */
        pointer-events: none;
    }
}

/* 📱 CONTROLES MÓVILES - VISIBLES Y FUNCIONALES */
#mobile-controls-overlay {
    display: none;
}

@media (max-width: 768px) {
    #mobile-controls-overlay {
        display: flex !important;
    }
    
    /* Ocultar controles de escritorio en móvil */
    #controls {
        display: none !important;
    }
    
    /* Joystick más visible */
    #joystick-knob {
        background: rgba(52, 152, 219, 0.9) !important;
        border: 2px solid white !important;
        box-shadow: 0 0 10px rgba(255,255,255,0.5);
    }
    
    /* Feedback visual cuando se toca */
    #mobile-controls-overlay .joystick-area:active {
        background: rgba(255,255,255,0.1) !important;
    }
}

/* Indicar que la app está cargada en móvil */
.mobile-loaded::after {
    content: "📱 Móvil";
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
}

/* Responsive para página móvil */
#mobile-static-page {
    font-family: 'Arial', sans-serif;
}

#mobile-static-page button:hover {
    background: #c0392b !important;
}

/* Ajustes para tablets */
@media (max-width: 1024px) {
    #mobile-static-page {
        padding: 10px;
    }
}

/* Ajustes para móviles pequeños */
@media (max-width: 480px) {
    #mobile-static-page h1 {
        font-size: 1.5rem !important;
    }
    
    #mobile-static-page .event-card {
        padding: 15px !important;
    }
}