/*
-----------------------------------------------------------
ESTILOS
-----------------------------------------------------------
*/

body {
    background-color: #1c1c1c;
    color: #fff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

header {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    padding: 20px;
    background-color: #000;
    color: #ffe81f;
    letter-spacing: 2px;
}

h4 {
    color: #2c3e50;
    border-bottom: 3px solid #474444;
}

/*
-----------------------------------------------------------
ESTILO PARA LAYOUT PRINCIPAL 
Donde se muestran botones de búsqueda
-----------------------------------------------------------
*/


.controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 10px;

}

/*
-----------------------------------------------------------
ESTILO PARA SELECT Y BOTON DE BÚSQUEDA
-----------------------------------------------------------
*/

select,
input[type="text"],
.button-yellow {
    padding: 10px;
    border-radius: 5px;
    border: none;
    font-size: 1rem;
}

.button-yellow {
    background-color: #ffe81f;
    color: #1b1a1a;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.button-yellow:hover {
    background-color: #ffcc00;
}



.consultas {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    border-radius: 5px;
    border: 2px solid #ffe81f;
    background-color: #2c2c2c;
    /* Para que resalte el borde */
}

.consultas span {
    font-size: 1rem;
    color: white;
}

.consultas strong {
    padding: 10px;
    font-size: 2rem;
    font-weight: 600;
    color: #ffe81f;
    line-height: 1;
}


/*
-----------------------------------------------------------
ESTILO PARA LAYOUT PARA MOSTRAR: 
LAS CARDS en Sidebar
DETALLES en zona central
-----------------------------------------------------------
*/

.stats-layout-contenedor {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 20px;
}

.sidebar-items {
    flex: 0 0 300px;
    /*grow,shrink,basis (0,0,250)*/
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background: #474444;
    padding: 10px;
    margin-left: 10px;
    border-radius: 12px;
}

.detalle-seccion {
    flex: 1;
    overflow-y: auto;
    margin-right: 10px;
    background: #474444;
    border-radius: 12px;
    height: 55vh;
    /* Para que la lista tenga scroll propio */
}

/*
-----------------------------------------------------------
ESTILO PARA LAYOUT PARA STATS-CONTENEDOR: 
KPI-GRID => contiene las kpi-cards
-----------------------------------------------------------
*/
.stats-contenedor {
    padding: 20px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.kpi-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-top: 6px solid #34495e;
    transition: var(--transicion-025);
}

.kpi-card.ganado {
    border-top-color: #27ae60;
}

.kpi-card.empate {
    border-top-color: #f1c40f;
}

.kpi-card.perdido {
    border-top-color: #e74c3c;
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-card.ganado:hover {
    border-top-color: #27ae60;
    background: #27ae60;
}

.kpi-card.empate:hover {
    border-top-color: #f1c40f;
    background: #f1c40f;
}

.kpi-card.perdido:hover {
    border-top-color: #e74c3c;
    background: #e74c3c;
}

.kpi-titulo {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.kpi-valor {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.kpi-card.ganado:hover .kpi-titulo,
.kpi-card.empate:hover .kpi-titulo,
.kpi-card.perdido:hover .kpi-titulo {
    color: var(--color-texto-blanco);
}

/*
-----------------------------------------------------------
ESTILO PARA LAYOUT PARA DETALLES-GRID: 
STATS-INFO => todas las filas con toda la información
INFO-FILA => cada fila tiene su estilo
-----------------------------------------------------------
*/
.detalles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stats-info {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.info-fila {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-fila span {
    color: #2c3e50;
}

.info-fila strong {
    color: #2c3e50;
}


#cargando {
    display: none;
}




/*
-----------------------------------------------------------
ESTILO PARA CARDS DE CLIMA
-----------------------------------------------------------
*/

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.card {
    background-color: #2c2c2c;
    margin: 10px;
    padding: 15px;
    border-radius: 10px;
    width: 250px;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 232, 31, 0.3);
}

.card h2 {
    color: #ffe81f;
    margin-top: 5px;
}

.card small {
    display: block;
    margin-top: 5px;
}

.card-title-link {
    color: #ffe81f;
    text-decoration: underline;
    font-size: 0.9rem;
}

/* Contenedor para alinear Título e Icono */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    /* Espacio entre el texto y el icono */
    border-bottom: 1px solid rgba(255, 232, 31, 0.2);
    /* Línea divisoria sutil */
    margin-bottom: 10px;
}

.card-header h3 {
    color: #ffe81f;
    /* Mismo amarillo que tus h2 */
    margin: 0;
    font-size: 1.2rem;
}

.card-header img {
    width: 45px;
    /* Tamaño ideal para que no rompa el diseño */
    height: 45px;
    filter: drop-shadow(0 0 5px rgba(255, 232, 31, 0.5));
    /* Brillo amarillo al icono */
}


/*
-----------------------------------------------------------
RESPONSIVE
-----------------------------------------------------------
*/
/* Media Query para móviles y tablets */
@media (max-width: 768px) {
    .stats-layout-contenedor {
        flex-direction: column; 
        height: auto;           
        align-items: center;    
        gap: 20px;
    }

    .sidebar-items {
        flex: 0 0 auto;         /* Deja que el ancho sea automático */
        width: 90%;             
        margin-left: 0;         
    }

    .detalle-seccion {
        width: 90%;             
        margin-right: 0;        
        height: auto;           
        overflow-y: visible;    
    }
}