/* =========================================
   VARIABLES GLOBALES Y RESET
   ========================================= */
:root {
    --primary: #004d40;      /* Verde mundialista */
    --primary-light: #00695c;
    --accent: #d4af37;       /* Dorado trofeo */
    --accent-hover: #f1c40f;
    --dark: #121212;         /* Fondo profundo */
    --card-bg: #1e1e1e;      /* Fondo de tarjetas */
    --input-bg: #2a2a2a;     /* Fondo de casillas */
    --white: #ffffff;
    --gray: #888888;
    --error: #ff4d4d;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--dark);
    color: var(--white);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px 40px 20px; /* Espacio para navbar fija */
}

/* =========================================
   NAVEGACIÓN (NAVBAR)
   ========================================= */
.navbar {
    background: var(--primary);
    padding: 0 15px;
    position: fixed;
    top: 0;
    width: 100%;
    height: 65px;
    border-bottom: 2px solid var(--accent);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: bold;
    color: var(--accent) !important;
    text-decoration: none;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
}

.user-name {
    color: var(--gray);
    font-size: 0.85rem;
    margin-right: 10px;
}

/* =========================================
   TARJETAS DE APUESTAS (PRONOSTICAR)
   ========================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1100px;
    margin-top: 30px;
}

.partido-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #333;
    position: relative;
    transition: var(--transition);
    overflow: hidden;
}

.partido-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.fecha-header {
    text-align: center;
    color: var(--gray);
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.marcador-body {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 15px;
}

.equipo-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.equipo-input-group label {
    font-weight: bold;
    color: var(--white);
    margin-bottom: 10px;
    text-align: center;
    height: 2.4em; /* Alineación perfecta de inputs */
    display: flex;
    align-items: center;
}

.equipo-input-group input {
    width: 70px;
    height: 55px;
    background: var(--input-bg);
    border: 2px solid #444;
    border-radius: 12px;
    color: var(--accent);
    text-align: center;
    font-size: 1.6rem;
    font-weight: bold;
    transition: var(--transition);
}

.equipo-input-group input:focus {
    border-color: var(--accent);
    outline: none;
    background: #333;
}

.vs-label, .vs-badge, .vs-divider {
    color: var(--gray);
    font-weight: 900;
    font-size: 0.9rem;
    margin-top: 25px;
}

/* =========================================
   RANKING Y TABLAS (CORRECCIÓN DE VISIBILIDAD)
   ========================================= */
.table-container, .card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border-top: 5px solid var(--accent);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px; /* Espacio entre filas para evitar solapamiento */
}

th {
    color: var(--accent);
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-align: center;
}

td {
    background: rgba(40, 40, 40, 0.6); /* Fondo semi-transparente para no tapar contenido */
    padding: 15px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--white) !important; /* Fuerza el color blanco del texto */
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

/* Bordes redondeados y limpieza de bordes laterales */
td:first-child { 
    border-radius: 15px 0 0 15px; 
    border-left: 1px solid #333;
}
td:last-child { 
    border-radius: 0 15px 15px 0; 
    border-right: 1px solid #333;
}

/* Resaltar al líder sin tapar sus puntos */
tr:first-child td {
    background: linear-gradient(90deg, #3d3311, #2a2a2a) !important;
    color: var(--accent) !important;
    font-weight: bold;
    border-color: var(--accent);
}

/* =========================================
   BOTONES
   ========================================= */
.btn-save, .btn-guardar, .btn-logout, button {
    background: linear-gradient(135deg, var(--accent), #b8860b);
    color: #000 !important;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
}

button:hover, .btn-save:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.btn-logout {
    background: #444;
    color: white !important;
    padding: 8px 15px;
    font-size: 0.75rem;
}

/* =========================================
   MIS APUESTAS Y PERFIL
   ========================================= */
.partido-resumen {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #333;
}

.puntos-badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.puntos-total { background: var(--accent); color: black; }
.puntos-parcial { background: var(--primary); color: white; }

/* =========================================
   UTILIDADES
   ========================================= */
.locked {
    opacity: 0.5;
    pointer-events: none;
}

.lock-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--error);
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: bold;
}

h1.main-title {
    color: var(--accent);
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.deadline-info {
    color: var(--gray);
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 30px;
}
/* Efecto de Brillo Dorado al escribir */
.equipo-input-group input:focus {
    border-color: var(--accent);
    background: #333;
    outline: none;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5); /* Brillo dorado suave */
    transform: scale(1.05); /* Crece ligeramente al seleccionar */
}

/* Mejora de espaciado para el contenedor principal */
.container {
    width: 95%;
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 50px;
}
.alert-success {
    background-color: #004d40; /* Tu verde primario */
    color: #ffffff;
    padding: 15px 25px;
    border-radius: 10px;
    border-left: 5px solid var(--accent); /* Borde dorado */
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: opacity 0.5s ease;
    width: 100%;
    max-width: 500px;
}

/* Estilos específicos para la página de Login */
.login-page {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #004d40 0%, #121212 100%);
    padding: 0;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px); /* Efecto cristalizado */
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    text-align: center;
}

.login-header .logo-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.login-header h1 {
    color: var(--accent);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.login-header p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 8px;
    margin-left: 5px;
}

.input-group input {
    width: 100%;
    background: var(--input-bg) !important;
    border: 2px solid #333 !important;
    padding: 12px 15px !important;
    border-radius: 10px !important;
    color: white !important;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    outline: none;
}

.btn-login {
    width: 100%;
    margin-top: 10px;
    padding: 15px !important;
    font-size: 1rem !important;
}

.login-footer {
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--gray);
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.login-footer a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #444;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    transition: width 1s ease-in-out; /* Animación suave al cargar */
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}
/* =========================================
   MEJORAS DE PERFIL Y BARRA DE PROGRESO
   ========================================= */

/* Contenedor de la Barra de Progreso */
.progress-bar-container {
    width: 100%;
    height: 14px;
    background: #2a2a2a;
    border-radius: 20px;
    margin: 15px 0;
    border: 1px solid #444;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

/* Relleno animado de la barra */
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 20px;
    transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Estilos para el Historial de Resultados */
.goles-pred {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Ajuste para las etiquetas de puntos en el historial */
.puntos-badge {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.puntos-total { 
    background: var(--accent); 
    color: #000; 
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.puntos-parcial { 
    background: var(--primary); 
    color: #fff; 
}

.puntos-cero { 
    background: #444; 
    color: #888; 
}

/* Fix para el avatar y cabecera de perfil */
.avatar-grande {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary), #002d25);
    width: 110px;
    height: 110px;
    line-height: 110px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 3px solid var(--accent);
    box-shadow: var(--shadow);
}

/* Estilo para los textos de "Resultado Real" */
.resultado-real-label {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Asegurar que las tarjetas del historial no se deformen */
.partido-card form {
    width: 100%;
}
/* =========================================
   SISTEMA DE CENTRADO Y AJUSTE FINAL
   ========================================= */

/* Asegurar que el cuerpo principal centre todo horizontalmente */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding-top: 100px; /* Espacio para la navbar fija */
}

/* Contenedor principal con ancho máximo controlado */
.container {
    width: 90%;
    max-width: 800px; /* Tamaño ideal para lectura y formularios */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ajuste de tarjetas para que no se estiren infinitamente */
.card, .partido-card {
    width: 100%;
    max-width: 600px; /* Centrado visual más compacto */
    margin-left: auto;
    margin-right: auto;
}

/* Grid de resultados centrado */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
    justify-content: center; /* Centra las tarjetas si hay pocas */
}

/* Especial para móviles: si solo hay una tarjeta, que esté centrada */
@media (max-width: 600px) {
    .cards-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Centrado del Avatar Circular en Perfil */
.avatar-grande {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #2a2a2a, #121212);
    border: 4px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto; /* Centrado horizontal automático */
    font-size: 3.5rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Espaciado centrado de los inputs en pronósticos */
.marcador-body {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px; /* Espacio entre los bloques de equipos */
}

/* Sombra de Neón Dorado para Títulos */
.main-title {
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    margin-bottom: 20px;
}
/* =========================================
   EFECTO ESPEJO Y SOMBRAS DE NEÓN
   ========================================= */

/* Efecto de reflejo en la base de las tarjetas */
.card, .partido-card {
    position: relative;
    /* Creamos el reflejo usando un pseudoelemento */
}

.card::after, .partido-card::after {
    content: "";
    position: absolute;
    bottom: -20px; /* Distancia del reflejo */
    left: 5%;
    width: 90%;
    height: 15px;
    background: rgba(212, 175, 55, 0.15); /* Color dorado muy tenue */
    filter: blur(15px); /* Desenfoque para que parezca un reflejo */
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* Brillo de neón dorado para el título principal */
.main-title {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 
        0 0 10px rgba(212, 175, 55, 0.8),
        0 0 20px rgba(212, 175, 55, 0.4),
        0 0 30px rgba(212, 175, 55, 0.2);
    animation: neon-pulse 2s infinite alternate;
}

/* Animación de pulso para el brillo del título */
@keyframes neon-pulse {
    from {
        text-shadow: 0 0 10px rgba(212, 175, 55, 0.7);
    }
    to {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.9), 0 0 30px rgba(212, 175, 55, 0.5);
    }
}

/* Reflejo especial para el Avatar de Perfil */
.avatar-grande {
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.8),
        0 15px 30px rgba(212, 175, 55, 0.2); /* Sombra que simula apoyo */
}

/* =========================================
   NOTIFICACIONES FLOTANTES (TOAST)
   ========================================= */
.toast-notif {
    background: rgba(0, 77, 64, 0.9); /* Verde primario con transparencia */
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    border-left: 5px solid var(--accent); /* Borde dorado */
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    animation: slide-in 0.5s ease forwards, fade-out 0.5s ease 3s forwards;
    pointer-events: none;
}

@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}
/* Notificación Flotante Estilo Quiniela */
.toast-notif {
    background: rgba(0, 77, 64, 0.95); /* Verde botella */
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    border-left: 5px solid #d4af37; /* Borde dorado */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}