/* =============================================
   ESTILO.CSS - Campeonatos Barriales
   Diseño moderno con imagen de fondo personalizada
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --verde-oscuro: #1a472a;
    --verde-medio: #2d6a4f;
    --dorado: #ffd700;
    --texto-claro: #e0e0e0;
    --fondo: #f0f2f5;
    --blanco: #ffffff;
    --sombra: 0 8px 20px rgba(0,0,0,0.08);
    --radius: 20px;
}

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: url('../imagenes/fondo.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: #1a1a1a;
    padding: 20px 0;
}

/* ---------- APP CONTAINER ---------- */
.app-container {
    max-width: 960px;
    margin: 0 auto;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

/* ---------- HEADER ---------- */
.main-header {
    background: linear-gradient(135deg, var(--verde-oscuro), var(--verde-medio));
    color: white;
    padding: 25px 20px;
    text-align: center;
    border-bottom: 4px solid var(--dorado);
    position: relative;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 85px;
    height: 85px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 8px;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.08) rotate(-3deg);
}

.main-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitulo {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
    font-style: italic;
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
    flex: 1;
    padding: 30px 25px;
    background: rgba(255,255,255,0.6);
}

/* ---------- SECCIONES ---------- */
.seccion-activa {
    display: block;
    animation: fadeIn 0.5s ease;
}

.seccion-oculta {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.seccion-titulo {
    color: var(--verde-oscuro);
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    position: relative;
    padding-bottom: 12px;
}

.seccion-titulo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--dorado);
    border-radius: 3px;
}

/* ---------- CATEGORÍAS ---------- */
.categorias-grid {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.categoria-card {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    background: var(--blanco);
    border: none;
    border-radius: var(--radius);
    padding: 35px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--sombra);
    position: relative;
    overflow: hidden;
}

.categoria-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.categoria-card.adultos::before {
    background: #1e88e5;
}

.categoria-card.infantiles::before {
    background: #ff9800;
}

.categoria-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.categoria-icono {
    font-size: 55px;
    margin-bottom: 15px;
    display: block;
}

.categoria-card h3 {
    color: var(--verde-oscuro);
    margin-bottom: 5px;
    font-size: 20px;
    font-weight: 600;
}

.categoria-card p {
    color: #777;
    font-size: 13px;
    font-weight: 400;
}

/* ---------- TARJETAS ---------- */
.torneos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.torneo-card {
    background: var(--blanco);
    border: none;
    border-radius: var(--radius);
    padding: 22px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--sombra);
    animation: fadeIn 0.5s ease;
}

.torneo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

.torneo-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background: #f5f5f5;
    padding: 5px;
    margin-bottom: 12px;
    transition: transform 0.3s;
}

.torneo-card:hover .torneo-logo {
    transform: scale(1.1);
}

.torneo-card h3 {
    color: var(--verde-oscuro);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.torneo-card p {
    color: #666;
    font-size: 13px;
    font-weight: 400;
}

.torneo-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.torneo-badge.planificado {
    background: #fff3cd;
    color: #856404;
}

.torneo-badge.en_curso {
    background: #cce5ff;
    color: #004085;
}

.torneo-badge.finalizado {
    background: #d4edda;
    color: #155724;
}

/* ---------- BOTÓN VOLVER ---------- */
.btn-volver {
    background: none;
    border: 2px solid var(--verde-oscuro);
    color: var(--verde-oscuro);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 8px 18px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-volver:hover {
    background: var(--verde-oscuro);
    color: white;
}

/* ---------- TABS ---------- */
.tabs-navegacion {
    display: flex;
    gap: 6px;
    margin: 25px 0 0;
    flex-wrap: wrap;
    border-bottom: 3px solid var(--verde-oscuro);
    overflow-x: auto;
}

.tab-btn {
    background: #e8e8e8;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #d5d5d5;
}

.tab-btn.activo {
    background: var(--verde-oscuro);
    color: white;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

.tab-contenido {
    min-height: 300px;
    background: var(--blanco);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-top: none;
    overflow-x: auto;
    animation: fadeIn 0.4s ease;
}

/* ---------- TABLAS ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: var(--blanco);
    border-radius: 12px;
    overflow: hidden;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

th {
    background: var(--verde-oscuro);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f5f9f5;
}

/* ---------- FIXTURE ---------- */
.fecha-container {
    margin-bottom: 22px;
    animation: fadeIn 0.4s ease;
}

.fecha-container h3 {
    background: var(--verde-oscuro);
    color: white;
    padding: 12px 18px;
    border-radius: 12px 12px 0 0;
    font-size: 16px;
    font-weight: 600;
}

.fecha-container h4 {
    background: #f0f0f0;
    padding: 10px 18px;
    font-size: 14px;
    color: var(--verde-oscuro);
    font-weight: 600;
}

.partido-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border: 1px solid #e0e0e0;
    border-top: none;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 10px;
    transition: background 0.2s;
}

.partido-card:last-child {
    border-radius: 0 0 12px 12px;
}

.partido-card:hover {
    background: #f0f7f0;
}

.equipo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 130px;
}

.equipo.local {
    justify-content: flex-end;
    text-align: right;
}

.equipo.visitante {
    justify-content: flex-start;
    text-align: left;
}

.resultado {
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    padding: 0 15px;
    min-width: 70px;
}

.resultado small {
    display: block;
    font-weight: 400;
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

.equipo-logo,
.equipo-logo-mini {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    background: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ---------- SELECT ---------- */
select {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    font-family: 'Poppins', sans-serif;
    transition: border 0.3s;
}

select:focus {
    border-color: var(--verde-oscuro);
    outline: none;
}

/* ---------- FOOTER ---------- */
.main-footer {
    background: #123d2b;
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 18px 20px;
    font-size: 13px;
    font-weight: 400;
    border-top: 3px solid var(--dorado);
    margin-top: auto;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .app-container {
        border-radius: 20px;
        margin: 10px;
    }

    .categoria-card {
        min-width: 140px;
        padding: 25px 15px;
    }

    .torneos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .tabs-navegacion {
        gap: 3px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .tab-contenido {
        padding: 15px 10px;
    }

    .partido-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .equipo.local,
    .equipo.visitante {
        justify-content: center;
        text-align: center;
    }

    .resultado {
        font-size: 20px;
    }

    table {
        font-size: 11px;
    }

    th, td {
        padding: 8px 5px;
    }

    .main-header h1 {
        font-size: 22px;
    }

    .logo-img {
        width: 65px;
        height: 65px;
    }

    .seccion-titulo {
        font-size: 20px;
    }
}

@media (max-width: 400px) {
    .categorias-grid {
        flex-direction: column;
        align-items: center;
    }

    .categoria-card {
        max-width: 260px;
        width: 100%;
    }

    .torneos-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- MENÚ DE NAVEGACIÓN ---------- */
.main-nav {
    background: #0f2d1a;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px 15px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--dorado);
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background: var(--dorado);
    color: #000;
}