/* =========================================== */
/* styles.css - TODO EN UNO                    */
/* =========================================== */

/* ==================== */
/* VARIABLES (todos los colores) */
/* ==================== */
:root {
    /* Colores comunes */
    --white: #FFFFFF;
    --gray-light: #F8F9FA;
    --gray-border: #E0E0E0;
    --text-dark: #212529;
    --text-light: #6C757D;
    
    /* Colores por deporte */
    --padel-primary: #1565C0;
    --padel-secondary: #1E88E5;
    --padel-accent: #0D47A1;
    
    --futbol-primary: #005120;
    --futbol-secondary: #00B140;
    --futbol-accent: #003D14;
    
    --tenis-primary: #D32F2F;
    --tenis-secondary: #F44336;
    --tenis-accent: #B71C1C;
    
    --portada-primary: #1e3a8a;
    --portada-secondary: #3b82f6;
    --portada-accent: #1e40af;
}

/* ==================== */
/* RESET Y BASE */
/* ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

/* ==================== */
/* HEADER (común) */
/* ==================== */
.header {
    color: var(--white);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    /* El color se define por deporte */
}

body.padel .header {
    background: linear-gradient(135deg, var(--padel-primary) 0%, var(--padel-secondary) 100%);
}

body.futbol .header {
    background: linear-gradient(135deg, var(--futbol-primary) 0%, var(--futbol-secondary) 100%);
}

body.tenis .header {
    background: linear-gradient(135deg, var(--tenis-primary) 0%, var(--tenis-secondary) 100%);
}

body.portada .header {
    background: linear-gradient(135deg, var(--portada-primary) 0%, var(--portada-secondary) 100%);
}

/* Contenedor header */
.header .container {
    display: flex;
    flex-direction: column;
    padding: 1rem 15px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Padding para compensar header fijo */
body {
    padding-top: 120px;
}

@media (max-width: 768px) {
    body {
        padding-top: 140px;
    }
}

/* ==================== */
/* COMPONENTES COMUNES */
/* ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 2rem;
    background: var(--white);
    color: var(--portada-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.main-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ==================== */
/* HERO SECTION */
/* ==================== */
.hero {
    background: var(--white);
    padding: 2.5rem 0;
    margin-top: 0;
    border-bottom: 4px solid;
}

/* Colores de borde hero por deporte */
body.padel .hero { border-bottom-color: var(--padel-secondary); }
body.futbol .hero { border-bottom-color: var(--futbol-secondary); }
body.tenis .hero { border-bottom-color: var(--tenis-secondary); }
body.portada .hero { border-bottom-color: var(--portada-secondary); }

.hero-title {
    position: relative;
    display: inline-block;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 0;
}

/* Colores de título por deporte */
body.padel .hero-title { color: var(--padel-primary); }
body.futbol .hero-title { color: var(--futbol-primary); }
body.tenis .hero-title { color: var(--tenis-primary); }
body.portada .hero-title { color: var(--portada-primary); }

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 80px;
    height: 4px;
    border-radius: 2px;
}

/* Colores de línea subrayado por deporte */
body.padel .hero-title::after { background: var(--padel-secondary); }
body.futbol .hero-title::after { background: var(--futbol-secondary); }
body.tenis .hero-title::after { background: var(--tenis-secondary); }
body.portada .hero-title::after { background: var(--portada-secondary); }

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 800px;
}

/* ==================== */
/* BUSCADOR */
/* ==================== */
.search-container {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 1.5rem 0;
    border: 1px solid var(--gray-border);
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

/* Color de foco por deporte */
body.padel .search-input:focus { border-color: var(--padel-secondary); box-shadow: 0 0 0 3px rgba(22, 101, 192, 0.1); }
body.futbol .search-input:focus { border-color: var(--futbol-secondary); box-shadow: 0 0 0 3px rgba(0, 177, 64, 0.1); }
body.tenis .search-input:focus { border-color: var(--tenis-secondary); box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1); }
body.portada .search-input:focus { border-color: var(--portada-secondary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

.search-btn {
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Colores de botón por deporte */
body.padel .search-btn { background: var(--padel-secondary); }
body.padel .search-btn:hover { background: var(--padel-accent); }

body.futbol .search-btn { background: var(--futbol-secondary); }
body.futbol .search-btn:hover { background: var(--futbol-accent); }

body.tenis .search-btn { background: var(--tenis-secondary); }
body.tenis .search-btn:hover { background: var(--tenis-accent); }

body.portada .search-btn { background: var(--portada-secondary); }
body.portada .search-btn:hover { background: var(--portada-accent); }

/* ==================== */
/* TABLA */
/* ==================== */
.table-container {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--gray-border);
    margin-bottom: 2rem;
    width: 100%;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 2px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

/* Colores de cabecera tabla por deporte */
body.padel .table-header {
    background: #E3F2FD;
    border-bottom-color: var(--padel-secondary);
}

body.futbol .table-header {
    background: #E8F5E9;
    border-bottom-color: var(--futbol-secondary);
}

body.tenis .table-header {
    background: #FFEBEE;
    border-bottom-color: var(--tenis-secondary);
}

body.portada .table-header {
    background: #E0F2FE;
    border-bottom-color: var(--portada-secondary);
}

.table-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Colores de título tabla por deporte */
body.padel .table-title { color: var(--padel-primary); }
body.futbol .table-title { color: var(--futbol-primary); }
body.tenis .table-title { color: var(--tenis-primary); }
body.portada .table-title { color: var(--portada-primary); }

/* ==================== */
/* DATATABLES */
/* ==================== */
.dataTables_wrapper {
    padding: 0 !important;
    width: 100%;
    overflow-x: auto;
}

#partidosTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse;
}

table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-spacing: 0;
    border: none;
}

table.dataTable thead th {
    font-weight: 600;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: relative;
}

/* Colores cabecera tabla por deporte */
body.padel table.dataTable thead th {
    background-color: #E3F2FD;
    border-bottom-color: var(--padel-secondary);
    color: var(--padel-primary);
}

body.futbol table.dataTable thead th {
    background-color: #E8F5E9;
    border-bottom-color: var(--futbol-secondary);
    color: var(--futbol-primary);
}

body.tenis table.dataTable thead th {
    background-color: #FFEBEE;
    border-bottom-color: var(--tenis-secondary);
    color: var(--tenis-primary);
}

body.portada table.dataTable thead th {
    background-color: #E0F2FE;
    border-bottom-color: var(--portada-secondary);
    color: var(--portada-primary);
}

table.dataTable tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-border);
    vertical-align: middle;
    position: relative;
}

/* Hover filas por deporte */
body.padel table.dataTable tbody tr:hover { background-color: #E3F2FD; }
body.futbol table.dataTable tbody tr:hover { background-color: #E8F5E9; }
body.tenis table.dataTable tbody tr:hover { background-color: #FFEBEE; }
body.portada table.dataTable tbody tr:hover { background-color: #E0F2FE; }

/* ==================== */
/* CELDAS ESPECIALES */
/* ==================== */
.equipo-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 30px;
}

.escudo-equipo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 50%;
    background: #f8f9fa;
    padding: 2px;
    border: 1px solid var(--gray-border);
    flex-shrink: 0;
}

.canales-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    min-height: 30px;
}

.hora-cell {
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

/* Colores hora por deporte */
body.padel .hora-cell { color: var(--padel-primary); }
body.futbol .hora-cell { color: var(--futbol-primary); }
body.tenis .hora-cell { color: var(--tenis-primary); }
body.portada .hora-cell { color: var(--portada-primary); }

.competicion-cell {
    font-weight: 600;
}

/* Colores competición por deporte */
body.padel .competicion-cell { color: var(--padel-primary); }
body.futbol .competicion-cell { color: var(--futbol-primary); }
body.tenis .competicion-cell { color: var(--tenis-primary); }
body.portada .competicion-cell { color: var(--portada-primary); }

/* ==================== */
/* BADGES DE CANALES */
/* ==================== */
.badge-canal {
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

body.padel .badge-canal { background: var(--padel-secondary); }
body.futbol .badge-canal { background: var(--futbol-secondary); }
body.tenis .badge-canal { background: var(--tenis-secondary); }
body.portada .badge-canal { background: var(--portada-secondary); }

/* ==================== */
/* TORNEOS */
/* ==================== */
.torneo-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.torneo-imagen {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 4px;
    border: 1px solid #e0e0e0;
}

.torneo-info {
    display: flex;
    flex-direction: column;
}

.torneo-nombre {
    font-weight: 600;
    font-size: 0.95rem;
}

.torneo-evento {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

/* ==================== */
/* TARJETAS MÓVIL */
/* ==================== */
.mobile-cards-container {
    display: none;
    padding: 20px 15px;
}

@media (max-width: 991px) {
    .dataTables_wrapper {
        display: none !important;
    }
    
    .mobile-cards-container {
        display: block;
    }
}

.partido-card {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--gray-border);
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.partido-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
    padding: 15px;
    border-bottom: 2px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Colores cabecera tarjetas por deporte */
body.padel .card-header {
    background: #E3F2FD;
    border-bottom-color: var(--padel-secondary);
}

body.futbol .card-header {
    background: #E8F5E9;
    border-bottom-color: var(--futbol-secondary);
}

body.tenis .card-header {
    background: #FFEBEE;
    border-bottom-color: var(--tenis-secondary);
}

body.portada .card-header {
    background: #E0F2FE;
    border-bottom-color: var(--portada-secondary);
}

.card-fecha-hora {
    display: flex;
    gap: 15px;
    align-items: center;
}

.card-fecha {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Colores fecha por deporte */
body.padel .card-fecha { color: var(--padel-primary); }
body.futbol .card-fecha { color: var(--futbol-primary); }
body.tenis .card-fecha { color: var(--tenis-primary); }
body.portada .card-fecha { color: var(--portada-primary); }

.card-hora {
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
}

/* Colores hora tarjeta por deporte */
body.padel .card-hora { background: var(--padel-secondary); }
body.futbol .card-hora { background: var(--futbol-secondary); }
body.tenis .card-hora { background: var(--tenis-secondary); }
body.portada .card-hora { background: var(--portada-secondary); }

.card-competicion {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Colores competición tarjeta por deporte */
body.padel .card-competicion { color: var(--padel-primary); }
body.futbol .card-competicion { color: var(--futbol-primary); }
body.tenis .card-competicion { color: var(--tenis-primary); }
body.portada .card-competicion { color: var(--portada-primary); }

/* ==================== */
/* CONTENIDO TARJETAS */
/* ==================== */
.card-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 20px;
    margin: 15px 0;
}

.card-equipo {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.card-escudo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 50%;
    padding: 5px;
    border: 2px solid var(--gray-border);
}

.card-nombre-equipo {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    text-align: center;
}

.card-vs-text {
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    margin: 0 10px;
}

/* Colores VS por deporte */
body.padel .card-vs-text { background: var(--padel-primary); }
body.futbol .card-vs-text { background: var(--futbol-primary); }
body.tenis .card-vs-text { background: var(--tenis-primary); }
body.portada .card-vs-text { background: var(--portada-primary); }

.card-detalles {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

/* Fondo detalles por deporte */
body.padel .card-detalles { background: #E3F2FD; }
body.futbol .card-detalles { background: #E8F5E9; }
body.tenis .card-detalles { background: #FFEBEE; }
body.portada .card-detalles { background: #E0F2FE; }

.card-detalle-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-detalle-item:last-child {
    border-bottom: none;
}

.card-canales-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
}

/* ==================== */
/* OTROS */
/* ==================== */
.evento-sin-jugadores {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.loading-container {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Color spinner por deporte */
body.padel .spinner { border-top-color: var(--padel-secondary); }
body.futbol .spinner { border-top-color: var(--futbol-secondary); }
body.tenis .spinner { border-top-color: var(--tenis-secondary); }
body.portada .spinner { border-top-color: var(--portada-secondary); }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== */
/* FOOTER */
/* ==================== */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    color: var(--white);
}

/* Colores footer por deporte */
body.padel .footer { background: var(--padel-primary); }
body.futbol .footer { background: var(--futbol-primary); }
body.tenis .footer { background: var(--tenis-primary); }
body.portada .footer { background: var(--portada-primary); }

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFD700;
}

.update-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-link:hover {
    opacity: 1;
}

/* ==================== */
/* RESPONSIVE */
/* ==================== */
@media (max-width: 768px) {
    .logo-text {
        font-size: 1.3rem;
    }
    
    .main-nav {
        justify-content: center;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .table-header {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .header .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .main-nav {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 160px;
    }
    
    .card-vs {
        flex-direction: column;
        gap: 10px;
    }
    
    .card-vs-text {
        margin: 5px 0;
        order: 1;
    }
    
    .card-equipo {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    
    .card-escudo {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
    }
    
    .card-nombre-equipo {
        font-size: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .card-fecha-hora {
        flex-direction: column;
        gap: 8px;
    }
    
    .card-canales-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .card-canales-info .badge-canal {
        align-self: center;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .header .container {
        padding: 0.8rem 15px;
    }
    
    .main-nav {
        gap: 10px;
        justify-content: center;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .card-vs {
        gap: 30px;
    }
    
    .card-escudo {
        width: 70px;
        height: 70px;
    }
}