::-webkit-scrollbar { width: 8px; } 
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; } 
::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; } 
::-webkit-scrollbar-thumb:hover { background: #555; }

.forecast-container::-webkit-scrollbar { display: none; }
.forecast-container { 
    -ms-overflow-style: none;  
    scrollbar-width: none;  
    scroll-snap-type: x mandatory;  
    scroll-padding-left: 0.5rem;  
}

.forecast-card { scroll-snap-align: start; }
.gauge-container { height: 320px; }

.efemerides-seccion { 
    margin-top: 20px; 
    padding-top: 20px; 
    border-top: 1px solid #e5e7eb; 
}
.efemerides-seccion h4 { 
    font-size: 1.1em; 
    font-weight: 600; 
    color: #4b5563; 
    margin-bottom: 10px; 
}

.efemerides-lista { 
    list-style: none; 
    padding-left: 0; 
}
.efemerides-lista li { 
    background-color: #f9fafb; 
    border-left: 4px solid #3b82f6; 
    padding: 12px; 
    margin-bottom: 8px; 
    border-radius: 0 4px 4px 0; 
}
.efemerides-lista .festivo-item { 
    border-left-color: #22c55e; 
}
.efemerides-lista strong { 
    display: block; 
    font-size: 1.05em; 
    color: #1f2937; 
}
.efemerides-lista small { 
    color: #6b7280; 
    display: block; 
    margin-top: 4px; 
    font-size: 0.8em; 
}
.efemerides-lista p { 
    margin: 8px 0 0 0; 
    color: #4b5563; 
    font-size: 0.9em; 
}

.efemerides-no-data { 
    color: #6b7280; 
    font-style: italic; 
    font-size: 0.9em; 
    padding: 10px 0; 
}

/* Estils per a les noves targetes agrícoles */
.cultiu-card {
    background-color: #f9f9f9;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    list-style: none;
    transition: box-shadow 0.2s ease-in-out;
}

.cultiu-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.cultiu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cultiu-icon {
    font-size: 1.8rem;
}

.cultiu-info {
    display: flex;
    flex-direction: column;
}

.tipus-badge {
    font-size: 0.75rem;
    background-color: #e0e7ff;
    color: #4f46e5;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    width: fit-content;
}

.cultiu-dates {
    display: block;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 8px;
}

.consell-toggle {
    background: none;
    border: 1px solid #d1d5db;
    color: #4b5563;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.consell-toggle:hover {
    background-color: #f3f4f6;
}

.consell-text {
    font-size: 0.85rem;
    color: #374151;
    background-color: #f3f4f6;
    border-left: 3px solid #6366f1;
    padding: 10px;
    margin-top: 8px;
    border-radius: 4px;
}

/* Pots afegir això a la teva etiqueta <style> o fitxer CSS principal */

/* Estil base per a TOTS els botons de control */
.controls-button {
    background-color: #16a34a; /* Verd per defecte */
    color: white;
    font-weight: 600; /* semibold */
    padding: 0.5rem 1rem; /* py-2 px-4 */
    border-radius: 0.5rem; /* rounded-lg */
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}

.controls-button:hover {
    background-color: #15803d; /* Un verd una mica més fosc */
}

/* Estil específic per al botó de consultes fora de temporada */
#btn-show-all-crops {
    background-color: #6d28d9; /* Morat */
}

#btn-show-all-crops:hover {
    background-color: #5b21b6; /* Un morat una mica més fosc */
}

.controls-button:disabled {
    background-color: #9ca3af; /* Un color gris */
    cursor: not-allowed;
    opacity: 0.6;
}

/*
  Nova estructura per a la capçalera, per a solucionar
  el problema de l'amuntegament en pantalles petites.
*/

/*
===================================================================
= CSS per a solucionar l'amuntegament de botons en pantalles petites =
===================================================================
*/

/* Contenidor principal de la capçalera */
.header-container {
    display: flex;
    flex-direction: column; /* Per defecte (mòbil), apilem els elements verticalment */
    align-items: flex-start; /* Alineem tot a l'esquerra */
    gap: 1rem; /* Espai entre el títol i els botons */
}

/* Contenidor dels botons */
.header-controls {
    display: flex;
    flex-wrap: wrap; /* Permet que els botons passin a una nova línia si no caben */
    gap: 0.5rem; /* Espai entre els botons */
    width: 100%; /* Ocupa tota l'amplada en la vista mòbil */
    justify-content: flex-end; /* Alinea els botons a la dreta */
}

/* Media Query per a pantalles més grans (tauletes 768px i superiors) */
@media (min-width: 768px) {
    .header-container {
        flex-direction: row; /* En pantalles grans, tornem a la vista horitzontal */
        align-items: center; /* Centrem verticalment */
        justify-content: space-between; /* Títol a l'esquerra, botons a la dreta */
        gap: 2rem;
    }

    .header-controls {
        width: auto; /* L'amplada s'ajusta al contingut */
    }
}

.active-agri-button {
    background-color: #166534; /* Un verd més fosc per al botó actiu */
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.2);
}

/* ============================================= */
/* === ELS NOUS ESTILS PER AL MENÚ I LA CABECERA === */
/* ============================================= */

/* --- 1. CABECERA MÉS DISCRETA --- */
.header {
    /* Reduïm el padding vertical per a fer-la més baixa */
    padding: 10px 20px; 
}
.header .logo {
    /* Reduïm lleugerament el logo */
    width: 180px; 
}
.header .title {
    /* Reduïm la mida de la font del títol */
    font-size: 26px; 
}

/* --- 2. CONTINGUT OCULT PER DEFECTE --- */
.content-placeholder {
    text-align: center;
    padding: 80px 40px;
    background-color: #f8f9fa;
    border-radius: 15px;
    margin: 20px auto;
    max-width: 1400px;
}
.content-placeholder-icon {
    font-size: 50px;
    color: #007BFF;
    margin-bottom: 20px;
}
.content-placeholder-text {
    font-size: 1.2rem;
    color: #555;
    font-weight: 500;
}

/* Ocultem els iframes per defecte */
#forecastContainer, .iframe-container, #xarxaFijaContainer {
    display: none;
}


/* --- 3. MENÚ REORGANITZAT AMB SUBMENÚS --- */
.participation-zone {
    border-top: 2px solid #e2e8f0;
    margin-top: 20px;
    padding-top: 15px;
}
.participation-zone h3 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}
.participation-desc {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
}

.submenu-container {
    position: relative;
    display: inline-block;
}

.submenu-container .arrow {
    font-size: 0.8em;
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}

.submenu-container.open .arrow {
    transform: rotate(180deg);
}

.submenu-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100;
    border-radius: 8px;
    padding: 8px 0;
    /* Ara es posiciona a sota per defecte */
    top: 110%; 
    left: 0;
}

.submenu-content.show {
    display: block;
}

.submenu-button {
    color: #2d3748;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

.submenu-button:hover {
    background-color: #f1f1f1;
}