/* css/styles.css - Estilos Globales, Campo 3D y Sistema Glassmorphism */

:root {
    --bg-main: #0a0a0a;
    --bg-surface: #1c1c1e;
    --bg-card: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --pitch-dark: #1a472a;
    --pitch-light: #2d6a4f;
    --accent-neon: #39ff14;
    --text-main: #f5f5f5;
    --text-muted: #a0a0a0;
    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    --nav-height: 70px;
}

/* Reset Técnico */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-neon); }

/* Animaciones */
.fade-in { animation: fadeIn 300ms ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navbar Desktop */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass); display: flex; justify-content: space-between;
    align-items: center; padding: 0 2rem; z-index: 1000;
}
.nav-links-group { display: flex; gap: 2rem; align-items: center; }
.nav-link { color: var(--text-muted); text-decoration: none; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; text-transform: uppercase; transition: color 0.2s ease; }
.nav-link:hover, .nav-link.active { color: var(--accent-neon); }
.btn-logout { background: none; border: none; color: #ff4757; font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; text-transform: uppercase; cursor: pointer; }

/* Contenedores Genéricos */
.page-container { padding: calc(var(--nav-height) + 2rem) 2rem 2rem; max-width: 1200px; margin: 0 auto; min-height: 100vh; }
.section-title { font-family: var(--font-heading); font-size: 2rem; color: var(--text-main); margin-bottom: 2rem; border-bottom: 1px solid var(--border-glass); padding-bottom: 1rem; }
.category-title { color: var(--text-muted); font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; margin: 2rem 0 1rem; text-transform: uppercase; }

/* DASHBOARD LAYOUT (INICIO) */
.dashboard-container {
    display: grid; grid-template-columns: 280px 1fr 280px; grid-template-rows: 1fr 80px;
    gap: 1.5rem; padding: calc(var(--nav-height) + 1.5rem) 1.5rem 1.5rem; height: 100vh; overflow: hidden;
}
.glass-panel {
    background: var(--bg-card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass); border-radius: 12px; padding: 1.2rem; display: flex; flex-direction: column; overflow-y: auto;
}
.panel-title { font-family: var(--font-heading); font-size: 1.2rem; color: var(--accent-neon); text-transform: uppercase; margin-bottom: 1rem; border-bottom: 1px solid var(--border-glass); padding-bottom: 0.5rem; }

/* Izquierda: Estadísticas */
.panel-left { grid-column: 1; grid-row: 1; }
.stat-box { margin-bottom: 1.2rem; }
.stat-header { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); text-transform: uppercase;}
.stat-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; display: flex; }
.stat-fill-local { background: var(--text-main); }
.stat-fill-visita { background: var(--accent-neon); }
.stat-values { display: flex; justify-content: space-between; font-size: 1.1rem; font-family: var(--font-heading); font-weight: 700; margin-top: 5px; }

/* Centro: Cancha Horizontal 3D */
.panel-center { grid-column: 2; grid-row: 1; display: flex; justify-content: center; align-items: center; position: relative; }
.pitch-perspective { perspective: 1000px; width: 100%; display: flex; justify-content: center; align-items: center;}
.pitch-horizontal {
    width: 100%; max-width: 650px; aspect-ratio: 1.6 / 1;
    background: repeating-linear-gradient(90deg, var(--pitch-dark), var(--pitch-dark) 10%, var(--pitch-light) 10%, var(--pitch-light) 20%);
    transform: rotateX(35deg); border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 6px; position: relative;
    box-shadow: 0 40px 60px rgba(0,0,0,0.9), inset 0 0 40px rgba(0,0,0,0.5); transform-style: preserve-3d;
}
.pitch-horizontal::before { content: ''; position: absolute; left: 50%; top: 0; height: 100%; width: 2px; background: rgba(255, 255, 255, 0.7); transform: translateX(-50%); }
.pitch-horizontal::after { content: ''; position: absolute; top: 50%; left: 50%; width: 80px; height: 80px; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 50%; transform: translate(-50%, -50%); }
.area-left, .area-right { position: absolute; top: 50%; width: 15%; height: 45%; border: 2px solid rgba(255, 255, 255, 0.7); transform: translateY(-50%); }
.area-left { left: 0; border-left: none; }
.area-right { right: 0; border-right: none; }

/* Derecha: Ligas Mini */
.panel-right { grid-column: 3; grid-row: 1; gap: 10px; }
.mini-league { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass); border-radius: 8px; cursor: pointer; transition: 0.2s; }
.mini-league:hover { border-color: var(--accent-neon); background: rgba(57, 255, 20, 0.05); }
.mini-league-name { font-size: 0.9rem; font-weight: 600; }

/* Abajo: Noticias */
.panel-bottom { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; flex-direction: row; padding: 0 1.5rem; gap: 2rem; }
.news-ticker { display: flex; gap: 3rem; overflow: hidden; white-space: nowrap; width: 100%; color: var(--text-main); font-size: 0.95rem; }
.news-item span { color: var(--accent-neon); font-weight: bold; margin-right: 8px; }

/* Vista Ligas Generales */
.leagues-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.glass-card { background: var(--bg-card); backdrop-filter: blur(12px); border: 1px solid var(--border-glass); border-radius: 12px; padding: 1.5rem; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: 0.2s; }
.glass-card:hover { transform: translateY(-4px); border-color: rgba(57, 255, 20, 0.3); }
.league-info { display: flex; align-items: center; gap: 15px; }
.league-flag { font-size: 2rem; }
.badge-liga { padding: 4px 10px; border-radius: 20px; font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700; color: #fff; }

/* Login */
.login-view { height: 100vh; display: flex; justify-content: center; align-items: center; background: radial-gradient(circle at center, var(--bg-surface), var(--bg-main)); }
.login-card { background: var(--bg-card); backdrop-filter: blur(16px); border: 1px solid var(--border-glass); border-radius: 16px; padding: 3rem 2.5rem; width: 100%; max-width: 400px; text-align: center; }
.login-logo { font-family: var(--font-heading); font-size: 2.8rem; font-weight: 800; color: var(--text-main); margin-bottom: 2.5rem; }
.login-logo span { color: var(--accent-neon); }
.input-container { display: flex; flex-direction: column; text-align: left; gap: 0.5rem; margin-bottom: 1.5rem;}
.input-container label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.glass-input { background: rgba(0, 0, 0, 0.5); border: 1px solid var(--border-glass); border-radius: 8px; padding: 14px; color: var(--text-main); font-family: var(--font-body); font-size: 1rem; outline: none; transition: 0.2s; }
.glass-input:focus { border-color: var(--accent-neon); }
.btn-submit { background: var(--accent-neon); color: #0a0a0a; border: none; border-radius: 8px; padding: 14px; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: 0.2s; width: 100%;}
.btn-submit:hover { background-color: #32e011; transform: translateY(-2px); }

/* VISTA DE LIGA DETALLADA */
.liga-header { display: flex; align-items: center; gap: 1.5rem; padding-bottom: 1.5rem; margin-bottom: 2rem; background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, transparent 100%); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border-glass); }
.liga-flag-large { font-size: 3.5rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.liga-title-main { font-family: var(--font-heading); font-size: 2.5rem; color: var(--text-main); text-transform: uppercase; line-height: 1.1; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.liga-content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.table-responsive { width: 100%; overflow-x: auto; }
.standings-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.95rem; }
.standings-table th { padding: 12px 10px; color: var(--text-muted); border-bottom: 1px solid var(--border-glass); font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 0.05em; }
.standings-table td { padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.standings-table tbody tr { transition: background-color 0.2s ease; cursor: pointer; }
.standings-table tbody tr:hover { background-color: rgba(57, 255, 20, 0.08); }
.col-pos { width: 40px; font-weight: bold; color: var(--text-muted); }
.col-team { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.col-pts { font-weight: 800; color: var(--accent-neon); }
.team-shield { width: 24px; height: 24px; background: rgba(255,255,255,0.1); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.6rem; border: 1px solid rgba(255,255,255,0.2); }
.match-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-glass); }
.match-item:last-child { border-bottom: none; }
.match-teams { display: flex; flex-direction: column; gap: 4px; font-size: 0.95rem; font-weight: 600; }
.match-date { font-size: 0.75rem; color: var(--bg-main); background: var(--accent-neon); padding: 4px 8px; border-radius: 4px; font-weight: bold; text-transform: uppercase; }

/* VISTA DE EQUIPO Y ALINEACIÓN 3D */
.equipo-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; background: linear-gradient(90deg, rgba(57, 255, 20, 0.1) 0%, transparent 100%); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--accent-neon); }
.equipo-title { font-family: var(--font-heading); font-size: 2.5rem; color: var(--text-main); text-transform: uppercase; }
.equipo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.roster-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.roster-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass); border-radius: 8px; }
.player-num { font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem; color: var(--accent-neon); width: 35px; }
.player-name { flex: 1; font-weight: 600; font-size: 1rem; }
.player-pos { font-size: 0.8rem; font-weight: bold; padding: 2px 8px; background: rgba(255,255,255,0.1); border-radius: 4px; text-transform: uppercase; }

.tactical-board { display: flex; justify-content: center; align-items: center; padding: 2rem 0; }
.pitch-vertical {
    width: 320px; height: 480px;
    background: repeating-linear-gradient(0deg, var(--pitch-dark), var(--pitch-dark) 10%, var(--pitch-light) 10%, var(--pitch-light) 20%);
    transform: rotateX(45deg); border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 6px; position: relative;
    box-shadow: 0 40px 60px rgba(0,0,0,0.9), inset 0 0 30px rgba(0,0,0,0.5); transform-style: preserve-3d;
}
.pitch-vertical::before { content: ''; position: absolute; top: 50%; width: 100%; height: 2px; background: rgba(255, 255, 255, 0.7); transform: translateY(-50%); }
.pitch-vertical::after { content: ''; position: absolute; top: 50%; left: 50%; width: 80px; height: 80px; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 50%; transform: translate(-50%, -50%); }
.area-top-v, .area-bottom-v { position: absolute; left: 50%; width: 50%; height: 16%; border: 2px solid rgba(255, 255, 255, 0.7); transform: translateX(-50%); }
.area-top-v { top: 0; border-top: none; }
.area-bottom-v { bottom: 0; border-bottom: none; }

.player-token {
    position: absolute; width: 30px; height: 30px; background: var(--text-main); color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 800; font-size: 14px;
    transform: translate(-50%, -50%) translateZ(25px) rotateX(-45deg); box-shadow: 0 15px 15px rgba(0,0,0,0.8); border: 2px solid var(--accent-neon); transition: 0.3s; cursor: pointer;
}
.player-token:hover { background: var(--accent-neon); transform: translate(-50%, -50%) translateZ(35px) rotateX(-45deg) scale(1.2); box-shadow: 0 25px 20px rgba(0,0,0,0.9); }

.pos-gk  { bottom: 5%; left: 50%; } .pos-df1 { bottom: 22%; left: 15%; } .pos-df2 { bottom: 18%; left: 38%; } .pos-df3 { bottom: 18%; left: 62%; } .pos-df4 { bottom: 22%; left: 85%; }
.pos-md1 { bottom: 42%; left: 25%; } .pos-md2 { bottom: 35%; left: 50%; } .pos-md3 { bottom: 42%; left: 75%; }
.pos-fw1 { top: 25%; left: 25%; } .pos-fw2 { top: 15%; left: 50%; } .pos-fw3 { top: 25%; left: 75%; }

/* MÓDULO HEAD-TO-HEAD (H2H) */
.h2h-header-panel { display: flex; justify-content: space-around; align-items: center; padding: 2rem; margin-bottom: 2rem; background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(57, 255, 20, 0.05) 100%); }
.h2h-team { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; }
.h2h-team .team-shield { width: 90px; height: 90px; font-size: 3rem; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.h2h-team-name { font-family: var(--font-heading); font-size: 2rem; text-transform: uppercase; font-weight: 800; text-align: center;}
.h2h-vs { font-family: var(--font-heading); font-size: 3rem; font-weight: 800; color: var(--bg-main); background: var(--accent-neon); padding: 10px 20px; border-radius: 12px; box-shadow: 0 0 30px rgba(57, 255, 20, 0.4); z-index: 10; }
.h2h-stats-board { display: flex; flex-direction: column; gap: 1.5rem; padding: 2rem 1.5rem; }
.h2h-stat-row { display: flex; flex-direction: column; gap: 8px; }
.h2h-stat-labels { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; }
.h2h-stat-labels .lbl-center { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600;}
.h2h-bar-container { display: flex; width: 100%; height: 12px; background: rgba(0,0,0,0.5); border-radius: 6px; overflow: hidden; border: 1px solid var(--border-glass); }
.h2h-bar-left { background: var(--text-main); display: flex; justify-content: flex-end; }
.h2h-bar-right { background: var(--accent-neon); }

/* MÓDULO INFO (NOTICIAS Y NOVEDADES) */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.news-card { background: var(--bg-card); backdrop-filter: blur(12px); border: 1px solid var(--border-glass); border-radius: 12px; overflow: hidden; transition: transform 0.2s ease, border-color 0.2s ease; display: flex; flex-direction: column; }
.news-card:hover { transform: translateY(-5px); border-color: var(--accent-neon); }
.news-image-placeholder { width: 100%; height: 160px; background: linear-gradient(45deg, var(--bg-surface), #2a2a2c); display: flex; align-items: center; justify-content: center; font-size: 3rem; border-bottom: 1px solid var(--border-glass); }
.news-content { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.news-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.news-tag { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; letter-spacing: 1px; }
.tag-mercado { background: rgba(57, 255, 20, 0.2); color: var(--accent-neon); border: 1px solid var(--accent-neon); }
.tag-lesion { background: rgba(255, 71, 87, 0.2); color: #ff4757; border: 1px solid #ff4757; }
.tag-declaracion { background: rgba(108, 171, 221, 0.2); color: #6CABDD; border: 1px solid #6CABDD; }
.news-date { font-size: 0.8rem; color: var(--text-muted); }
.news-title { font-family: var(--font-heading); font-size: 1.4rem; color: var(--text-main); margin-bottom: 0.8rem; line-height: 1.2; }
.news-excerpt { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1.5rem; flex: 1; }
.news-read-more { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; color: var(--accent-neon); text-decoration: none; text-transform: uppercase; align-self: flex-start; transition: color 0.2s; }
.news-read-more:hover { color: #fff; }

/* ── PASO 9: APP MÓVIL (BOTTOM NAV Y RESPONSIVE) ── */
.mobile-nav { display: none; } /* Oculto en PC */

@media (max-width: 1024px) {
    .dashboard-container { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; height: auto; overflow-y: auto; }
    .panel-center { grid-column: 1; grid-row: 1; min-height: 300px; }
    .panel-left { grid-column: 1; grid-row: 2; }
    .panel-right { grid-column: 1; grid-row: 3; }
    .panel-bottom { grid-column: 1; grid-row: 4; flex-direction: column; text-align: center; padding: 1rem; }
    .liga-content-grid, .equipo-grid { grid-template-columns: 1fr; }
    .h2h-header-panel { flex-direction: column; gap: 1.5rem; }
    .h2h-vs { transform: rotate(90deg); padding: 5px 15px; }
}

/* Corte específico para Celulares (Transformación a App) */
@media (max-width: 768px) {
    /* Matamos la barra de arriba */
    .desktop-nav { display: none !important; }
    
    /* Quitamos el margen superior que dejaba la barra de PC y agregamos abajo para el menú */
    .page-container { padding-top: 1.5rem; padding-bottom: calc(var(--nav-height) + 1.5rem); }
    .dashboard-container { padding-top: 1.5rem; padding-bottom: calc(var(--nav-height) + 1.5rem); }

    /* Nace la barra inferior tipo app nativa */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; width: 100%; height: var(--nav-height);
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border-glass);
        justify-content: space-around; align-items: center; z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        text-decoration: none; color: var(--text-muted); font-family: var(--font-heading);
        font-size: 0.7rem; font-weight: 700; text-transform: uppercase; transition: 0.2s; gap: 4px;
    }

    .mobile-nav-item.active { color: var(--accent-neon); }
    .mobile-icon { font-size: 1.4rem; filter: grayscale(100%); transition: 0.2s; line-height: 1; }
    .mobile-nav-item.active .mobile-icon { filter: grayscale(0%); text-shadow: 0 0 10px var(--accent-neon); }
}
