/* =======================================================
 * STILI CSS COMPLETI E FINALI PER IL SISTEMA DI PRENOTAZIONE
 * Versione 10: Ottimizzazione Spaziatura Globale e Navbar
 * ======================================================= */

/* ============================
    Stili generali layout
    ============================ */

body {
    background-color: #e8e8e8; /* SFONDO BODY GRIGIO CHIARO */
    color: #333; 
}

/* Ombra sulle card per staccarle dallo sfondo */
.card {
    border-radius: 0.75rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); 
    border: 1px solid #e9ecef; 
}


/* ============================
    MIGLIORAMENTO NAVIGAZIONE / NAVBAR
    ============================ */

/* Riduzione generale della spaziatura verticale della navbar */
.navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Rendi il brand più robusto */
.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Ottimizza spaziatura e font size dei link della navbar */
.navbar-nav .nav-link {
    font-size: 0.95rem; 
    padding-top: 0.35rem !important;    /* RIDUZIONE SPAZIO VERTICALE */
    padding-bottom: 0.35rem !important; /* RIDUZIONE SPAZIO VERTICALE */
    padding-left: 0.75rem !important; 
    padding-right: 0.75rem !important;
    font-weight: 500;
    transition: color 0.2s;
}

/* Stile per i titoli di pagina (h1, h2, h3) */
h1, h2, h3 {
    color: #1a1a1a;
}

/* Correzione: FullCalendar Sfondo */
.fc-theme-standard, 
.fc-view-harness,
#calendar, 
.fc .fc-scrollgrid {
    background-color: #ffffff !important; 
    border-radius: 0.75rem; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); 
}


/* ============================
    Bottoni e Colori Istituzionali
    ============================ */

/* Bottoni primari istituzionali */
.btn-primary {
    background-color: #3257a0;
    border-color: #3257a0;
    box-shadow: 0 4px 8px rgba(50, 87, 160, 0.3); 
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #27447d;
    border-color: #27447d;
    box-shadow: 0 6px 12px rgba(50, 87, 160, 0.4);
}

/* Stile per i bottoni outline */
.btn-outline-primary {
    color: #3257a0;
    border-color: #3257a0;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background-color: #3257a0;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(50, 87, 160, 0.3);
}


/* ============================
    MIGLIORAMENTO CAMPI INPUT E FORM
    ============================ */

/* Tutti i campi form-control, inclusi quelli di date e file */
.form-control,
.form-select {
    background-color: #ffffff; 
    border: 1px solid #ced4da;
    border-radius: 0.5rem; 
    padding: 0.5rem 0.75rem; 
    transition: all 0.2s;
}

/* Input in stato di Focus */
.form-control:focus,
.form-select:focus {
    color: #495057;
    background-color: #ffffff;
    border-color: #3257a0; 
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(50, 87, 160, 0.25); 
}

/* Rendi più evidente l'Input Group Text (per il punto (.) o icona) */
.input-group-text {
    background-color: #e9ecef; 
    border: 1px solid #ced4da;
    border-right: none; 
    color: #495057;
    border-radius: 0.5rem 0 0 0.5rem; 
}

/* Correzione per integrazione input-group */
.input-group .form-control {
    border-left: none; 
}
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}


/* ============================
    MIGLIORAMENTO TABELLE E INTERAZIONE (Hover/Shadow)
    ============================ */

.table {
    --bs-table-bg: #ffffff; 
}

/* Strisce chiare per righe dispari */
.table-hover > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 0, 0, 0.02); 
}

/* Colore blu chiaro all'hover della riga */
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #e9f0fc; 
}

/* Ombra leggera e sollevamento all'hover delle righe nelle tabelle interattive (Admin) */
.table-hover > tbody > tr {
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.table-hover > tbody > tr:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); 
    transform: translateY(-1px); 
}

/* Stile per le intestazioni */
.table thead th {
    background-color: #f8f9fa; 
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}


/* ============================
    MIGLIORAMENTO TIPOGRAFIA E LAYOUT GLOBALE
    ============================ */

/* Spazio sotto i titoli H1 */
h1 {
    margin-bottom: 1.5rem;
}

/* Tutti i contenitori principali hanno un padding interno bilanciato */
.container, .container-fluid {
    padding-top: 0.5rem; /* MODIFICATO: Ridotto lo spazio superiore per stringere la navbar */
    padding-bottom: 1rem;
}

/* Migliora l'aspetto dei form-text (testo di aiuto sotto i campi) */
.form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.3rem;
}

/* ============================
    MIGLIORAMENTO BADGES DI STATO
    ============================ */

.badge {
    padding: 0.4em 0.7em; 
    border-radius: 1rem;  
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.text-bg-success { background-color: #28a745 !important; }
.text-bg-warning { background-color: #ffc107 !important; color: #333 !important; }
.text-bg-danger { background-color: #dc3545 !important; }
.text-bg-secondary { background-color: #6c757d !important; }


/* ============================
    Stati prenotazione (colori FullCalendar)
    ============================ */

.fc-event-pending {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.fc-event-approved {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.fc-event-rejected,
.fc-event-cancelled {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}


/* ============================
    Distinzione risorsa AULA / ZOOM (FullCalendar)
    ============================ */

.fc-event-aula {
    border: 4px solid #8B4513 !important;
}

.fc-event-zoom {
    border: 4px solid #0d6efd !important;
}


/* ============================
    Tipografia e layout dentro gli eventi (Calendario)
    ============================ */

.fc .fc-event-main {
    padding: 3px 6px;
    box-sizing: border-box; 
}

.fc-event-title.fc-styled-title {
    font-weight: 600;
    font-size: 0.80rem;
    line-height: 1.2;
    display: block;
    margin-bottom: 1px;
    white-space: normal;
}

.fc-event-meta {
    font-size: 0.72rem;
    line-height: 1.1;
    display: block;
    white-space: normal;
}

.fc-event-resource {
    opacity: 0.9;
}

.fc-event-user {
    font-style: italic;
}

.fc-event-title,
.fc-event-title.fc-styled-title,
.fc-event-meta,
.fc-event-user,
.fc-event-attachments {
    color: #ffffff !important;
}


/* ============================
    Legenda grafica
    ============================ */

.legend-item {
    white-space: nowrap;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.legend-color,
.legend-border {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-status-approved {
    background-color: #28a745;
}

.legend-status-pending {
    background-color: #6c757d;
}

.legend-status-rejected {
    background-color: #dc3545;
}

.legend-border {
    background-color: transparent;
    border: 3px solid transparent;
}

.legend-type-aula {
    border-color: #8B4513;
}

.legend-type-zoom {
    border-color: #0d6efd;
}

/* =======================================================
 * STILI AGGIUNTIVI PER I MODALI (MODIFICA & CREAZIONE)
 * ======================================================= */

/* 1. Sfondo del contenuto del modale (la scatola vera e propria) */
.modal-content {
    background-color: #f2f2f2; /* SFONDO CONTENUTO MODALE */
    border-radius: 12px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* 2. Header distintivo e colorato */
.modal-header.bg-primary {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background-color: #3257a0 !important;
    border-bottom: 3px solid rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
}

/* 3. Pulsante di chiusura nell'header scuro */
.modal-header.bg-primary .btn-close-white {
    filter: invert(1);
}

/* 4. Migliora l'aspetto dei campi form-floating e select */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    border-radius: 8px;
    transition: border-color 0.2s;
}

/* 5. Migliora il focus sui campi */
.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: #3257a0; 
    box-shadow: 0 0 0 0.25rem rgba(50, 87, 160, 0.25);
}

/* 6. Footer del modale */
.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 15px 20px;
}

/* 7. Input Readonly/Disabilitato - Stile pulito */
.form-control[readonly], 
.form-control:disabled {
    background-color: #f1f5fa !important;
    color: #495057;
    border-style: solid; 
    border-color: #d8e1eb; 
    cursor: default;
}

/* 8. Stile per la sezione Allegati (effetto "Drop Zone") */
.card.bg-light.attachments-section {
    border: 2px dashed #a0aec0;
    background-color: #fafafa !important;
    padding: 20px !important;
    border-radius: 10px;
}

/* 9. Lista Allegati nel modale Modifica */
.attachments-section .list-group-item {
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid #dee2e6;
    background-color: #ffffff; 
}

/* Evidenzia il link nella lista allegati */
.attachments-section .list-group-item a {
    color: #3257a0; 
    font-weight: 500;
}

/* Stile per l'icona di eliminazione nel modale Modifica */
.att-delete-checkbox + .form-check-label {
    font-size: 0.85rem;
    color: #dc3545 !important;
}

/* ============================
    MODAL BACKDROP (Sfondo Dietro il Modale)
    ============================ */

.modal-backdrop,
.modal-backdrop.show { 
    background-color: #000000;
    opacity: 0.65 !important; 
}