html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}


/* ===============================
      RESETEO GENERAL
=============================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(180deg, 
        rgba(5, 8, 15, 0.98) 0%,
        rgba(10, 16, 32, 0.95) 50%,
        rgba(5, 8, 15, 0.98) 100%
    );
    color: #ffffff;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(30, 144, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(100, 255, 218, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}


/* ===============================
      LAYOUT PRINCIPAL
=============================== */

#app {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
}


/* ===============================
      SIDEBAR ESTILO ESPACIAL
=============================== */

#sidebar {
    width: 340px;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.05) 0%,
        rgba(10, 10, 15, 0.85) 100%
    );
    backdrop-filter: blur(15px);
    border-right: 2px solid transparent;
    border-image: linear-gradient(180deg, 
        rgba(30, 144, 255, 0.3),
        rgba(100, 255, 218, 0.2),
        rgba(30, 144, 255, 0.3)
    ) 1;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
    max-height: 100vh;
    box-shadow: 
        4px 0 20px rgba(30, 144, 255, 0.1),
        inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

#sidebar h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #1e90ff 0%, #64ffda 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

#sidebar h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #1e90ff 0%, #64ffda 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
}

#sidebar p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}


/* ===============================
      BOTONES MODERNOS
=============================== */

#sidebar button {
    padding: 12px 18px;
    background: linear-gradient(135deg, #1e90ff 0%, #0066cc 100%);
    border: 1px solid rgba(30, 144, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(30, 144, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebar button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

#sidebar button:hover {
    background: linear-gradient(135deg, #0066cc 0%, #1e90ff 100%);
    border-color: rgba(30, 144, 255, 0.5);
    box-shadow: 
        0 6px 20px rgba(30, 144, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

#sidebar button:hover::before {
    width: 300px;
    height: 300px;
}

#sidebar button:active {
    transform: translateY(0) scale(0.98);
}


/* ===============================
      PANEL DE INFORMACIÓN
=============================== */

#info {
    padding: 18px;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.06) 0%,
        rgba(10, 10, 15, 0.6) 100%
    );
    border-radius: 12px;
    border: 1px solid rgba(30, 144, 255, 0.25);
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    min-height: 100px;
    max-height: 50vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(30, 144, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

#info:hover {
    border-color: rgba(30, 144, 255, 0.35);
    box-shadow: 
        0 6px 20px rgba(30, 144, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Estilos para el contenido del panel de info */
#info p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.85);
}

#info strong {
    color: #64ffda;
    font-weight: 600;
    font-size: 14px;
}

#info b {
    background: linear-gradient(135deg, #1e90ff 0%, #64ffda 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

#info h3,
#info h4 {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #1e90ff 0%, #64ffda 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    margin-top: 8px;
    font-weight: 600;
}


/* Scroll personalizado */
#info::-webkit-scrollbar,
#sidebar::-webkit-scrollbar,
#custom-form::-webkit-scrollbar {
    width: 8px;
}
#info::-webkit-scrollbar-track,
#sidebar::-webkit-scrollbar-track,
#custom-form::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.5);
    border-radius: 4px;
}
#info::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb,
#custom-form::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e90ff 0%, #64ffda 100%);
    border-radius: 4px;
    border: 1px solid rgba(30, 144, 255, 0.3);
}
#info::-webkit-scrollbar-thumb:hover,
#sidebar::-webkit-scrollbar-thumb:hover,
#custom-form::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64ffda 0%, #1e90ff 100%);
}


/* ===============================
      MAPA
=============================== */

#map {
    flex: 1;
    width: 100%;
    height: 100%;
    background: #000; /* negro hasta que cargan los tiles */
}


/* ===============================
      RESPONSIVE MÓVIL
=============================== */

/* Contenedor del mapa - oculto por defecto en móvil */
#map {
    transition: all 0.4s ease;
}

/* Estados para móvil */
body.mobile-config-mode #sidebar {
    display: flex;
}

body.mobile-config-mode #map {
    display: none;
}

body.mobile-map-mode #sidebar {
    display: none;
}

body.mobile-map-mode #map {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* Botón para volver a la configuración en móvil */
#btn-back-to-config {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e90ff 0%, #0066cc 100%);
    border: 1px solid rgba(30, 144, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 
        0 4px 15px rgba(30, 144, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#btn-back-to-config:hover {
    background: linear-gradient(135deg, #0066cc 0%, #1e90ff 100%);
    box-shadow: 
        0 6px 20px rgba(30, 144, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

body.mobile-map-mode #btn-back-to-config {
    display: block;
}

/* Botón para simular en modo mapa móvil */
#btn-simulate-mobile {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff4757 0%, #d93a3a 100%);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 
        0 4px 15px rgba(255, 71, 87, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#btn-simulate-mobile:hover {
    background: linear-gradient(135deg, #d93a3a 0%, #ff4757 100%);
    box-shadow: 
        0 6px 20px rgba(255, 71, 87, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

body.mobile-map-mode #btn-simulate-mobile {
    display: block;
}

/* Panel de resultados flotante en móvil */
#mobile-results-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.05) 0%,
        rgba(10, 10, 15, 0.95) 100%
    );
    backdrop-filter: blur(15px);
    border-top: 2px solid rgba(30, 144, 255, 0.3);
    padding: 25px 20px 20px 20px;
    max-height: 45vh;
    overflow-y: auto;
    z-index: 999;
    box-shadow: 
        0 -4px 20px rgba(30, 144, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(100%);
    transition: transform 0.4s ease;
    -webkit-overflow-scrolling: touch;
}

#mobile-results-panel.visible {
    transform: translateY(0);
}

#mobile-results-panel .close-results {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

#mobile-results-panel .close-results:hover {
    color: #ff4757;
    transform: scale(1.2);
}

body.mobile-map-mode #mobile-results-panel {
    display: block;
}

#mobile-results-content {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

#mobile-results-content strong {
    color: #64ffda;
    font-weight: 600;
}

#mobile-results-content em {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Media queries para diferentes tamaños */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    #app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    #sidebar {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        border-right: none;
        border-bottom: 2px solid transparent;
        border-image: linear-gradient(90deg, 
            rgba(30, 144, 255, 0.3),
            rgba(100, 255, 218, 0.2),
            rgba(30, 144, 255, 0.3)
        ) 1;
        padding: 20px;
        overflow-y: visible;
        max-height: none;
    }
    
    #sidebar h2 {
        font-size: 24px;
        text-align: center;
    }
    
    #sidebar p {
        text-align: center;
        font-size: 14px;
    }
    
    #map {
        width: 100%;
        height: 60vh;
        min-height: 400px;
    }
    
    #info {
        max-height: 40vh;
        font-size: 13px;
    }
    
    #custom-form {
        font-size: 13px;
    }
    
    #custom-form input,
    #custom-form select {
        font-size: 14px;
        padding: 12px;
    }
    
    #btn-simulate {
        padding: 16px 24px;
        font-size: 16px;
        margin-top: 20px;
    }
    
    #team-logo {
        width: 100px;
    }
    
    /* Asegurar que el mapa sea tocable en móvil */
    #map {
        touch-action: pan-x pan-y;
    }
    
    /* Mejorar el scroll en móvil */
    #info,
    #custom-form.visible,
    #mobile-results-panel {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    #sidebar {
        padding: 15px;
    }
    
    #sidebar h2 {
        font-size: 20px;
    }
    
    #sidebar button {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    #map {
        height: 50vh;
        min-height: 350px;
    }
    
    #team-logo {
        width: 80px;
    }
    
    #btn-back-to-config,
    #btn-simulate-mobile {
        font-size: 12px;
        padding: 10px 16px;
    }
    
    #mobile-results-panel {
        max-height: 50vh;
        font-size: 13px;
    }
}

/*  LOGO CELESTE BLANCA */

.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

#team-logo {
    width: 130px;
    height: auto;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.08) 0%,
        rgba(10, 10, 15, 0.4) 100%
    );
    padding: 10px;
    border: 2px solid rgba(30, 144, 255, 0.3);
    box-shadow: 
        0 4px 20px rgba(30, 144, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

#team-logo:hover {
    transform: scale(1.08) rotate(5deg);
    border-color: rgba(100, 255, 218, 0.5);
    box-shadow: 
        0 6px 30px rgba(30, 144, 255, 0.5),
        0 0 40px rgba(100, 255, 218, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

/* SELECTOR DE IDIOMAS */

.lang-switcher {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.lang-switcher select {
    padding: 8px 12px;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.08) 0%,
        rgba(10, 10, 15, 0.6) 100%
    );
    border: 1px solid rgba(30, 144, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(30, 144, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    outline: none;
}

.lang-switcher select:hover {
    border-color: rgba(30, 144, 255, 0.5);
    box-shadow: 
        0 6px 20px rgba(30, 144, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lang-switcher select:focus {
    border-color: rgba(100, 255, 218, 0.5);
    box-shadow: 
        0 6px 25px rgba(100, 255, 218, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.lang-switcher select option {
    background: rgba(10, 10, 15, 0.98);
    color: #fff;
    padding: 10px;
}

/* FORMULARIO DE METEORITO PERSONALIZADO */

#custom-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.04) 0%,
        rgba(10, 10, 15, 0.6) 100%
    );
    border: 1px solid rgba(30, 144, 255, 0.2);
    padding: 0;
    border-radius: 12px;
    margin-top: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(30, 144, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    
    /* Estado inicial: oculto */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    
    /* Transición suave */
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
}

#custom-form.visible {
    max-height: 600px;
    opacity: 1;
    padding: 18px;
    overflow-y: auto;
    pointer-events: auto;
}

#custom-form input,
#custom-form select {
    padding: 10px 12px;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.05) 0%,
        rgba(10, 10, 15, 0.5) 100%
    );
    border: 1px solid rgba(30, 144, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#custom-form input:focus,
#custom-form select:focus {
    outline: none;
    border-color: rgba(30, 144, 255, 0.5);
    box-shadow: 
        0 0 15px rgba(30, 144, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#custom-form label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3px;
}



/* Boton del simulador */
#btn-simulate {
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff4757 0%, #d93a3a 100%);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 10px;
    cursor: pointer;
    color: white;
    font-weight: 700;
    font-size: 15px;
    margin-top: 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(255, 71, 87, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-simulate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

#btn-simulate:hover {
    background: linear-gradient(135deg, #d93a3a 0%, #ff4757 100%);
    border-color: rgba(255, 71, 87, 0.5);
    box-shadow: 
        0 6px 25px rgba(255, 71, 87, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

#btn-simulate:hover::before {
    width: 300px;
    height: 300px;
}

#btn-simulate:active {
    transform: translateY(0) scale(0.98);
}

#select-real {
    padding: 12px 14px;
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.08) 0%,
        rgba(10, 10, 15, 0.6) 100%
    );
    border: 1px solid rgba(30, 144, 255, 0.3);
    color: #fff;
    border-radius: 10px;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(30, 144, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#select-real option {
    background: rgba(10, 10, 15, 0.98);
    color: #fff;
    padding: 10px;
    font-size: 14px;
}

#select-real option:hover,
#select-real option:checked {
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.3) 0%,
        rgba(10, 10, 15, 0.9) 100%
    );
    color: #64ffda;
}

#select-real:hover {
    border-color: rgba(30, 144, 255, 0.5);
    box-shadow: 
        0 6px 20px rgba(30, 144, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#select-real:focus {
    outline: none;
    border-color: rgba(100, 255, 218, 0.5);
    box-shadow: 
        0 6px 25px rgba(100, 255, 218, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#select-real.hidden {
    display: none;
}