/* ================================
   BASE GENERALE
================================ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f8f9fa;
}

/* Autocomplete lista (usata dal calendario) */
.autocomplete-list {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 8px;
    margin-top: 5px;
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
}
.autocomplete-item {
    padding: 8px;
    cursor: pointer;
}
.autocomplete-item:hover {
    background: #f0f0f0;
}

/* =========================================
   FULLCALENDAR — stili condivisi
========================================= */
.fc .fc-timegrid-slot-label {
    font-size: 0.8rem;
}
.fc .fc-timegrid-event {
    font-size: 0.8rem;
    padding: 2px 4px;
}

/* =========================================
   PAGINA CALENDARIO
   Solo il body.calendar-layout ha overflow:hidden
   e il calendario riempie la viewport.
========================================= */
body.calendar-layout {
    overflow: hidden;   /* niente scroll pagina */
}

body.calendar-layout #calendar {
    height: calc(100vh - 60px);  /* 60px ≈ altezza navbar */
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}

/* Scroll solo dentro il calendario */
body.calendar-layout .fc-timegrid-body {
    overflow-y: scroll !important;
}

/* Slot più grandi sul calendario */
body.calendar-layout .fc-timegrid-slot {
    height: 60px !important;
    max-height: 60px !important;
}
body.calendar-layout .fc-timegrid-slot-label {
    line-height: 60px !important;
}
body.calendar-layout .fc-timegrid-slot-lane {
    height: 60px !important;
}

/* ================================
   MOBILE / TABLET (max 992px)
================================ */
@media (max-width: 992px) {

    /* Slot un po' più bassi su mobile per far entrare più ore */
    body.calendar-layout .fc-timegrid-slot {
        height: 3rem !important;
        max-height: 3rem !important;
    }
    body.calendar-layout .fc-timegrid-slot-label {
        line-height: 3rem !important;
    }

    .fc .fc-timegrid-slot-label { font-size: 0.9rem; }
    .fc .fc-timegrid-axis-frame { padding: 2px; }
    .fc .fc-timegrid-event {
        font-size: 0.85rem;
        padding: 3px 4px;
    }
    .fc .fc-scrollgrid {
        border-left: 0;
        border-right: 0;
    }
    .fc .fc-toolbar-title { font-size: 1.1rem; }
    .fc .fc-button {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }

    /* Modale fullscreen: comodo su mobile */
    .modal-fullscreen .modal-content { padding: 24px; }
    .modal-fullscreen .modal-title {
        font-size: 1.8rem;
        font-weight: 600;
    }
    .modal-fullscreen input.form-control {
        font-size: 1.3rem;
        padding: 14px 16px;
        height: auto;
        border-radius: 10px;
    }
    .modal-fullscreen label {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }
    .modal-fullscreen .btn-primary,
    .modal-fullscreen .btn-danger,
    .modal-fullscreen .btn-secondary {
        padding: 18px;
        font-size: 1.5rem;
        border-radius: 12px;
    }
    .autocomplete-item {
        padding: 14px;
        font-size: 1.3rem;
    }
    .modal-fullscreen .mb-3 {
        margin-bottom: 24px !important;
    }
}

/* ================================
   MODAL — mobile piccolo
================================ */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100%;
        display: flex;
        align-items: stretch;
    }
    .modal-content {
        border-radius: 0;
        width: 100%;
        max-height: 100vh;
    }
    .modal-body {
        overflow-y: auto;
    }
}