/* Stili per il Footer */
footer {
    font-family: 'Inter', sans-serif;
    color: var(--text-color-light);
    background: var(--card-background-light);
    padding: 5px 10px 5px;
    border-top: 2px solid var(--border-color-light);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* DESKTOP LAYOUT - Layout orizzontale per schermi grandi */
.footer-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    padding-bottom: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    margin: 10px 20px;
}

/* Modifica principale: unifichiamo lo stile di tutti i titoli H3 */
.footer-section h3 {
    color: var(--primary-color-light);
    font-size: 1.4em;
    font-family: 'Playfair Display', serif;
    margin-bottom: 20px;
    text-transform: uppercase;
    cursor: default;
    /* Rende il titolo un contenitore flex per un allineamento più preciso */
    display: flex;
    justify-content: flex-start; /* Allinea il testo all'inizio */
    align-items: center;
    transition: color 0.4s ease;
}

/* Regola per l'icona freccia - nascosta su desktop */
.footer-section h3 i {
    margin-left: 10px;
    display: none;
    transition: transform 0.3s ease;
}

/* Nuova regola per centrare specificamente il testo nella sezione "Seguici" */
.social-contacts h3 {
    justify-content: center;
}

/* Su desktop, il contenuto del dropdown è sempre visibile */
.footer-section .dropdown-content-footer {
    display: block !important;
    max-height: none;
    overflow: visible;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a, .contact-email a {
    color: var(--text-secondary-light);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 400;
}

.footer-section a:hover, .contact-email a:hover {
    color: var(--secondary-color-light);
}

.footer-section.social-contacts p {
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--text-secondary-light);
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    color: var(--text-secondary-light);
    font-size: 1.5em;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover {
    color: var(--secondary-color-light);
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color-light);
    color: var(--text-secondary-light);
    font-size: 0.9em;
}

/* Dark mode */
body.dark-mode footer {
    background: var(--card-background-dark);
    color: var(--text-color-dark);
    border-top: 2px solid var(--border-color-dark);
}

body.dark-mode .footer-section h3 {
    color: #90caf9;
}

body.dark-mode .footer-section a,
body.dark-mode .contact-email a {
    color: var(--text-secondary-dark);
}

body.dark-mode .footer-section a:hover,
body.dark-mode .contact-email a:hover {
    color: var(--secondary-color-dark);
}

body.dark-mode .footer-section.social-contacts p {
    color: var(--text-secondary-dark);
}

body.dark-mode .social-icons a {
    color: var(--text-secondary-dark);
}

body.dark-mode .social-icons a:hover {
    color: var(--secondary-color-dark);
}

body.dark-mode .footer-bottom {
    background: var(--background-color-dark);
    color: var(--text-secondary-dark);
    border-top: 1px solid var(--border-color-dark);
}

/* Media Query per Mobile - Solo qui attiviamo il layout verticale e dropdown */
@media (max-width: 768px) {
    /* Layout mobile - verticale e centrato */
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-bottom: 5px;
        gap: 10px;
        max-width: 100%;
        margin: 0;
    }

    .footer-section {
        margin-bottom: 10px;
        width: 100%;
        margin: 5px 0;
    }

    /* Centrare i titoli su mobile */
    .footer-section h3 {
        justify-content: center;
    }

    /* Su mobile i titoli diventano cliccabili */
    .dropdown-footer h3 {
        cursor: pointer; 
    }
    
    /* Su mobile il contenuto inizia nascosto */
    .footer-section .dropdown-content-footer {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        display: block !important;
    }

    .footer-section .dropdown-content-footer.open {
        max-height: 500px;
        transition: max-height 0.5s ease-in;
    }

    /* Su mobile mostra le frecce */
    .footer-section h3 i {
        display: inline-block;
    }
}