/* ============================================
   Green Space Apartment – Global Styles
   ============================================ */

/* VARIABLES */
:root {
    --primary: #0c5f41;
    --secondary: #e9f7ef;
    --light: #f6f6f6;
    --radius: 18px;
    --text-dark: #1a1a1a;
    --shadow: 0 6px 20px rgba(0,0,0,0.12);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* evita che il titolo resti attaccato al bordo */
}

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

body {
    font-family: 'Segoe UI', sans-serif;
    background: #ffffff;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */

header {
    background: linear-gradient(to bottom right, var(--primary), #138a62);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.site-logo {
    width: 130px;
    display: block;
    margin: 0 auto 20px auto;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 8px;
}

.lang-select {
    margin-top: 25px;
    font-size: 1.1rem;
}

.lang-select a {
    text-decoration: none;
    font-weight: bold;
    color: white;
    margin: 0 10px;
    opacity: 0.9;
    transition: 0.3s;
}

.lang-select a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============================================
   SIMULATORE PREVENTIVO
   ============================================ */

.quote-box {
    background: var(--secondary);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quote-box label {
    font-weight: bold;
    color: var(--primary);
}

.quote-box input {
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 1rem;
}

.quote-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    cursor: pointer;
}

.quote-result {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

.btn-calendar {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 20px;
    background: #0c5f41;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: 0.3s;
}

.btn-calendar:hover {
    background: #0f7a55;
}

.secondary {
    background: #777;
}

.secondary:hover {
    background: #555;
}

.quote-note {
    font-size: 0.95rem;
    color: #555;
    margin-top: -5px;
}

.quote-btn-calendar {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
}

.quote-btn-calendar:hover {
    background: #0f7a55;
}

/* ============================================
   SECTIONS
   ============================================ */

section {
    max-width: 1100px;
    margin: auto;
    padding: 50px 20px;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary);
}



/* ============================================
   HERO SLIDER
   ============================================ */

.hero-slider {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
}

/* Tutte le immagini dello slider */
.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

/* Solo la slide attiva è visibile */
.hero-slide.active {
    opacity: 1;
}




/* ============================================
   SERVICES GRID
   ============================================ */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.service-box {
    background: var(--light);
    padding: 20px;
    text-align: center;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid #ddd;
    transition: 0.3s;
}

.service-box:hover {
    transform: translateY(-5px);
    background: white;
    box-shadow: var(--shadow);
    cursor: pointer;
}

/* ============================================
   GALLERY
   ============================================ */

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

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    transition: 0.3s;
    cursor: pointer;
}

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

/* LIGHTBOX */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
}

.lightbox .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 32px;
    cursor: pointer;
}

/* ============================================
   FORM CONTATTI
   ============================================ */

.contact-box {
    background: var(--secondary);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contact-form label {
    font-weight: bold;
    color: var(--primary);
}

.contact-form input,
.contact-form textarea {
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 1rem;
}

.contact-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.contact-form button:hover {
    background: #0e7250;
}

/* ============================================
   MAPPA
   ============================================ */

.map-container {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 450px;
    border: none;
}

/* ============================================
   POPUP
   ============================================ */

.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-box {
    background: white;
    padding: 25px;
    max-width: 420px;
    width: 90%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.popup-box h3 {
    color: var(--primary);
    margin-bottom: 12px;
}

.popup-box p {
    color: #333;
}

.close-btn {
    font-size: 22px;
    position: absolute;
    top: 12px;
    right: 14px;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FOOTER ELEGANTE
   ============================================ */

footer {
    background: var(--primary);
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    border-top: 4px solid #0a4a32;
}

footer p {
    opacity: 0.9;
}

footer .foot-links {
    margin-top: 12px;
}

footer .foot-links a {
    color: white;
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.95rem;
    opacity: 0.85;
    transition: 0.3s;
}

footer .foot-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============================================
   CALENDARIO PUBBLICO
   ============================================ */

.public-calendar-page {
    background: #f4f4f4;
}

.calendar-container {
    max-width: 1000px;
    margin: 30px auto;
    background: white;
    padding: 25px;
    border-radius: 14px;
}

.calendar-container h1,
.calendar-container h2 {
    text-align: center;
}

.public-calendar-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0;
    gap: 12px;
}

.public-calendar-topbar a,
.public-calendar-btn {
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    display: inline-block;
}

.public-calendar-btn.secondary {
    background: #777;
}

.public-calendar-legend {
    text-align: center;
    margin-bottom: 20px;
}

.public-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.public-weekday {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    color: var(--primary);
}

.public-day {
    min-height: 80px;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    background: #f7f7f7;
}

.public-day strong {
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
}

.public-day.disponibile {
    border-top: 6px solid #2ecc71;
}

.public-day.occupata {
    border-top: 6px solid #e74c3c;
    background: #fdecea;
}

.public-day.chiusa {
    border-top: 6px solid #777;
    background: #eee;
}

.public-status {
    font-size: 13px;
}

.public-calendar-back {
    text-align: center;
    margin-top: 30px;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px 0 15px;
    vertical-align: middle;
}

.legend-dot.green {
    background: #2ecc71;
}

.legend-dot.red {
    background: #e74c3c;
}

.legend-dot.gray {
    background: #777;
}


/* ============================================
   PAGINA ESITO INVIO MESSAGGIO
   ============================================ */

.message-result-page {
    background: #f4f4f4;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.message-result-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.18);
}

.message-result-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.message-result-icon.success {
    color: var(--primary);
}

.message-result-icon.error {
    color: #b30000;
}

.message-result-box p {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.message-result-btn {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    border-radius: 10px;
    display: inline-block;
    transition: 0.3s;
}

.message-result-btn:hover {
    background: #0f7a55;
}

/* ============================================
   ADMIN TABLE
   ============================================ */

.admin-table-box {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    background: var(--secondary);
    color: var(--primary);
}

.admin-table a {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   DOCUMENTAZIONE
   ============================================ */

.doc-container {
    max-width: 1000px;
    margin: 30px auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
}

.doc-container h1 {
    margin-top: 0;
}

.doc-section {
    margin-bottom: 30px;
}

.doc-section h2 {
    margin-top: 35px;
    color: var(--primary);
}

.doc-container code {
    background: #eee;
    padding: 3px 6px;
    border-radius: 4px;
}

.doc-container ul {
    line-height: 1.6;
}

@media (max-width: 700px) {
    .calendar-container {
        margin: 15px;
        padding: 18px;
    }

    .public-calendar-topbar {
        flex-direction: column;
        text-align: center;
    }

    .public-calendar-topbar a,
    .public-calendar-btn {
        width: 100%;
        text-align: center;
    }

    .public-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .public-weekday {
        display: none;
    }

    .public-day {
        min-height: 72px;
        padding: 8px;
    }

    .public-day strong {
        font-size: 17px;
    }

    .public-status {
        font-size: 12px;
    }

    .public-calendar-back {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}