/* Estilos para video de fondo y personaje imagen */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    /* Optimización de rendimiento */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.hero-character {
    position: absolute;
    left: 15%;
    bottom: 0;
    width: 260px;
    height: auto;
    z-index: 2;
    transform: translateX(-50%);
}

.hero-character img {
    width: 100%;
    height: auto;
    filter: none;
    /* Efecto de respiración sutil */
    animation: characterBreathe 6s ease-in-out infinite;
    transform-origin: center bottom;
}

/* Animación de respiración para el personaje */
@keyframes characterBreathe {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.003) translateY(-0.5px);
    }
}

/* EFECTO DE MOVIMIENTO PARA LA ESPADA */

/* Contenedor para la espada con llamas */
.hero-character::before {
    content: '';
    position: absolute;
    top: 15%; /* Ajustar según la posición de la espada en tu imagen */
    right: 20%; /* Ajustar según la posición de la espada en tu imagen */
    width: 8px;
    height: 60px;
    background: linear-gradient(to top, 
        transparent 0%,
        rgba(255, 102, 0, 0.3) 20%,
        rgba(255, 140, 0, 0.5) 50%,
        rgba(255, 69, 0, 0.4) 80%,
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(1px);
    animation: swordFlamesDance 3s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
}

/* Efecto adicional de chispas en la espada */
.hero-character::after {
    content: '';
    position: absolute;
    top: 12%;
    right: 18%;
    width: 12px;
    height: 80px;
    background: linear-gradient(to top,
        transparent 0%,
        rgba(255, 215, 0, 0.2) 30%,
        rgba(255, 165, 0, 0.3) 60%,
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(2px);
    animation: swordFlamesDance 2.5s ease-in-out infinite reverse;
    z-index: 2;
    pointer-events: none;
}

/* Animación principal de las llamas de la espada */
@keyframes swordFlamesDance {
    0%, 100% {
        transform: scaleX(1) scaleY(1) rotate(-2deg);
        opacity: 0.6;
    }
    25% {
        transform: scaleX(1.1) scaleY(0.95) rotate(1deg);
        opacity: 0.8;
    }
    50% {
        transform: scaleX(0.9) scaleY(1.1) rotate(-1deg);
        opacity: 0.7;
    }
    75% {
        transform: scaleX(1.05) scaleY(0.98) rotate(2deg);
        opacity: 0.9;
    }
}

/* Efecto de intensificación al hover del personaje */
.hero-character:hover::before {
    animation: swordFlamesDance 1.5s ease-in-out infinite;
    filter: blur(0.5px);
    background: linear-gradient(to top, 
        transparent 0%,
        rgba(255, 102, 0, 0.5) 20%,
        rgba(255, 140, 0, 0.7) 50%,
        rgba(255, 69, 0, 0.6) 80%,
        transparent 100%
    );
}

.hero-character:hover::after {
    animation: swordFlamesDance 1.2s ease-in-out infinite reverse;
    filter: blur(1px);
    background: linear-gradient(to top,
        transparent 0%,
        rgba(255, 215, 0, 0.4) 30%,
        rgba(255, 165, 0, 0.5) 60%,
        transparent 100%
    );
}

/* Fallback para navegadores que no soportan videos */
.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Asegurar que el logo esté por encima - FORZAR POSICIÓN */
.hero-logo {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10 !important;
}

/* Asegurar que el botón de descarga funcione */
.hero-download {
    position: absolute;
    right: 15%; /* Movido más hacia el centro (era 5%) */
    top: 50%;
    transform: translateY(-50%);
    z-index: 15; /* Mayor z-index que el logo */
    width: 220px;
    text-align: center;
    pointer-events: auto; /* Asegurar que sea clickeable */
}

.btn-download {
    display: block;
    width: 220px;
    height: 90px;
    transition: transform 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.btn-download img {
    width: 100%;
    height: auto;
    filter: none;
    transition: transform 0.3s ease;
    pointer-events: none; /* La imagen no debe interceptar clicks */
}

.btn-download:hover {
    transform: scale(1.05);
}

/* EFECTOS DE FUEGO SUTILES PARA CAJAS */

/* Keyframes para el efecto de fuego */
@keyframes fireGlow {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(255, 102, 0, 0.3),
            0 0 10px rgba(255, 102, 0, 0.2),
            0 0 15px rgba(255, 102, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 0 8px rgba(255, 102, 0, 0.4),
            0 0 16px rgba(255, 102, 0, 0.3),
            0 0 24px rgba(255, 102, 0, 0.2);
    }
}

@keyframes fireBorder {
    0%, 100% {
        border-color: rgba(255, 102, 0, 0.5);
    }
    25% {
        border-color: rgba(255, 140, 0, 0.6);
    }
    50% {
        border-color: rgba(255, 69, 0, 0.7);
    }
    75% {
        border-color: rgba(255, 140, 0, 0.6);
    }
}

/* Aplicar efectos de fuego a las cajas principales */
.ranking-box,
.register-form-box,
.login-box,
.communities-box,
.user-profile,
.server-stats-container,
.game-description,
.server-info-box {
    position: relative;
    transition: all 0.3s ease;
    animation: fireGlow 4s ease-in-out infinite;
}

/* Efecto de fuego más intenso al hover */
.ranking-box:hover,
.register-form-box:hover,
.login-box:hover,
.communities-box:hover,
.user-profile:hover,
.server-stats-container:hover,
.game-description:hover,
.server-info-box:hover {
    animation: fireGlow 2s ease-in-out infinite;
    box-shadow: 
        0 0 10px rgba(255, 102, 0, 0.5),
        0 0 20px rgba(255, 102, 0, 0.3),
        0 0 30px rgba(255, 102, 0, 0.2),
        inset 0 0 5px rgba(255, 102, 0, 0.1);
}

/* Efecto de borde animado para estadísticas del servidor */
.server-stats-container .stat-box {
    position: relative;
    overflow: hidden;
}

.server-stats-container .stat-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 102, 0, 0.3), 
        transparent, 
        rgba(255, 140, 0, 0.3)
    );
    z-index: -1;
    animation: fireBorder 3s ease-in-out infinite;
    border-radius: inherit;
}

/* Efecto sutil para botones */
.btn-register-form,
.btn-login,
.user-btn {
    position: relative;
    transition: all 0.3s ease;
}

.btn-register-form:hover,
.btn-login:hover,
.user-btn:hover {
    box-shadow: 
        0 0 8px rgba(255, 102, 0, 0.4),
        0 0 16px rgba(255, 102, 0, 0.2);
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.5);
}

/* Efecto especial para rankings al hover en filas */
.ranking-table tbody tr {
    transition: all 0.3s ease;
}

.ranking-table tbody tr:hover {
    background-color: rgba(255, 102, 0, 0.05);
    box-shadow: inset 0 0 10px rgba(255, 102, 0, 0.1);
}

/* Responsive */
@media (max-width: 992px) {
    .hero-character {
        width: 220px;
        left: 5%;
    }
    
    .hero-download {
        right: 10%; /* Ajustado para pantallas medianas */
        width: 180px;
    }
    
    .btn-download {
        width: 180px;
        height: auto;
    }
    
    /* Reducir intensidad del efecto en móviles */
    .ranking-box,
    .register-form-box,
    .login-box,
    .communities-box,
    .user-profile,
    .server-stats-container,
    .game-description,
    .server-info-box {
        animation: fireGlow 6s ease-in-out infinite;
    }
}

@media (max-width: 768px) {
    .hero-character {
        width: 200px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .hero-download {
        position: static;
        transform: none;
        margin: 15px auto 0;
        width: 160px;
        z-index: 15;
    }
    
    .btn-download {
        width: 160px;
        height: auto;
    }
}

@media (max-width: 576px) {
    .hero-character {
        width: 180px;
    }
    
    .hero-download {
        width: 140px;
    }
    
    .btn-download {
        width: 140px;
    }
}

/* Optimización para dispositivos de baja potencia */
@media (prefers-reduced-motion: reduce) {
    .hero-background {
        /* Pausar video si el usuario prefiere menos movimiento */
        animation-play-state: paused;
    }
    
    /* Desactivar animaciones de fuego si el usuario prefiere menos movimiento */
    .ranking-box,
    .register-form-box,
    .login-box,
    .communities-box,
    .user-profile,
    .server-stats-container,
    .game-description,
    .server-info-box,
    .server-stats-container .stat-box::before {
        animation: none;
    }
    
    /* Desactivar respiración del personaje */
    .hero-character img {
        animation: none;
    }
    
    /* Desactivar efectos de llamas de la espada */
    .hero-character::before,
    .hero-character::after {
        animation: none;
        opacity: 0;
    }
}
