/* ============================================================
   WPAPPSWS – Calendar Layout & Modal Fix
   ============================================================ */

/* --- Fix container WordPress (.wrap) --- */
#wpappsws-admin-calendar {
    max-width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
}

#wpappsws-admin-calendar.wrap {
    overflow-x: visible;
}

/* --- FullCalendar base responsive --- */
#wpappsws-fullcalendar {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   MODAL
   ============================================================ */

.wpappsws-modal,
#wpappsws-appointment-modal,
#wpappsws-confirm-modal {
    max-width: 95vw;
    box-sizing: border-box;
    margin: auto;
}

/* ============================================================
   MODAL ACTIONS (Close / Restore / Delete)
   ============================================================ */

.wpappsws-modal-actions,
#wpappsws-appointment-modal .wpappsws-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.wpappsws-modal-actions button,
#wpappsws-appointment-modal button {
    min-width: 120px;
}

/* --- Mobile layout --- */
@media (max-width: 768px) {

    .wpappsws-modal-actions,
    #wpappsws-appointment-modal .wpappsws-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .wpappsws-modal-actions button,
    #wpappsws-appointment-modal button {
        width: 100%;
        margin: 0;
    }
}
/* =====================================================
   FULLCALENDAR HEADER – MOBILE FIX
   ===================================================== */
@media (max-width: 768px) {

    /* Toolbar su più righe */
    #wpappsws-fullcalendar .fc-header-toolbar {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Riga 1: frecce + Today */
    #wpappsws-fullcalendar .fc-toolbar-chunk:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Titolo (data) leggibile */
    #wpappsws-fullcalendar .fc-toolbar-title {
        font-size: 16px !important;
        text-align: center;
        white-space: normal !important;
        line-height: 1.3;
        padding: 4px 0;
    }

    /* Nasconde i pulsanti vista (month / week / list) */
    #wpappsws-fullcalendar .fc-toolbar-chunk:last-child {
        display: none !important;
    }
}
/* =====================================================
   MODAL – Close button contrast fix
   ===================================================== */

.wpappsws-modal-actions #close,
#wpappsws-appointment-modal #close {
    background: #e5e7eb !important;      /* grigio chiaro ma leggibile */
    border: 1px solid #9ca3af !important;
    color: #111827 !important;           /* testo scuro */
    font-weight: 600;
}

/* Hover desktop */
.wpappsws-modal-actions #close:hover {
    background: #d1d5db !important;
    border-color: #6b7280 !important;
    color: #000 !important;
}

/* Focus / accessibilità */
.wpappsws-modal-actions #close:focus {
    outline: 2px solid #1b743e;
    outline-offset: 2px;
}
/* =====================================================
   MODAL – Close button definitive fix
   ===================================================== */

/* Close button – override WordPress .button */
#wpappsws-fullcalendar .wpappsws-modal-actions button#close,
#wpappsws-fullcalendar .wpappsws-modal-actions .button#close {
    background-color: #e5e7eb !important;
    border-color: #6b7280 !important;
    color: #111827 !important;
    font-weight: 600;
}

/* Hover */
#wpappsws-fullcalendar .wpappsws-modal-actions button#close:hover {
    background-color: #d1d5db !important;
    border-color: #4b5563 !important;
    color: #000 !important;
}

/* Focus (accessibilità) */
#wpappsws-fullcalendar .wpappsws-modal-actions button#close:focus {
    outline: 2px solid #1b743e;
    outline-offset: 2px;
}