/* ==========================================
   1. STILI PER IL SITO PUBBLICO
   ========================================== */

/* RESET DI BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #146101; /* Blu scuro elegante (Verde) */
    --accent: #e67e22;  /* Arancione per i bottoni */
    --light: #f4f4f4;
}

body {
    line-height: 1.6;
    color: #333;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.logo img {
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05); /* Effetto leggero al passaggio del mouse */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
}

.btn-prenota {
    background: var(--primary);
    color: white !important;
    padding: 8px 15px;
    border-radius: 5px;
}

.hamburger { display: none; cursor: pointer; }

/* HERO SECTION */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('./img/Fai.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.hero h1 { font-size: 3rem; margin-bottom: 10px; }

.marginh2 {margin-bottom: 30px;}

.btn-main {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}
.btn-main:hover { background: #d35400; }

/* SEZIONI GENERALI */
.container {
    padding: 1rem 10%;
    text-align: center;
}

.intro-text {
    max-width: 700px;
    margin: 20px auto;
    font-size: 1.1rem;
}

/* SERVIZI */
.servizi-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.servizio {
    text-align: center;
    width: 150px;
}

.servizio i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 48px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

/* GALLERIA */
.gallery-section {
    background: var(--light);
    padding: 1rem 5%;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s;
}

.gallery-grid img:hover { transform: scale(1.03); }

/* CONTATTI FORM */
.contact-wrapper {
    max-width: 600px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    text-align: left;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.dates-group {
    display: flex;
    gap: 25px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 20px;
}

/* MOBILE RESPONSIVE SITO PUBBLICO */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        background: white;
        width: 100%;
        text-align: center;
        padding: 20px 0;
        box-shadow: 0 5px 5px rgba(0,0,0,0.1);
    }
    .nav-links.active { display: flex; }
    .hamburger { display: block; font-size: 1.5rem; }
    .dates-group { flex-direction: column; gap: 0; }
    .hero h1 { font-size: 2rem; }
}

/* STILE SLIDER A 2 RIGHE */
.full-width-slider {
    width: 100%;
    padding: 40px 0;
    background-color: var(--light);
    text-align: center;
}

.slider-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.myGallery {
    width: 100%;
    height: 550px;
    padding-bottom: 40px;
}

.myGallery .swiper-slide {
    height: calc((100% - 20px) / 2) !important; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.myGallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.myGallery img:hover { transform: scale(1.02); }
.myGallery .swiper-slide a { display: block; width: 100%; height: 100%; }

.swiper-button-next, .swiper-button-prev {
    background-color: rgba(255, 255, 255, 0.9); 
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%; 
    color: var(--primary) !important; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 20px !important;
    font-weight: bold;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: var(--primary);
    color: white !important;
}

.swiper-pagination-bullet-active { background: var(--primary) !important; }

.gallery-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 30px;
    font-weight: bold;
    position: relative;
}

.gallery-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* FLATPICKR STILI */
.flatpickr-input[readonly] { background-color: white !important; }
.form-group input.flatpickr-input { width: 100%; }

.flatpickr-day.disabled {
    background: #f0f0f0 !important;
    color: #bbb !important;
    text-decoration: line-through;
}

.flatpickr-day.selected {
    background: #146101 !important;
    border-color: #146101 !important;
}

.flatpickr-day.today.maxDate, .flatpickr-day.maxDate {
    border-bottom: 3px solid #e74c3c !important;
}


/* ==========================================
   2. STILI PER L'AREA ADMIN (Pannello)
   ========================================== */

body:has(.admin-container) {
    background-color: #f4f7f6; /* Sfondo leggermente grigio per risaltare la tabella */
}

.admin-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Header Admin */
.admin-header {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.header-top h1 { margin: 0; font-size: 1.6rem; color: var(--primary); }

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.action-bar h2 { margin: 0; font-size: 1.2rem; color: #555; }

/* Bottoni Admin */
.button-group { display: flex; gap: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn span { font-size: 1.1rem; }
.btn-calendar { background-color: var(--primary); color: white; }
.btn-excel { background-color: #27ae60; color: white; }
.btn-logout { background-color: #e74c3c; color: white; padding: 8px 15px; }

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Stili Tabella (Isolati solo per l'admin) */
.admin-container table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden; /* Angoli arrotondati */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 10px;
}

.admin-container th {
    background-color: var(--primary);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.admin-container td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.admin-container tr:hover { background-color: #f1f8f1; }

/* Responsive Area Admin */
@media (max-width: 768px) {
    .action-bar, .header-top { flex-direction: column; text-align: center; gap: 15px; }
    .button-group { flex-direction: column; width: 100%; }
    .btn { justify-content: center; width: 100%; }
    .admin-container table { display: block; overflow-x: auto; /* Scroll orizzontale tabella su mobile */ }
}

/* Messaggio di errore ospiti */
#guest-error {
    background-color: #fdeaea;
    color: #cb2431;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fbcaca;
    font-size: 0.9rem;
    margin-top: 15px;
    display: none; /* Nascosto di base */
    align-items: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Animazione "shake" quando si supera il limite */
.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Stili per il Popup di Ringraziamento */
/* Lo sfondo oscurato che copre tutto */
.modal-overlay {
    position: fixed; /* Fondamentale: lo fissa allo schermo */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Sfondo nero semi-trasparente */
    display: none; /* Inizialmente nascosto, il JS lo cambierà in 'flex' */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Valore altissimo per stare sopra a navbar e tutto il resto */
    backdrop-filter: blur(5px); /* Sfoca leggermente il sito dietro */
}

/* Il quadratino bianco con il messaggio */
.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    position: relative;
    animation: popupEntrata 0.3s ease-out;
}

@keyframes popupEntrata {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 4rem;
    color: #146101; /* Il tuo verde */
    margin-bottom: 15px;
}

/* Container della Privacy */
.privacy-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

/* Nascondiamo il checkbox originale */
.privacy-wrapper input[type="checkbox"] {
    display: none;
}

/* Creiamo il nuovo checkbox personalizzato */
.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: white;
}

/* Stile quando selezionato */
.privacy-wrapper input[type="checkbox"]:checked + .custom-checkbox {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Icona del check (usiamo FontAwesome che hai già nel sito) */
.custom-checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 12px;
    display: none;
}

.privacy-wrapper input[type="checkbox"]:checked + .custom-checkbox::after {
    display: block;
}

/* Testo della privacy */
.privacy-text {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.privacy-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.privacy-text a:hover {
    color: var(--accent);
}

/* Barra dei Cookie */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #2c3e50; /* Grigio scuro elegante */
    color: white;
    padding: 15px 0;
    z-index: 10000;
    display: none; /* Nascosta di base, attivata dal JS */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.cookie-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.cookie-content p {
    font-size: 0.85rem;
    margin: 0;
}

.cookie-content a {
    color: #3498db;
    text-decoration: underline;
}

.btn-cookie {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.btn-cookie:hover {
    opacity: 0.9;
}

/* Ottimizzazione Mobile */
@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}