/* Estilos globales */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    font-family: sans-serif;
}

/* Encabezado */
#header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #ff6b35;
}

#header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
}

/* Contenedor principal */
#main-container {
    display: flex;
    height: calc(100% - 70px);
    width: 100%;
}

/* Mapa */
#map {
    flex: 1;
    height: 100%;
    background: #1a1a1a;
}

/* Caja de información */
#info-box {
    width: 300px;
    background: white;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3);
    padding: 20px;
    overflow-y: auto;
    font-size: 13px;
    border-right: 2px solid #ff6b35;
}

#info-box h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 10px;
}

#info-box h4 {
    color: #2c3e50;
    font-size: 14px;
    margin: 15px 0 10px 0;
    border-bottom: 2px solid #ff6b35;
    padding-bottom: 5px;
}

/* Listado de batallas */
#batallasList {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

#batallasListado {
    list-style: none;
    padding: 0;
    margin: 0;
}

#batallasListado li {
    padding: 8px;
    margin: 5px 0;
    background: #f5f5f5;
    border-left: 3px solid #ff6b35;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#batallasListado li:hover {
    background: #ff6b35;
    color: white;
    transform: translateX(5px);
}

#batallasListado li.active {
    background: #ff6b35;
    color: white;
    font-weight: bold;
}

/* Estilos de estado */
#status {
    color: #666;
    margin: 5px 0;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 3px;
}

.error {
    color: #d00;
    background: #ffe6e6;
}

.success {
    color: #0a0;
    background: #e6ffe6;
}

/* Responsivo */
@media (max-width: 768px) {
    #main-container {
        flex-direction: column-reverse;
    }
    
    #info-box {
        width: 100%;
        height: auto;
        max-height: 250px;
        border-right: none;
        border-bottom: 2px solid #ff6b35;
    }
    
    #map {
        flex: 1;
        min-height: 300px;
    }
    
    #header h1 {
        font-size: 20px;
    }
}

/* ====================== SPLASH SCREEN ====================== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.6s ease-out 2.5s forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        visibility: visible;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.splash-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    width: 100%;
    height: 100%;
}

/* Animación de espadas */
.swords-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0 0 20px 0;
    font-size: 48px;
}

.sword.left {
    animation: swordSlashLeft 1.5s ease-in-out infinite;
    transform-origin: center;
}

.sword.right {
    animation: swordSlashRight 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes swordSlashLeft {
    0% {
        transform: rotate(0deg) translateX(0);
        opacity: 0.6;
    }
    50% {
        transform: rotate(-45deg) translateX(-15px);
        opacity: 1;
    }
    100% {
        transform: rotate(0deg) translateX(0);
        opacity: 0.6;
    }
}

@keyframes swordSlashRight {
    0% {
        transform: rotate(0deg) translateX(0);
        opacity: 0.6;
    }
    50% {
        transform: rotate(45deg) translateX(15px);
        opacity: 1;
    }
    100% {
        transform: rotate(0deg) translateX(0);
        opacity: 0.6;
    }
}

.splash-title {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Barra de carga */
.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 30px auto 0;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35 0%, #ffa500 100%);
    width: 30%;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% {
        width: 10%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 90%;
    }
}

/* ====================== LOADER EN PANEL ====================== */
#loader-panel {
    padding: 30px 0;
    text-align: center;
    margin: 20px 0;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.swords-mini {
    font-size: 36px;
    animation: swordFlash 1s ease-in-out infinite;
}

@keyframes swordFlash {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2) rotate(-10deg);
        opacity: 1;
    }
}

.loader-text {
    font-size: 12px;
    color: #ff6b35;
    font-weight: bold;
    margin: 0;
    letter-spacing: 1px;
    animation: textBlink 1s ease-in-out infinite;
}

@keyframes textBlink {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}
