/* Stili comuni per le pagine dei terreni Pianta.land */
/* Versione iniziale 2025-08-01 */

body {
    font-family: 'Lora', serif;
    font-size: 16px;
    color: #003300; /* Verde scuro */
}

table {
    border-collapse: collapse;
    margin: 20px auto;
}

table, th, td {
    border: 1px solid black;
}

th, td {
    width: 40px;
    height: 40px;
    text-align: center;
}

.logo {
    width: 40px;
    vertical-align: middle;
}

#legenda {
    list-style-type: none;
    padding: 0;
    clear: both;
}

.legenda {
    display: flex;
    width: 50px;
    height: 50px;
    margin-right: 5px;
    border: 1px solid black;
    text-align: center;
    vertical-align: middle;
    align-items: center;
    float: left;
}

ul#legenda > li {
    clear: both;
    float: none;
    height: 100px;
}

.legenda span {
    margin: 0 auto;
}

/* Stati degli alberi */
.albero-0 {
    background-color: white;
    color: maroon;
}

.albero-1 {
    background-color: yellow;
}

.albero-2 {
    background-color: green;
    color: white;
}

.albero-3 {
    background-color: blue;
    color: white;
}

.albero-4 {
    background-color: red;
    color: white;
}

.albero-fruttificato {
    background-color: #ffb6d5 !important; /* rosa pastello */
}

/* Immagini */
#mandorletoImage {
    width: 100%;
    height: auto;
}

#mandorletoImage50 {
    width: 49%;
    height: auto;
}

#mandorletoImage30 {
    width: 33%;
    height: auto;
}

#alberetoImage {
    width: 100%;
    height: auto;
}

#alberetoImage50 {
    width: 49%;
    height: auto;
}

#alberetoImage30 {
    width: 33%;
    height: auto;
}


.fluid {
    float: left;
    width: 50%;
}

/* Container e layout */
.terreno-container {
    overflow-x: auto;
    position: relative;
    margin: 20px 0;
}

.scroll-indicator {
    margin: 10px 0;
}

.scroll-indicator button {
    padding: 10px 20px;
    margin: 0 5px;
    cursor: pointer;
}

/* Sprite del contadino - VERSIONE AVANZATA 2.0 */
.sprite {
    position: absolute;
    width: 60px; /* Aumentato da 40px a 60px */
    height: 60px; /* Aumentato da 40px a 60px */
    background-image: url('../contadino.gif');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 100;
    pointer-events: auto; /* Cambiato da none a auto per permettere i click */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    cursor: pointer; /* Cursore pointer per indicare che è cliccabile */
    /* Posizione di default per assicurarsi che sia visibile */
    left: 100px;
    top: 100px;
}

/* Stato di selezione del contadino */
.sprite.selezionato {
    border: 3px solid #FFD700; /* Bordo dorato quando selezionato */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); /* Aura dorata */
    transform: scale(1.1); /* Leggermente più grande quando selezionato */
    z-index: 1000; /* Z-index più alto quando selezionato */
}

/* Stati del contadino */
.sprite.camminando {
    animation: camminata 0.8s infinite alternate;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)) brightness(1.1);
}

.sprite.lavorando {
    animation: lavoro 1.2s infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)) hue-rotate(15deg);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.sprite.riposando {
    animation: respiro 2s infinite ease-in-out;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)) saturate(0.8);
}

.sprite.felice {
    animation: salto 0.6s infinite alternate;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)) brightness(1.2) saturate(1.3);
}

/* Animazioni avanzate */
@keyframes camminata {
    0% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-2px) rotate(0deg); }
    100% { transform: translateY(0px) rotate(2deg); }
}

@keyframes lavoro {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes respiro {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes salto {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-8px) scale(1.1); }
}

/* Particelle di lavoro */
.particelle-lavoro {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    animation: particella 1.5s ease-out forwards;
    box-shadow: 0 0 8px #ffd700, 0 0 16px #ffed4e;
}

@keyframes particella {
    0% {
        opacity: 1;
        transform: scale(0) translateY(0);
    }
    50% {
        opacity: 0.8;
        transform: scale(1) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-40px);
    }
}

/* Scia del contadino */
.scia-contadino {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(139,69,19,0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 98;
}

/* Responsive per mobile - linguetta contadino */
@media (max-width: 768px) {
    #linguetta-contadino {
        width: 60px !important;
        height: 60px !important;
        font-size: 28px !important;
        top: 15px !important;
        right: 15px !important;
    }
    
    #pannello-contadino {
        top: 15px !important;
        right: 15px !important;
        min-width: 250px !important;
        max-width: calc(100vw - 30px) !important;
    }
    
    #pannello-contadino button {
        padding: 12px 16px !important;
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
}

/* Particelle per interazione con gli alberi */
.particella-foglia {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    animation: foglia 3s ease-out forwards;
    box-shadow: 0 0 6px #4CAF50;
}

.particella-fiore {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #E91E63, #FF5722);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    animation: fiore 4s ease-out forwards;
    box-shadow: 0 0 8px #E91E63;
}

.particella-cura {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #2196F3, #03A9F4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    animation: cura 2.5s ease-out forwards;
    box-shadow: 0 0 6px #2196F3;
}

.particella-tristezza {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #9C27B0, #673AB7);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    animation: tristezza 2s ease-out forwards;
    box-shadow: 0 0 6px #9C27B0;
}

/* Messaggi degli alberi */
.messaggio-albero {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    transform: translateX(-50%);
    animation: messaggio 3s ease-out forwards;
}

/* Animazioni per le particelle */
@keyframes foglia {
    0% {
        opacity: 1;
        transform: scale(0) translateY(0) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1) translateY(-30px) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-60px) rotate(360deg);
    }
}

@keyframes fiore {
    0% {
        opacity: 1;
        transform: scale(0) translateY(0) rotate(0deg);
    }
    30% {
        opacity: 1;
        transform: scale(1.2) translateY(-20px) rotate(120deg);
    }
    70% {
        opacity: 0.8;
        transform: scale(1) translateY(-40px) rotate(240deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-80px) rotate(360deg);
    }
}

@keyframes cura {
    0% {
        opacity: 1;
        transform: scale(0) translateY(0);
    }
    50% {
        opacity: 0.9;
        transform: scale(1) translateY(-25px);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-50px);
    }
}

@keyframes tristezza {
    0% {
        opacity: 1;
        transform: scale(0) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-30px);
    }
}

@keyframes messaggio {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Evidenziazione cella contadino */
.cella-evidenziata-contadino {
    position: relative;
    animation: evidenzia-cella 2s infinite alternate;
    z-index: 10;
}

/* Stili per celle raggiungibili dal contadino */
.cella-raggiungibile {
    border: 3px solid #4CAF50 !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6) !important;
    background: rgba(76, 175, 80, 0.1) !important;
    animation: pulsazione-verde 1.5s infinite;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cella-raggiungibile:hover {
    background: rgba(76, 175, 80, 0.2) !important;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8) !important;
    transform: scale(1.02);
}

.cella-evidenziata-contadino::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 3px solid #FF5722;
    border-radius: 4px;
    animation: pulsazione-bordo 1s infinite;
    z-index: 11;
}

@keyframes evidenzia-cella {
    0% {
        box-shadow: 0 0 20px rgba(255, 87, 34, 0.6);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 87, 34, 0.8);
        transform: scale(1.05);
    }
}

@keyframes pulsazione-bordo {
    0% {
        border-color: #FF5722;
        opacity: 1;
    }
    50% {
        border-color: #FF9800;
        opacity: 0.7;
    }
    100% {
        border-color: #FF5722;
        opacity: 1;
    }
}

@keyframes scia {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Indicatore di stato */
.indicatore-stato-contadino {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 101;
}

.indicatore-stato-contadino.visibile {
    opacity: 1;
}

/* Effetti di luce */
.sprite::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.sprite.lavorando::before {
    opacity: 1;
    animation: luce-lavoro 1.2s infinite;
}

@keyframes luce-lavoro {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

@keyframes pulsazione-verde {
    0% {
        border-color: #4CAF50;
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
    }
    50% {
        border-color: #66BB6A;
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
    }
    100% {
        border-color: #4CAF50;
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
    }
}

@keyframes pointsBounce {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Assicura che la tabella abbia position relative per le particelle */
#alberetoTable {
    position: relative !important;
}

/* Stili per la cronologia meteo */
.cronologia-meteo {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.eventi-meteo-lista {
    max-height: 300px;
    overflow-y: auto;
    margin: 10px 0;
}

.evento-meteo {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background-color: white;
    border-radius: 5px;
    border-left: 4px solid #4CAF50;
}

.evento-icona {
    font-size: 24px;
    margin-right: 15px;
    min-width: 30px;
}

.evento-dettagli {
    flex: 1;
}

.evento-data {
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.evento-descrizione {
    color: #666;
    font-size: 14px;
}

.btn-aggiungi-evento {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-aggiungi-evento:hover {
    background-color: #45a049;
}

/* Modal per aggiungere eventi */
.modal-evento-meteo {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.form-aggiungi-evento {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-salva {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-annulla {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-torna {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.riepilogo-meteo-completo {
    margin: 20px 0;
}

.sezione-meteo-attuale,
.sezione-cronologia-storica {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

/* FAQ e contenuti informativi */
.faq-container {
    margin: 20px 0;
}

.faq {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.faq h3 {
    color: #003300;
    margin-bottom: 15px;
}

/* Tabelle con stile aperto e bello (come la tabella dei costi) */
.table-container-beautiful {
    background-color: #f3eac5; /* Colore della terra */
    max-width: 100%;
    overflow: auto;
    border: 1px solid #d6d6d6;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-beautiful {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.table-beautiful th,
.table-beautiful td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.table-beautiful th {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-beautiful td {
    background-color: #fafafa;
    color: #333;
    font-size: 14px;
}

.table-beautiful tr:hover td {
    background-color: #f0f0f0;
    transition: background-color 0.2s ease;
}

/* Tabelle prezzi (mantenuto per compatibilità) */
.prices-container {
    margin: 20px 0;
    overflow-x: auto;
}

#tblProspettivaPrezzi {
    width: 100%;
    border-collapse: collapse;
}

#tblProspettivaPrezzi th,
#tblProspettivaPrezzi td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

#tblProspettivaPrezzi th {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .fluid {
        width: 100%;
        float: none;
    }
    
    #mandorletoImage50 {
        width: 100%;
        margin-bottom: 10px;
    }
    
    #mandorletoImage30 {
        width: 100%;
        margin-bottom: 10px;
    }

    #alberetoImage50 {
        width: 100%;
        margin-bottom: 10px;
    }
    
    #alberetoImage30 {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .form-aggiungi-evento {
        width: 95%;
        margin: 2% auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* Responsive per tabelle belle */
    .table-container-beautiful {
        padding: 10px;
        margin: 15px 0;
        /* Mantiene la leggibilità su mobile */
        min-width: 100%;
        overflow-x: auto;
        /* Scroll orizzontale fluido */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .table-container-beautiful::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-container-beautiful::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-container-beautiful::-webkit-scrollbar-thumb {
        background: #4CAF50;
        border-radius: 4px;
    }
    
    .table-beautiful {
        /* Mantiene la larghezza minima per leggibilità */
        min-width: 600px;
        /* Assicura che la tabella non si comprima troppo */
        table-layout: fixed;
    }
    
    .table-beautiful th,
    .table-beautiful td {
        padding: 8px 6px;
        font-size: 13px;
        /* Mantiene la leggibilità del testo */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .table-beautiful th {
        font-size: 12px;
        letter-spacing: 0.3px;
        /* Header sempre visibile */
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* Per schermi molto piccoli */
    @media (max-width: 480px) {
        .table-container-beautiful {
            padding: 5px;
            margin: 10px 0;
        }
        
        .table-beautiful th,
        .table-beautiful td {
            padding: 6px 4px;
            font-size: 12px;
        }
        
        .table-beautiful th {
            font-size: 11px;
        }
    }
}

/* Loading states */
#alberetoTableLoading,
#maintenanceTableLoading {
    text-align: center;
    padding: 20px;
    font-weight: bold;
    color: #666;
}

.popup-close {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.margin-top {
    margin-top: 20px;
}

.margin-bottom {
    margin-bottom: 20px;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
} 

.stopfluid {
    clear:both;
    float:none;
}
.faq h3 {
    font-size: 1.5em;
    font-weight: bold;
    color: #300101; /* Colore del testo delle domande */
}
.faq h3::before {
    content: "❓"; /* Icona del punto interrogativo */
    margin-right: 10px;
}
.faq p {
    font-size: 1em;
    color: #666; /* Colore del testo delle risposte */
}
.faq {
    background-color: #f9f9f9; /* Colore di sfondo per separare domande e risposte */
    padding: 10px;
    margin: 10px 0;
}
.properties-container {
    background-color: #f3eac5; /* Colore della terra */
    max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
    overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
    border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
    padding: 10px; /* Spazio intorno al contenitore */
    border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
    margin: 20px 5px; /* Posiziona il contenitore al centro della pagina */
}

/* ===== PROPERTIES CONTAINER MIGLIORATO ===== */

/* Versione migliorata del properties-container */
.properties-container-improved {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px; /* Ripristinato padding per spazio interno */
    margin: 20px 5px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    overflow-x: auto; /* Scrollbar orizzontale sul container principale */
    overflow-y: hidden;
}

.properties-container-improved h2 {
    color: #2c3e50;
    margin: 20px 20px 20px 20px; /* Padding compensato dal container */
    font-size: 1.5em;
    text-align: center;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* Wrapper interno per scroll orizzontale */
.properties-table-wrapper {
    min-width: 600px; /* Larghezza minima per evitare compressione */
    width: 100%;
    overflow: visible; /* Nessuno scroll interno */
}



/* Tabella migliorata */
.properties-table-improved {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    min-width: 600px;
}

/* Rimuove tutti i bordi predefiniti del browser */
.properties-table-improved,
.properties-table-improved th,
.properties-table-improved td {
    border: none !important;
    outline: none !important;
}

/* Forza la rimozione di tutti i bordi anche se ereditati */
.properties-table-improved table,
.properties-table-improved table td,
.properties-table-improved table th {
    border: none !important;
    outline: none !important;
}

/* Rimuove bordi specifici delle celle */
.properties-table-improved td {
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    text-align: left !important;
}

.properties-table-improved tr {
    transition: all 0.2s ease;
}

.properties-table-improved tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.6);
}

.properties-table-improved tr:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: translateX(5px);
}

.properties-table-improved td {
    padding: 12px 15px;
    vertical-align: top;
    white-space: nowrap;
}

.properties-table-improved td:first-child {
    font-weight: 600;
    color: #2c3e50;
    width: 35%;
    position: relative;
    min-width: 200px;
}

.properties-table-improved td:last-child {
    color: #34495e;
    width: 65%;
    min-width: 300px;
}

/* Indicatore laterale */
.properties-table-improved td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 2px;
}

/* Icone tematiche */
.property-icon-small {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
}

.icon-terrain { background: #8B4513; color: white; }
.icon-owner { background: #2E86AB; color: white; }
.icon-characteristics { background: #F18F01; color: white; }
.icon-varieties { background: #4CAF50; color: white; }
.icon-age { background: #FF9800; color: white; }
.icon-co2 { background: #2196F3; color: white; }
.icon-altitude { background: #9C27B0; color: white; }
.icon-weather { background: #00BCD4; color: white; }
.icon-forecast { background: #FF5722; color: white; }
.icon-contact { background: #607D8B; color: white; }

/* Icone dettaglio standardizzate */
.detail-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    vertical-align: middle;
}

.detail-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.detail-info { background: #2196F3; color: white; }
.detail-weather { background: #00BCD4; color: white; }
.detail-forecast { background: #FF5722; color: white; }
.detail-maps { background: #4CAF50; color: white; }

/* Stili per valori dinamici */
.value-dynamic {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
    display: inline-block;
}

.value-weather {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 3px solid #2196F3;
    display: inline-block;
}

.value-forecast {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 3px solid #e91e63;
    display: inline-block;
}

/* Stile per previsioni compatte */
.previsione-compatta {
    font-size: 0.9em;
    color: #2c3e50;
    line-height: 1.4;
}

.nessuna-pioggia {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
}

/* ===== RESPONSIVE DESIGN PER PROPERTIES CONTAINER ===== */

/* Tablet (≤768px) */
@media (max-width: 768px) {
    .properties-table-wrapper {
        min-width: 500px;
    }

    .properties-table-improved {
        min-width: 500px;
    }

    .properties-table-improved td:first-child {
        min-width: 180px;
    }

    .properties-table-improved td:last-child {
        min-width: 250px;
    }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .properties-container-improved {
        overflow: visible;
        padding: 20px; /* Ripristina padding su mobile per layout a colonne */
    }

    .properties-table-wrapper {
        display: none;
    }

    .properties-mobile {
        display: block;
    }

    .property-mobile-item {
        background: white;
        border-radius: 8px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow: hidden;
    }

    .property-mobile-item:nth-child(odd) {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    }

    .property-mobile-item:nth-child(even) {
        background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
    }

    .property-mobile-label {
        background: linear-gradient(135deg, #4CAF50, #45a049);
        color: white;
        padding: 12px 15px;
        font-weight: 600;
        font-size: 0.95em;
        display: flex;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .property-mobile-value {
        padding: 15px;
        color: #2c3e50;
        font-size: 0.9em;
        line-height: 1.5;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .property-mobile-value .value-content {
        flex: 1;
    }

    .property-mobile-value .detail-icon {
        margin-left: 12px;
        flex-shrink: 0;
    }
}

/* Desktop (>480px) - Nasconde layout mobile */
@media (min-width: 481px) {
    .properties-mobile {
        display: none;
    }
}

/* ===== STILI PER SIDEBAR SECTIONS ===== */

/* Sezioni sidebar (Legenda e Costo usufrutto) */
.sidebar-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 5px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border: 2px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

/* Effetto bordo colorato per la legenda */
.sidebar-section:first-child {
    border-left: 4px solid #4CAF50;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5e8 100%);
}

/* Effetto bordo colorato per il costo usufrutto */
.sidebar-section:last-child {
    border-left: 4px solid #2196F3;
    background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
}

.sidebar-section h2 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Bordo inferiore personalizzato per la legenda */
.sidebar-section:first-child h2 {
    border-bottom: 3px solid #4CAF50;
}

/* Bordo inferiore personalizzato per il costo usufrutto */
.sidebar-section:last-child h2 {
    border-bottom: 3px solid #2196F3;
}

.sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-section li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.sidebar-section li:hover {
    background: rgba(255,255,255,0.5);
    padding-left: 10px;
    border-radius: 8px;
}

.sidebar-section li:last-child {
    border-bottom: none;
}

.sidebar-section p {
    margin: 10px 0;
    line-height: 1.6;
    color: #34495e;
    font-size: 0.95em;
}

.sidebar-section strong {
    color: #2c3e50;
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* ===== SIDEBAR CONTAINER ===== */

/* Container principale per le sidebar sections */
.sidebar-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

/* ===== INDICATORI SCROLL ===== */

/* Indicatore scroll per properties-container (desktop) */
.scroll-indicator#scroll-indicator-desktop {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #2196F3;
    border-radius: 8px;
    padding: 12px 0px 10px 0px;
    margin: 15px 20px 15px 0; /* Margine destro 20px per compensare padding container */
    text-align: center;
    color: #1565c0;
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    display: none; /* Nascosto di default */
}

/* Mostra solo quando lo scroll è necessario */
.scroll-indicator#scroll-indicator-desktop.visible {
    display: block;
}

/* Nascondi completamente su mobile */
@media (max-width: 480px) {
    .scroll-indicator#scroll-indicator-desktop {
        display: none !important;
    }
}

/* Indicatore scroll per terreno-container (sempre visibile) */
.scroll-indicator#scroll-indicator-terreno {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 10px 0;
    margin: 15px 0;
    text-align: center;
    color: inherit;
    box-shadow: none;
    display: block; /* Sempre visibile */
}

/* Pulsanti di navigazione terreno */
.btn-terreno-left {
    width: 49%;
    text-align: left;
    display: inline-block;
}

.btn-terreno-right {
    width: 49%;
    text-align: right;
    display: inline-block;
}

/* Stili moderni per i pulsanti di navigazione terreno */
.btn-terreno-left button,
.btn-terreno-right button {
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
    border: none;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-terreno-left button:hover,
.btn-terreno-right button:hover {
    background: linear-gradient(135deg, #FF5722, #FF9800);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-terreno-left button:active,
.btn-terreno-right button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.4);
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .btn-terreno-left button,
    .btn-terreno-right button {
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 8px;
    }
}

.scroll-indicator strong {
    color: #0d47a1;
    font-weight: 600;
}


.maintenance-container {
    background-color: #f3eac5; /* Colore della terra */
    max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
    overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
    border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
    padding: 10px; /* Spazio intorno al contenitore */
    border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
    margin: 20px 5px; /* Posiziona il contenitore al centro della pagina */
}
.terreno-container {
    background-color: #f3eac5; /* Colore della terra */
    max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
    overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
    border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
    padding: 10px; /* Spazio intorno al contenitore */
    border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
    margin: 20px auto; /* Posiziona il contenitore al centro della pagina */
    position: relative;
}
.prices-container {
    background-color: #f3eac5; /* Colore della terra */
    max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
    overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
    border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
    padding: 10px; /* Spazio intorno al contenitore */
    border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
    margin: 20px 5px; /* Posiziona il contenitore al centro della pagina */
}
#alberetoTable {
    border-collapse: collapse;
    width: 100%; /* Rendi la tabella larga quanto il contenitore */
    /* Altri stili della tabella come border, font-size, ecc. */
}
#alberetoTable td.albero-0 {
    cursor:pointer;
}

/* Animazione di zoom */
.zoom-in {
    transform: scale(1.1); /* Ingrandisce il contenuto */
    transition: transform 0.3s;
}

/* Animazione di fading */
.fade-out {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Aggiungere uno stile per l'indicatore di scrolling */
.scroll-indicator {
    top: 0;
    left: 0;
    width: Calc(100% - 10px);
    background-color: #f1f1f1;
    display: block;
    /*justify-content: space-between;*/
    padding: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Stili generali per i pulsanti scroll-indicator (se non sono già personalizzati) */
.scroll-indicator button:not(.btn-terreno-left button):not(.btn-terreno-right button) {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scroll-indicator button:not(.btn-terreno-left button):not(.btn-terreno-right button):hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

#scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    padding: 18px 25px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    display: block;
    z-index: 1000;
    font-size: 1.2em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#scroll-to-top-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
}

#scroll-to-top-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

#scroll-to-top-btn span {
    display: none;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    #scroll-to-top-btn {
        bottom: 15px;
        right: 15px;
        left: 15px;
        padding: 20px 20px;
        font-size: 1.1em;
        border-radius: 12px;
    }
}

/* ===== POPUP STANDARDIZZATI ===== */
/* Stile standard per tutti i popup delle proprietà del terreno */
.popup-standard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-standard-content {
    background: #fff;
    max-width: 90vw;
    max-height: 80vh;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: auto;
}

.popup-standard-close {
    position: fixed; /* Cambiato da absolute a fixed per essere sempre visibile */
    top: 15px;
    right: 15px;
    font-size: 1.8em;
    background: rgba(255, 255, 255, 0.95); /* Sfondo semi-trasparente per visibilità */
    border: 2px solid #6c757d; /* Bordo per definire meglio il pulsante */
    cursor: pointer;
    color: #6c757d;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10000; /* Z-index alto per essere sempre sopra tutto */
    box-shadow: 0 2px 10px rgba(0,0,0,0.2); /* Ombra per definire meglio il pulsante */
}

.popup-standard-close:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.95); /* Sfondo più solido in hover */
    border-color: #dc3545; /* Bordo che cambia colore in hover */
    transform: scale(1.1); /* Leggero ingrandimento in hover */
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4); /* Ombra colorata in hover */
}

.popup-standard h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.popup-standard p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #34495e;
}

.popup-standard strong {
    color: #2c3e50;
}

/* Stili per il caricamento delle previsioni meteo */
.loading-container {
    text-align: center;
    padding: 40px 20px;
    color: #2c3e50;
}

.loading-spinner {
    font-size: 3em;
    margin-bottom: 20px;
    animation: spin 2s linear infinite;
}

.loading-note {
    font-size: 0.9em;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

p.footer{
    text-align: center;
}
/* Stili specifici per dispositivi mobili con larghezza massima di 767px */
@media (max-width: 767px) {
    .fluid {
        float: none;
        width: 100%;
    }
    .properties-container {
        background-color: #f3eac5; /* Colore della terra */
        max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
        overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
        border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
        padding: 0px; /* Spazio intorno al contenitore */
        border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
        margin: 0px 0px; /* Posiziona il contenitore al centro della pagina */
    }
    .maintenance-container {
        background-color: #f3eac5; /* Colore della terra */
        max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
        overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
        border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
        padding: 0px; /* Spazio intorno al contenitore */
        border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
        margin: 0px 0px; /* Posiziona il contenitore al centro della pagina */
    }
    .terreno-container {
        background-color: #f3eac5; /* Colore della terra */
        max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
        overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
        border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
        padding: 2px; /* Spazio intorno al contenitore */
        border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
        margin: 0px 0px; /* Posiziona il contenitore al centro della pagina */
        position: relative;
    }
    .prices-container {
        background-color: #f3eac5; /* Colore della terra */
        max-width: 100%; /* Assicurati che il contenitore si adatti alla larghezza dello schermo */
        overflow: auto; /* Abilita lo scrolling se la tabella è più grande del contenitore */
        border: 1px solid #d6d6d6; /* Aggiungi un bordo intorno al contenitore se necessario */
        padding: 0px; /* Spazio intorno al contenitore */
        border-radius: 5px; /* Bordo arrotondato per un aspetto migliore */
        margin: 0px 0px; /* Posiziona il contenitore al centro della pagina */
    }
    #alberetoImage50 {
        width: 100%;
    }
}

/* 🌧️ STILI PREVISIONI METEO - PRIORITÀ 0: MASSIMA URGENZA */

/* Container principale previsioni */
.previsioni-meteo {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.previsioni-meteo h4 {
    color: #2E7D32;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

/* Griglia giorni previsioni */
.giorno-previsione {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 12px;
    text-align: center;
}

.giorno-previsione:first-child {
    background: #fff3cd;
    border-color: #ffc107;
    font-weight: bold;
}

/* Header griglia */
.giorno-previsione:first-child::before {
    content: "Giorno";
    grid-column: 1;
    font-weight: bold;
    color: #856404;
}

.giorno-previsione:first-child::after {
    content: "Meteo";
    grid-column: 2;
    font-weight: bold;
    color: #856404;
}

.giorno-previsione:first-child .data-giorno::after {
    content: "Temp";
    display: block;
    font-weight: bold;
    color: #856404;
}

.giorno-previsione:first-child .precipitazioni::after {
    content: "Precip";
    display: block;
    font-weight: bold;
    color: #856404;
}

.giorno-previsione:first-child .prob-precipitazioni::after {
    content: "Prob%";
    display: block;
    font-weight: bold;
    color: #856404;
}

.giorno-previsione:first-child .vento::after {
    content: "Vento";
    display: block;
    font-weight: bold;
    color: #856404;
}

/* Elementi griglia */
.data-giorno {
    font-weight: bold;
    color: #2E7D32;
}

.icona-meteo {
    font-size: 16px;
}

.temperature {
    font-weight: bold;
    color: #d32f2f;
}

.precipitazioni {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

.precipitazioni-assente {
    background-color: #e8f5e8;
    color: #2E7D32;
}

.precipitazioni-leggera {
    background-color: #fff3cd;
    color: #856404;
}

.precipitazioni-moderata {
    background-color: #f8d7da;
    color: #721c24;
}

.precipitazioni-forte {
    background-color: #f5c6cb;
    color: #721c24;
}

.prob-precipitazioni {
    color: #1976d2;
    font-weight: bold;
}

.vento {
    color: #6c757d;
    font-size: 11px;
}

/* Bottone dashboard */
.btn-dashboard {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-dashboard:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Dashboard previsioni overlay */
.dashboard-previsioni-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.dashboard-previsioni-content {
    background: white;
    border-radius: 15px;
    max-width: 95%;
    max-height: 95%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

.dashboard-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-header h3 {
    margin: 0;
    font-size: 24px;
}

.close-dashboard {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-dashboard:hover {
    background: rgba(255,255,255,0.3);
}

/* Sezioni dashboard */
.sezione-impatto-agricolo,
.sezione-previsioni-orarie,
.sezione-raccomandazioni {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.sezione-impatto-agricolo h4,
.sezione-previsioni-orarie h4,
.sezione-raccomandazioni h4 {
    color: #2E7D32;
    margin: 0 0 15px 0;
    font-size: 20px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 8px;
}

/* Impatto agricolo */
.impatto-basso {
    background: #e8f5e8;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 15px;
}

.impatto-medio {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
}

.impatto-alto {
    background: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 15px;
}

.livello-urgenza {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
}

.impatto-basso .livello-urgenza {
    background: #4CAF50;
    color: white;
}

.impatto-medio .livello-urgenza {
    background: #ffc107;
    color: #856404;
}

.impatto-alto .livello-urgenza {
    background: #dc3545;
    color: white;
}

.raccomandazioni-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.raccomandazioni-lista li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    line-height: 1.4;
}

.raccomandazioni-lista li:last-child {
    border-bottom: none;
}

/* Timeline oraria */
.timeline-oraria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ora-previsione {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-size: 11px;
    display: grid;
    grid-template-rows: auto auto auto auto auto auto auto;
    gap: 2px;
}

.ora-previsione .ora {
    font-weight: bold;
    color: #2E7D32;
    background: #e8f5e8;
    padding: 2px;
    border-radius: 3px;
}

.ora-previsione .icona {
    font-size: 14px;
}

.ora-previsione .temp {
    font-weight: bold;
    color: #d32f2f;
}

.ora-previsione .precip {
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 3px;
    font-size: 10px;
}

.ora-previsione .prob {
    color: #1976d2;
    font-size: 10px;
}

.ora-previsione .vento {
    color: #6c757d;
    font-size: 10px;
}

.ora-previsione .umidita {
    color: #6c757d;
    font-size: 10px;
}

/* Raccomandazioni agricole */
.raccomandazioni-agricole {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.trend-settimanale,
.raccomandazioni-mandorle,
.piano-settimanale {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.trend-settimanale h5,
.raccomandazioni-mandorle h5,
.piano-settimanale h5 {
    color: #2E7D32;
    margin: 0 0 10px 0;
    font-size: 16px;
    border-bottom: 1px solid #4CAF50;
    padding-bottom: 5px;
}

.trend-settimanale p,
.raccomandazioni-mandorle p {
    margin: 5px 0;
    line-height: 1.4;
}

.piano-settimanale ul {
    margin: 10px 0;
    padding-left: 20px;
}

.piano-settimanale li {
    margin: 8px 0;
    line-height: 1.4;
}

/* Stati di caricamento e errore */
.loading {
    color: #1976d2;
    font-style: italic;
}

.error {
    color: #d32f2f;
    font-weight: bold;
}

/* Responsive design per previsioni */
@media (max-width: 768px) {
    .giorno-previsione {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        font-size: 10px;
    }
    
    .timeline-oraria {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    
    .ora-previsione {
        font-size: 9px;
        padding: 4px;
    }
    
    .dashboard-previsioni-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .dashboard-header {
        border-radius: 0;
    }
}

/* 🌧️ STILI PER PREVISIONI ESTESE E GIORNI CON PIOGGIA */

/* Evidenziazione giorni con pioggia */
.giorno-pioggia {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    border: 2px solid #2196f3 !important;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.giorno-pioggia .data-giorno {
    color: #1565c0 !important;
}

.giorno-pioggia .precipitazioni {
    background: #2196f3 !important;
    color: white !important;
    font-weight: bold;
}

/* Sezione nessuna pioggia prevista */
.nessuna-pioggia {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.nessuna-pioggia p {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #e65100;
    font-weight: 500;
}

/* Pulsante dettaglio previsioni */
.btn-dettaglio-previsioni {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-dettaglio-previsioni:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.btn-dettaglio-previsioni:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

/* Header sezione previsioni giornaliere con pulsante aiuto */
.header-sezione-giornaliera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.header-sezione-giornaliera h4 {
    margin: 0;
    color: #2E7D32;
    font-size: 20px;
}

/* Pulsante aiuto previsioni */
.btn-aiuto-previsioni {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.btn-aiuto-previsioni:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
}

/* Overlay aiuto previsioni */
.aiuto-previsioni-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    overflow-y: auto;
}

.aiuto-previsioni-content {
    position: relative;
    max-width: 900px;
    margin: 50px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.aiuto-header {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aiuto-header h2 {
    margin: 0;
    font-size: 28px;
}

.btn-close-aiuto {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.btn-close-aiuto:hover {
    background: rgba(255, 255, 255, 0.2);
}

.aiuto-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.sezione-aiuto {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #2196f3;
}

.sezione-aiuto h3 {
    margin: 0 0 15px 0;
    color: #1976d2;
    font-size: 20px;
}

/* Grid icone aiuto */
.grid-icone-aiuto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.icona-aiuto {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.icona-aiuto span {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.icona-aiuto p {
    margin: 0;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Grid precipitazioni aiuto */
.grid-precipitazioni-aiuto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.precip-aiuto {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
}

.precip-aiuto span {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

.precip-aiuto p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

/* Range temperature */
.range-temperature {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.range-temperature span {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f0f0f0;
    color: #333;
}

.temp-fredda { background: #e3f2fd !important; color: #1565c0 !important; }
.temp-fresca { background: #e8f5e8 !important; color: #2e7d32 !important; }
.temp-mite { background: #fff3e0 !important; color: #f57c00 !important; }
.temp-calda { background: #ffebee !important; color: #c62828 !important; }
.temp-torrida { background: #fce4ec !important; color: #ad1457 !important; }

/* Livelli probabilità */
.livelli-probabilita {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.livelli-probabilita span {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.prob-bassa { background: #e8f5e8; color: #2e7d32; }
.prob-media { background: #fff3e0; color: #f57c00; }
.prob-alta { background: #ffebee; color: #c62828; }

/* Livelli vento */
.livelli-vento {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.livelli-vento span {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.vento-debole { background: #e8f5e8; color: #2e7d32; }
.vento-moderato { background: #fff3e0; color: #f57c00; }
.vento-forte { background: #ffebee; color: #c62828; }
.vento-molto-forte { background: #fce4ec; color: #ad1457; }

/* Livelli impatto */
.livelli-impatto {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.livelli-impatto > div {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.badge-impatto {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    min-width: 60px;
    text-align: center;
}

.badge-impatto.basso { background: #4caf50; }
.badge-impatto.medio { background: #ff9800; }
.badge-impatto.alto { background: #f44336; }

.livelli-impatto p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* Nota importante */
.nota-importante {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    color: #1565c0;
    font-size: 14px;
}

/* Footer aiuto */
.aiuto-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.aiuto-footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Responsive design per aiuto */
@media (max-width: 768px) {
    .aiuto-previsioni-content {
        margin: 20px;
        max-width: none;
    }
    
    .aiuto-header {
        padding: 20px;
    }
    
    .aiuto-header h2 {
        font-size: 24px;
    }
    
    .aiuto-body {
        padding: 20px;
    }
    
    .grid-icone-aiuto,
    .grid-precipitazioni-aiuto {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .range-temperature,
    .livelli-probabilita,
    .livelli-vento {
        flex-direction: column;
    }
}

/* Previsioni giornaliere estese nel dashboard */
.sezione-previsioni-giornaliere {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.timeline-giornaliera {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.giorno-previsione-esteso {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: grid;
    grid-template-rows: auto auto auto auto auto auto;
    gap: 8px;
    transition: all 0.3s ease;
}

.giorno-previsione-esteso:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.giorno-previsione-esteso.giorno-pioggia {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.data-giorno-estesa {
    font-weight: bold;
    color: #2E7D32;
    font-size: 14px;
    background: #e8f5e8;
    padding: 8px;
    border-radius: 6px;
}

.icona-meteo-estesa {
    font-size: 24px;
}

.temperature-estese {
    font-weight: bold;
    color: #d32f2f;
    font-size: 16px;
}

.precipitazioni-estese {
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.prob-precipitazioni-estese {
    color: #1976d2;
    font-weight: bold;
    font-size: 14px;
}

.vento-esteso {
    color: #6c757d;
    font-size: 12px;
}

/* Responsive per previsioni estese */
@media (max-width: 768px) {
    .timeline-giornaliera {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .giorno-previsione-esteso {
        padding: 10px;
        font-size: 12px;
    }
    
    .data-giorno-estesa {
        font-size: 12px;
        padding: 6px;
    }
    
    .icona-meteo-estesa {
        font-size: 20px;
    }
    
    .temperature-estese {
        font-size: 14px;
    }
    
    .precipitazioni-estese {
        font-size: 12px;
        padding: 4px 8px;
    }
}