﻿/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Header a tutta larghezza */
.header {
    background-color: #0f2239;
    color: #fff;
    padding: 20px 20px 20px 20px;
    position: relative;
}

.header-inner {
    display: flex;
    align-items: center; /* centra verticalmente */
    justify-content: space-between; /* logo a sinistra, testo a destra */
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: nowrap;
    padding: 10px 0;
}

.logo {
    display: flex;
    align-items: center;
}

    .logo img {
        max-width: 150px;
        height: auto;
    }

.titolo-header {
    display: flex;
    align-items: center;
    text-align: right;
}

    .titolo-header h1 {
        font-family: 'Poppins', sans-serif;
        font-size: 2.5rem;
        font-weight: 700;
        line-height: 1.3;
        margin: 0;
    }


.onda {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

    .onda svg {
        display: block;
        width: 100%;
        height: 80px;
    }

/* Pulsanti di menu */
.menu {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

    .menu a {
        background-color: #122f4f;
        color: #fff;
        padding: 12px 24px;
        border-radius: 30px;
        text-decoration: none;
        font-weight: 600;
        transition: background 0.3s;
    }

        .menu a:hover {
            background-color: #1e4d7b;
        }


/* NAVIGATION */
nav {
    background-color: #1976d2;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
}

    nav a {
        color: #fff;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
    }

        nav a:hover {
            color: #ffeb3b;
        }

/* CONTENT */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

h2 {
    font-weight: 600;
    margin-bottom: 20px;
    color: #0d47a1;
}

p {
    margin-bottom: 20px;
}

/* BUTTON */
.button {
    background-color: #0d47a1;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    white-space: normal; /* consente il wrapping del testo */
    word-wrap: break-word; /* forza l'andata a capo anche su parole molto lunghe */
    overflow-wrap: break-word; /* supporto moderno per break-word */
}

    .button:hover {
        background-color: #1976d2;
    }

/* FOOTER */
footer {
    background-color: #0d47a1;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9rem;
}

/* CARD ELEMENTS */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    }

.cardbutton {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%;
}

    .cardbutton:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    }

/* FORM ELEMENTS */
input[type="text"],
input[type="email"],
textarea {
    width: 98%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}

input[type="submit"] {
    background-color: #0d47a1;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

    input[type="submit"]:hover {
        background-color: #1976d2;
    }

.post-card a {
    color: #333; /* colore testo link */
    text-decoration: none; /* niente sottolineatura */
    transition: color 0.3s ease;
}

    .post-card a:hover {
        color: #0078D7; /* colore al passaggio del mouse */
        text-decoration: underline; /* opzionale: sottolinea al passaggio */
    }

/* RESPONSIVE */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    .post-area {
        max-width: 400px;
        margin: 20px auto;
    }



    .post-card:hover {
        transform: translateY(-4px);
    }

    .post-card h3 {
        margin-top: 0;
        font-size: 1.2em;
        margin-bottom: 10px;
    }

        .post-card h3 a {
            text-decoration: none;
            color: #333;
        }

            .post-card h3 a:hover {
                color: #0078D7;
            }

    .post-card p {
        font-size: 0.95em;
        color: #555;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .titolo-header h1 {
        font-size: 1.8rem;
        text-align: left;
        margin-top: 15px;
    }

    .logo img {
        max-width: 120px;
    }

    .post-area {
        padding: 0 15px;
    }

    .post-card h3 {
        font-size: 1.2rem;
        margin: 10px;
    }
}


/* Desktop layout */
@media (min-width: 768px) {

    .main-content {
        display: flex;
        gap: 20px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    #left-content {
        flex: 1;
        min-width: 250px;
    }

    .post-area {
        width: 300px;
        flex-shrink: 0;
        background-color: #f0f0f0;
        border: 1px solid #ccc;
        border-radius: 10px;
        padding: 10px;
        box-sizing: border-box;
    }
}
.post-card {
    /* Già presenti: */
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
    /* Nuove aggiunte: */
    overflow: hidden; /* taglia contenuti che escono */
    word-wrap: break-word; /* spezza parole lunghe */
    max-width: 100%; /* non uscire dalla larghezza della card */
}

    .post-card img,
    .post-card iframe,
    .post-card embed,
    .post-card object {
        max-width: 100%; /* immagini e contenuti multimediali non superano la larghezza card */
        max-height: 400px;
        height: auto; /* mantiene proporzioni */
        display: block; /* evita spazi indesiderati */
        border-radius: 12px;
        object-fit: contain;
    }
/* GRIDVIEW CON MARGINI */
.gridview {
    border-collapse: separate;
    border-spacing: 0;
    /*width: calc(100% - 60px); /* lascia 30px di margine per lato */
   
    margin: 20px 0px 30px 0px;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

    .gridview th {
        background-color: #0d47a1;
        color: #fff;
        padding: 14px 20px;
        text-align: left;
        font-weight: 600;
    }

    .gridview td {
        padding: 14px 20px;
        border-bottom: 1px solid #e0e0e0;
        color: #333;
    }

    .gridview tr:nth-child(even) {
        background-color: #f5f5f5;
    }

    .gridview tr:hover {
        background-color: #e3f2fd;
    }

    /* STILE PER I LINKBUTTON NELLA GRID */
    .gridview .btn-download {
        background-color: #11007b;
        color: #fff;
        padding: 8px 16px;
        border: none;
        border-radius: 6px;
        text-decoration: none;
        display: inline-block;
        font-weight: 500;
        transition: background-color 0.3s ease;
        cursor: pointer;
    }

        .gridview .btn-download:hover {
            background-color: #1976d2;
        }

/* Stile per il titolo cliccabile */
.collapsibletitle {
    display: block; /* fa sì che occupi tutta la riga */
    background-color: #0d47a1;
    color: #fff;
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 5px;
    user-select: none;
    text-align: left;
    box-sizing: border-box;
    width: 100%; /* assicura che si estenda a tutta larghezza */
}

    /* Hover effetto */
    .collapsibletitle:hover {
        background-color: #1565c0;
    }

/* Stile del contenitore a scomparsa */
.collapsiblediv {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

    /* Eventuale classe per una variante più compatta */
    .collapsiblediv.compact {
        padding: 10px;
        font-size: 0.95em;
    }

/* CONTENITORE PER POSTCARD-BUTTON */
#left-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
}

/* CONTENITORE PER POSTCARD-BUTTON */
#left-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 20px;
}

.postcard-button {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* spinge img in alto e span in basso */
    align-items: center;
    text-align: center;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    background-color: #f9f9f9;
    transition: background-color 0.3s, box-shadow 0.3s;
    flex: 1 1 calc(25% - 20px);
    max-width: calc(25% - 20px);
    min-width: 150px;
    box-sizing: border-box;
    height: 400px; /* altezza fissa per rendere uniforme la card */
}

    .postcard-button img {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
        margin-bottom: 8px;
        max-height: 400px;
        object-fit: contain;
    }

    .postcard-button span {
        margin-top: auto;
        padding-top: 10px;
        font-weight: bold;
    }

    .postcard-button:hover {
        background-color: #eaeaea;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
/* Responsive postcard-button per schermi piccoli */
@media (max-width: 768px) {
    .postcard-button {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* POST-AREA */
#post-area {
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}

@media (max-width: 768px) {
    .postcard-button {
        flex: 1 1 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .postcard-button {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Definizione post-area per chiarezza */
#post-area {
    margin: 20px;
    padding: 10px;
    border: 1px solid #ddd;
}


/* Responsive per schermi fino a 480px (smartphone piccoli) */
@media (max-width: 480px) {
    .header {
        padding: 30px 15px 0 15px;
    }

    .titolo-header h1 {
        font-size: 1.5rem;
    }

    .logo img {
        max-width: 100px;
    }

    .post-card {
        margin-bottom: 20px;
    }

        .post-card h3 {
            font-size: 1rem;
            margin: 8px;
        }
}

.postcard-button {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 280px; /* larghezza massima */
    margin: 10px;
    flex: 1 1 200px; /* base per il resize */
}

    .postcard-button:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }

    .postcard-button img {
        width: 100%;
        height: auto;
        border-radius: 12px 12px 0 0;
        object-fit: cover;
        margin-bottom: 12px;
    }

    .postcard-button .descrizione {
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        font-size: 1rem;
        color: #0d47a1;
        min-height: 3em; /* altezza minima per uniformità */
    }

/* Container flessibile per i 4 pulsanti */
.postcard-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive: su schermi piccoli */
@media (max-width: 768px) {
    .postcard-button {
        max-width: 100%;
        flex: 1 1 100%;
    }
}

.main-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    margin: 5%;
}


/* Stile base per il contenuto della modale */
.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    border-radius: 4px;
}

/* Pulsante chiudi (la X) */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

    .close:hover, .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
    }

.box-replica {
    border: 1px solid #ccc;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    background-color: #f9f9f9;
}
.box-replicaOperatore {
    border: 1px solid #ccc;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    background-color: #e8f5e9;
}
/* Stile generale del calendario */
.custom-calendar {
    border: 1px solid #ccc;
    width: 100%;
    max-width: 300px;
    background-color: #fff;
    font-family: 'Segoe UI', sans-serif;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

    /* Header mese */
    .custom-calendar .aspNetCalendarHeader {
        background-color: #333;
        color: #fff;
        font-weight: bold;
        padding: 8px;
        text-align: center;
    }

    /* Giorni della settimana */
    .custom-calendar .aspNetCalendarDayHeader {
        background-color: #f4f4f4;
        font-weight: bold;
        color: #555;
        padding: 5px;
        text-align: center;
    }

    /* Celle dei giorni */
    .custom-calendar td {
        padding: 5px;
        text-align: center;
    }

    /* Giorno normale */
    .custom-calendar .aspNetCalendarDay {
        background-color: #fff;
        color: #333;
        cursor: pointer;
    }

    /* Giorno selezionato */
    .custom-calendar .aspNetCalendarSelectedDay {
        background-color: #007bff;
        color: #fff;
        font-weight: bold;
        border-radius: 50%;
    }

    /* Giorno di oggi */
    .custom-calendar .aspNetCalendarTodayDay {
        background-color: #ffeb3b;
        color: #333;
        font-weight: bold;
        border-radius: 50%;
    }
.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    max-width: 420px;
    background: #fff;
    color: #111;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    border-left: 6px solid #2563eb;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,sans-serif
}

    .toast .toast-title {
        font-weight: 700;
        margin-bottom: 6px
    }

    .toast .toast-msg {
        line-height: 1.35
    }

    .toast .toast-close {
        position: absolute;
        top: 6px;
        right: 10px;
        border: 0;
        background: transparent;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        color: #666
    }

    .toast.error {
        border-left-color: #dc2626
    }

    .toast.ok {
        border-left-color: #16a34a
    }

    .toast.info {
        border-left-color: #2563eb
    }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10000;
}

.modal-card {
    background: #fff;
    max-width: 560px;
    width: min(92vw,560px);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    padding: 20px 24px;
    position: relative;
    border-top: 6px solid var(--accent,#2563eb);
    font-family: system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

    .modal-card.error {
        --accent: #dc2626;
    }

    .modal-card.ok {
        --accent: #16a34a;
    }

    .modal-card.info {
        --accent: #2563eb;
    }

.modal-title {
    margin: 0 0 8px;
    font-weight: 700;
}

.modal-body {
    line-height: 1.5;
    color: #333;
}

.modal-actions {
    margin-top: 14px;
    text-align: right;
}

.modal-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}




