﻿/* Estilos para el calendario de partidos - Vista clásica */

/* Contenedor principal y elementos de filtro */
.calendario-container {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 30px;
}

.section-title {
    font-weight: 700;
    margin-bottom: 20px;
    color: #343a40;
    border-bottom: 3px solid #3d4c54;
    padding-bottom: 10px;
    display: inline-block;
}

.select-equipos {
    border-radius: 4px;
    border-color: #ced4da;
    font-size: 14px;
}

.vista-selector {
    float: right;
}

    .vista-selector .btn {
        padding: 8px 12px;
    }

        .vista-selector .btn.active {
            background-color: #3d4c54;
            color: #fff;
            border-color: #3d4c54;
        }

/* Spinner de carga compartido */
.spinner {
    margin: 20px auto;
    text-align: center;
    color: #3d4c54;
}

/* =========================
   VISTA CLÁSICA DE TARJETAS 
   ========================= */

/* Contenedor grid para tarjetas */
.partidos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Estilos básicos de tarjeta */
.partido-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    position: relative;
    border-left: none;
}

    .partido-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

.partido-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.partido-info .badge {
    background-color: #f8f9fa;
    color: #6c757d;
    margin-right: 5px;
    font-weight: 500;
}

.partido-body {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Estilos para equipos */
.equipo-local, .equipo-visitante {
    display: flex;
    align-items: center;
    flex: 1;
}

.equipo-local {
    justify-content: flex-start;
}

.equipo-visitante {
    justify-content: flex-end;
}

.mi-equipo {
    font-weight: 700;
}

.escudo-equipo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.equipo-local .escudo-equipo {
    margin-right: 10px;
}

.equipo-visitante .escudo-equipo {
    margin-left: 10px;
}

.nombre-equipo {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Estilos para el resultado */
.resultado-partido {
    min-width: 90px;
    text-align: center;
    position: relative;
    z-index: 5;
}

.resultado-final {
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: inline-block;
}

.vs-partido {
    color: #6c757d;
    font-weight: 600;
    font-size: 16px;
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px dashed #ced4da;
}

.partido-footer {
    padding: 12px 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #6c757d;
}

.fecha-hora {
    margin-bottom: 5px;
}

    .fecha-hora i, .estadio i {
        width: 16px;
        text-align: center;
        margin-right: 5px;
    }

.btn-toggle-details {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    color: #3d4c54;
    padding: 5px;
}

    .btn-toggle-details:hover {
        background-color: #f8f9fa;
    }

.partido-details {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    background-color: #f8f9fa;
    font-size: 13px;
}

.detail-row {
    margin-bottom: 5px;
}

/* ====================
   VISTA DE TABLA
   ==================== */

.calendario-table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
}

    .calendario-table thead th {
        background-color: #f8f9fa;
        color: #495057;
        font-weight: 600;
        font-size: 13px;
        border-bottom: 2px solid #dee2e6;
    }

    .calendario-table .escudo-tabla {
        width: 30px;
        height: 30px;
        object-fit: contain;
    }

.fila-destacada {
    background-color: rgba(255, 243, 205, 0.2) !important;
}

.resultado-tabla {
    font-weight: 700;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    background-color: #343a40;
    color: white;
}

/* ==============================
   ESTILOS COMPARTIDOS PARA AMBAS VISTAS
   ============================== */

/* Etiqueta de resultado en la esquina */
.etiqueta-resultado {
    position: absolute;
    top: 0;
    right: 0;
    padding: 5px 10px;
    color: white;
    font-weight: bold;
    z-index: 10;
    border-bottom-left-radius: 8px;
}

/* Clases para colores de resultados */
.resultado-victoria,
.etiqueta-victoria,
.resultado-tabla.victoria {
    background-color: #28a745 !important;
}

.resultado-derrota,
.etiqueta-derrota,
.resultado-tabla.derrota {
    background-color: #dc3545 !important;
}

.resultado-empate,
.etiqueta-empate,
.resultado-tabla.empate {
    background-color: #6c757d !important;
}

.resultado-neutral {
    background-color: #343a40 !important;
}

/* Bordes según resultado */
.partido-victoria {
    border-top: 4px solid #28a745 !important;
}

.partido-derrota {
    border-top: 4px solid #dc3545 !important;
}

.partido-empate {
    border-top: 4px solid #6c757d !important;
}

/* Badges de estado */
.badge {
    font-size: 85%;
    font-weight: 500;
    padding: 0.25em 0.6em;
}

.badge-finalizado {
    background-color: #28a745;
    color: white;
}

.badge-pendiente {
    background-color: #6c757d;
    color: white;
}

.badge-proximo {
    background-color: #17a2b8;
    color: white;
}

/* Botón para crónica */
.btn-cronica {
    display: inline-block;
    background-color: #3d4c54;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

    .btn-cronica:hover {
        background-color: #2a3439;
        text-decoration: none;
        color: #fff;
    }

    .btn-cronica i {
        margin-right: 5px;
    }

/* Animaciones */
@keyframes resaltar {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.resultado-destacado {
    animation: resaltar 0.5s ease-out;
}

/* Estilos responsivos */
@media (max-width: 767px) {
    .partidos-container {
        grid-template-columns: 1fr;
    }

    .vista-selector {
        float: none;
        margin-top: 15px;
    }

    .equipo-local .nombre-equipo,
    .equipo-visitante .nombre-equipo {
        font-size: 12px;
        max-width: 90px;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 374px) {
    .escudo-equipo {
        width: 40px;
        height: 40px;
    }

    .nombre-equipo {
        font-size: 11px;
        max-width: 70px;
    }

    .resultado-final {
        font-size: 16px;
        padding: 6px 10px;
    }
}
