/* =========================================
   ESTILO PRINCIPAL DE LOGIN (BARRA, GRID Y RANKING)
   Archivo: css/style.css
   ========================================= */

/* =========================================
   1. FONDO Y RESETEO DEL BODY
   ========================================= */
body.login-page-modern {
    background: linear-gradient(rgba(5, 15, 25, 0.85), rgba(5, 15, 25, 0.95)), url('../img/bg.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    display: block; 
    padding: 0; 
    margin: 0;
    min-height: 100vh;
}

/* =========================================
   2. BARRA SUPERIOR (HEADER)
   ========================================= */
.topbar-login {
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--accent);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar-logo { display: flex; align-items: center; gap: 10px; }
.topbar-logo .logo-emoji { font-size: 2rem; }
.topbar-logo h1 {
    color: var(--accent);
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.topbar-form-container { display: flex; flex-direction: column; align-items: flex-end; }
.form-inline { display: flex; gap: 10px; align-items: center; }
.form-inline input {
    background: var(--input-bg);
    border: 1px solid #444;
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    width: 200px;
    transition: var(--transition);
}

.form-inline input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    outline: none;
}

.btn-login-top {
    background: linear-gradient(135deg, var(--accent), #b8860b);
    color: #000;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login-top:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.register-link-top { margin-top: 8px; font-size: 0.8rem; color: var(--gray); }
.register-link-top a { color: var(--accent); text-decoration: none; font-weight: bold; transition: var(--transition); }
.register-link-top a:hover { color: var(--accent-hover); text-decoration: underline; }
.error-msg { color: var(--error); font-size: 0.8rem; font-weight: bold; margin-bottom: 5px; }

/* =========================================
   3. MARQUESINA DE PARTIDOS (TIPO ESPN)
   ========================================= */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 2px solid var(--accent);
    display: flex;
    white-space: nowrap;
}

.ticker-track {
    display: flex;
    width: max-content;
    /* Movemos el contenido exactamente al 50% de todo el ancho (que es donde termina el primer bloque y empieza el bloque clonado) */
    animation: ticker-anim 40s linear infinite;
}

.ticker-track:hover { 
    animation-play-state: paused; 
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 10px 40px;
    font-size: 0.95rem;
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.t-date { color: #888; margin-right: 15px; font-size: 0.85rem; }
.t-team { font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.t-score { 
    background: rgba(212, 175, 55, 0.15); 
    color: var(--accent); 
    padding: 2px 12px; 
    border-radius: 5px; 
    margin: 0 15px; 
    font-weight: 900;
    border: 1px solid rgba(212, 175, 55, 0.4);
}
.t-status { margin-left: 15px; font-size: 0.75rem; font-weight: bold; letter-spacing: 1px; }

.text-green { color: #2ecc71; }
.text-gray { color: #95a5a6; }
.text-red { color: #e74c3c; }

@keyframes ticker-anim {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); } 
}

/* =========================================
   4. LAYOUT PRINCIPAL: GRID 3 COLUMNAS
   ========================================= */
.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: start;
}

.grid-col { display: flex; flex-direction: column; }
.info-hero { text-align: left; }

.feature-box {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid #333;
    padding: 25px;
    border-radius: 15px;
    transition: var(--transition);
}

.feature-box:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

/* =========================================
   5. RANKING ULTRA-MODERNO (GLASS & NEON)
   ========================================= */
.ranking-modern-container {
    background: rgba(25, 25, 35, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 30px 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.ranking-title {
    text-align: center;
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 1.2rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.ranking-table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 15px;
}

.ranking-table-modern th {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 5px;
    border: none;
    text-align: left;
}

.ranking-row {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ranking-row:hover {
    transform: scale(1.03) translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 15px 30px -10px rgba(212, 175, 55, 0.5);
    z-index: 10;
}

.ranking-row td {
    padding: 15px 20px;
    border: none;
    vertical-align: middle;
}
.ranking-row td:first-child { border-radius: 18px 0 0 18px; }
.ranking-row td:last-child { border-radius: 0 18px 18px 0; text-align: right; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #ccc;
    font-weight: 900;
    font-size: 1rem;
}

/* Info del Usuario Alineada Horizontalmente */
.user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}
.user-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.1);
}
.user-name {
    color: white;
    font-weight: bold;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    text-transform: capitalize;
}
.tu-badge {
    background: var(--accent);
    color: #000;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.points-badge {
    display: inline-block;
    background: rgba(0,0,0,0.3);
    color: var(--accent);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* ================== ESTILOS DEL PODIO (TOP 3) ================== */
.rank-badge.oro { background: rgba(212, 175, 55, 0.2); color: #d4af37; box-shadow: 0 0 20px rgba(212, 175, 55, 0.6); font-size: 1.6rem; }
.rank-badge.plata { background: rgba(192, 192, 192, 0.2); color: #c0c0c0; box-shadow: 0 0 15px rgba(192, 192, 192, 0.5); font-size: 1.4rem; }
.rank-badge.bronce { background: rgba(205, 127, 50, 0.2); color: #cd7f32; box-shadow: 0 0 15px rgba(205, 127, 50, 0.5); font-size: 1.3rem; }

.top-1 {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, transparent 90%);
    border-left: 4px solid var(--accent) !important;
}
.top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.15) 0%, transparent 90%);
    border-left: 4px solid #c0c0c0 !important;
}
.top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.15) 0%, transparent 90%);
    border-left: 4px solid #cd7f32 !important;
}

.fila-propia { background: rgba(52, 152, 219, 0.15); border-left: 4px solid #3498db; }
.fila-propia .user-avatar { background: var(--accent); color: #000; box-shadow: 0 0 15px var(--accent); }

/* =========================================
   6. FOOTER FIJO (BARRA INFERIOR)
   ========================================= */
.pb-footer { padding-bottom: 70px !important; }
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.98);
    border-top: 2px solid var(--accent);
    color: var(--gray);
    text-align: center;
    padding: 15px;
    font-size: 0.85rem;
    z-index: 1000;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

/* =========================================
   7. ADAPTACIÓN RESPONSIVA (TABLETS Y MÓVILES)
   ========================================= */
@media (max-width: 1024px) {
    .dashboard-grid-3 { grid-template-columns: 1fr 1fr; }
    .right-col { grid-column: span 2; }
}

@media (max-width: 768px) {
    .topbar-login { flex-direction: column; gap: 20px; padding: 20px; }
    .form-inline { flex-direction: column; width: 100%; }
    .form-inline input, .btn-login-top { width: 100%; }
    .topbar-form-container { align-items: center; width: 100%; }
    
    .dashboard-grid-3 { grid-template-columns: 1fr; }
    .right-col { grid-column: auto; }
    .info-hero { text-align: center; }
}


/* =========================================
   8. MODAL DE REGISTRO (POPUP)
   ========================================= */

/* Capa oscura que cubre toda la pantalla */
.modal-overlay {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 2000; /* Debe estar por encima del header y footer */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Fondo negro semitransparente */
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Animación de entrada suave */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Caja del formulario de registro */
.modal-box {
    background: rgba(25, 25, 35, 0.95);
    border: 1px solid var(--accent);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    transform: translateY(0);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Botón "X" para cerrar */
.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--gray);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--error);
}

/* Cabecera del formulario */
.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    color: var(--accent);
    margin-bottom: 5px;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-header p {
    color: #ccc;
    font-size: 0.9rem;
}

/* Estilos de los inputs dentro del modal */
.form-registro .input-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-registro label {
    display: block;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 8px;
    margin-left: 5px;
}

.form-registro input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid #444;
    padding: 12px 15px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
    box-sizing: border-box; /* Asegura que el padding no rompa el ancho */
}

.form-registro input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    outline: none;
}

/* Clase de utilidad para que el botón ocupe el 100% del ancho */
.w-100 {
    width: 100%;
    padding: 15px !important;
    font-size: 1.1rem !important;
    margin-top: 10px;
}


/* =========================================
   9. ESTILOS INTERNOS (DASHBOARD & PERFIL)
   ========================================= */

/* Fondo para las páginas internas (con espacio arriba para tu menú) */
body.dashboard-page {
    background: linear-gradient(rgba(5, 15, 25, 0.9), rgba(5, 15, 25, 0.95)), url('../img/bg.png');
    background-size: cover;
    background-attachment: fixed;
    color: white;
    min-height: 100vh;
    padding-top: 80px; /* Espacio para el menu.php fijo */
    padding-bottom: 50px;
}

.dashboard-container {
    width: 95%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Efecto Cristal Base reutilizable */
.glass-panel {
    background: rgba(25, 25, 35, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

/* --- PANEL DE CONTROL (HERO) --- */
.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 30px 40px;
    margin-bottom: 40px;
    gap: 30px;
}

.hero-user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}


.hero-name {
    color: white;
    font-size: 2rem;
    margin: 0 0 5px 0;
    text-transform: capitalize;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.hero-desc {
    color: var(--gray);
    margin: 0;
    font-size: 0.95rem;
}

.hero-stats {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-title {
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.stat-points {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 900;
    font-size: 0.9rem;
    border: 1px solid rgba(212, 175, 55, 0.5);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    transition: width 1s ease-in-out;
}

.stat-footer {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #aaa;
    text-align: right;
}
.text-gold { color: var(--accent) !important; font-weight: bold; }

/* --- GRID DE PREDICCIONES --- */
.section-title {
    text-align: center;
    margin-bottom: 25px;
}
.section-title h2 {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.5rem;
}

.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.prediction-card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.15);
}

.pred-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pred-date { color: var(--gray); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px;}

.pred-status-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
}
.pts-exacto { background: rgba(212, 175, 55, 0.2); color: var(--accent); border: 1px solid var(--accent); }
.pts-parcial { background: rgba(0, 105, 92, 0.3); color: #1abc9c; border: 1px solid #1abc9c; }
.pts-cero { background: rgba(255, 77, 77, 0.1); color: #ff4d4d; border: 1px solid rgba(255, 77, 77, 0.3); }

.pred-body {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 25px 20px;
}

.pred-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 40%;
}

.team-name {
    font-weight: bold;
    color: white;
    text-align: center;
}

.pred-score {
    background: rgba(0,0,0,0.6);
    border: 1px solid #444;
    color: var(--accent);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    border-radius: 12px;
}

.pred-vs { color: #555; font-weight: 900; font-size: 1rem; }

.pred-footer {
    text-align: center;
    padding: 12px 20px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-radius: 0 0 20px 20px;
    font-size: 0.8rem;
    color: var(--gray);
    letter-spacing: 1px;
}
.pred-footer strong { color: white; }

@media (max-width: 768px) {
    .dashboard-hero { flex-direction: column; text-align: center; padding: 25px 20px; }
    .hero-user-info { flex-direction: column; }
    .stat-footer { text-align: center; }
}