/* --- STILI GLOBALI E VARIABILI --- */
:root {
    --bg-color: #f4f7f6; /* Grigio molto chiaro */
    --surface-color: #ffffff; /* Bianco puro per card e popup */
    --primary-color: #3498db; /* Blu acceso ma non aggressivo */
    --primary-hover: #2980b9;
    --accent-color: #1abc9c; /* Verde acqua per accenti */
    --text-color: #2c3e50; /* Blu scuro per testo principale */
    --text-muted: #7f8c8d; /* Grigio per testo secondario */
    --font-family: 'Roboto', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
}

/* --- HEADER --- */
.header {
    background-color: var(--surface-color);
    padding: 1.5rem 1rem;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center; /* Centra il contenuto dell'header */
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Allinea gli elementi a sinistra */
    gap: 20px;
    
}

/* --- Stile per il logo cliccabile --- */
#logo-link {
    cursor: pointer;
    transition: opacity 0.3s ease;
    text-decoration: none; /* Rimuove la sottolineatura del link */
}

#logo-link:hover {
    opacity: 0.8;
}

.logo {
    max-height: 60px;
    width: auto;
}

.header-text {
    text-align: center; /* Centra il testo all'interno di questo div */
}

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.header-text p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 5px;
}
.contact-btn {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    /* Rimuovi tutte le regole di posizionamento assoluto e margini automatici */
}

.contact-btn:hover {
    background-color: #16a085;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(26, 188, 156, 0.4);
}

/* --- NAVIGAZIONE CATEGORIE --- */
.categorie-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.categoria-btn {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 2px solid transparent;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
}

.categoria-btn i {
    font-size: 1.2em;
    color: var(--primary-color);
}

.categoria-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.categoria-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-hover);
}

/* --- CONTENITORE LINK --- */
.links-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

.link-card {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.link-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.link-card a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    text-align: center;
}

.link-card a:hover {
    color: var(--primary-color);
}

/* --- FOOTER --- */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: auto;
    background-color: var(--surface-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.footer i {
    color: var(--primary-color);
}

.qrcode {
    max-height: 50px;
    width: auto;
    border-radius: 5px;
    cursor: pointer; /* Indica che è cliccabile */
    transition: opacity 0.3s ease;
}
.qrcode:hover {
    opacity: 0.8;
}

/* --- POPUP (STILI GENERALI) --- */
.popup {
    display: none; /* Nascosto di default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    animation: fadeIn 0.3s;
}

.popup.show {
    display: block;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.popup-content {
    background-color: var(--surface-color);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    position: relative;
    animation: slideIn 0.4s;
}

.popup-close {
    color: var(--text-muted);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.popup-close:hover {
    color: var(--text-color);
}
.popup-content-image {
    background-color: transparent; /* Sfondo trasparente per far risaltare solo l'immagine */
    margin: auto;
    padding: 0;
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90%;
    height: 90%;
}

.popup-content-image img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* --- STILE PER IL POPUP GRANDE (CALENDARIO) --- */
.popup-content-large {
    width: 50%; /* Larghezza a metà schermo */
    height: 85%;
    max-width: 800px; /* Larghezza massima ridotta */
    margin: 3% auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.popup-content-large iframe {
    width: 100%;
    flex-grow: 1; /* Fa in modo che l'iframe occupi tutto lo spazio disponibile */
    border: none;
    border-radius: 8px;
}

/* Assicurati che il pulsante di chiusura sia sopra l'iframe */
.popup-content-large .popup-close {
    position: absolute;
    z-index: 10;
}

/* --- ANIMAZIONI --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    .header-content {
        flex-direction: column;
    }
    .header h1 {
        font-size: 2rem;
    }
    .categoria-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .links-container {
        grid-template-columns: 1fr;
    }
    .footer-content {
        flex-direction: column;
    }
    /* Regola specifica per il popup grande su mobile */
    .popup-content-large {
        width: 95%; /* Su mobile, occupa quasi tutto lo schermo in larghezza */
        height: 95%;
        margin: 2.5% auto;
    }
    
}
.link-card a *:not(:first-child) {
    display: none !important;
}
}
