﻿/* ====================================================================
   SCHEDULER COMMON STYLES - VERSIONE PULITA
   Lascia che Syncfusion gestisca il layout nativo dello scheduler
   ==================================================================== */

/* --- CONTENITORI COMUNI --- */

/* Control section - base per tutti i display */
.control-section {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Content wrapper - base flex */
.content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

/* --- DESKTOP (?768px) --- */
@media (min-width: 768px) {
    .control-section {
        min-height: 0;
    }

    .content-wrapper {
        overflow: visible;
        min-height: 0;
    }

    /* Grid-to-schedule: layout orizzontale per scheduler + grid */
    .grid-to-schedule {
        flex-direction: row !important;
    }

    /* Schedule container */
    .schedule-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: visible;
        min-width: 0; /* Previene overflow in flexbox */
        min-height: 0;
    }

    /* Schedule content */
    .schedule-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: visible;
        min-width: 0; /* Previene overflow in flexbox */
        min-height: 0;
    }

    /* Grid laterale (solo Scheduler.razor) */
    .grid-content {
        width: 280px;
        flex-shrink: 0;
        overflow-y: auto;
        border-left: 1px solid #dee2e6;
        margin-left: 10px;
    }
}

/* --- MOBILE (<768px) --- */
@media (max-width: 767px) {
    .control-section {
        min-height: 100vh;
    }

    .content-wrapper {
        min-height: calc(100vh - 80px);
    }

    /* Grid nascosta in mobile */
    .grid-content {
        display: none !important;
    }

    .content-wrapper.grid-to-schedule .schedule-container .grid-content {
        margin-top: 10px;
        margin-left: 0;
        padding-top: 20px;
    }
}

/* --- FIX SYNCFUSION MOBILE --- */
@media (max-width: 767px) {
    .e-toolbar .e-toolbar-items {
        flex-wrap: wrap;
    }

    .e-content-wrap {
        -webkit-overflow-scrolling: touch;
    }
}

/* --- RIPOSIZIONAMENTO PRENOTAZIONI --- */

.prenotazione.in-reposition {
    border: 3px dashed #ff9800 !important;
    opacity: 0.7;
    animation: pulse-reposition 2s infinite;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

@keyframes pulse-reposition {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 152, 0, 0.5);
        opacity: 0.7;
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 0.8);
        opacity: 0.9;
    }
}

.e-schedule-table.e-content-table {
    cursor: inherit;
}

.schedule-content.reposition-mode .e-work-cells {
    cursor: pointer !important;
}

.schedule-content.reposition-mode .e-work-cells:hover {
    background-color: rgba(255, 152, 0, 0.1) !important;
}


/* ====================================================================
   DIFFERENZIAZIONE CORSI PER ANNO DI NASCITA
   Colori pastello per non appesantire la visualizzazione dello Scheduler.
   ==================================================================== */

.e-schedule .e-appointment.corso.nascita-rosso,
.birth-year-badge.nascita-rosso {
    --birth-band-color: #F3B5B5;
}

.e-schedule .e-appointment.corso.nascita-arancione,
.birth-year-badge.nascita-arancione {
    --birth-band-color: #F6C58B;
}

.e-schedule .e-appointment.corso.nascita-verde,
.birth-year-badge.nascita-verde {
    --birth-band-color: #B8DDB8;
}

.e-schedule .e-appointment.corso.nascita-blu,
.birth-year-badge.nascita-blu {
    --birth-band-color: #B9D5EF;
}

.e-schedule .e-appointment.corso.nascita-viola,
.birth-year-badge.nascita-viola {
    --birth-band-color: #D2B9E5;
}

.e-schedule .e-appointment.corso.nascita-giallo,
.birth-year-badge.nascita-giallo {
    --birth-band-color: #FFEE9C;
}

.e-schedule .e-appointment.corso.nascita-marrone,
.birth-year-badge.nascita-marrone {
    --birth-band-color: #D5B9A5;
}

.e-schedule .e-appointment.corso.nascita-grigio,
.birth-year-badge.nascita-grigio {
    --birth-band-color: #D2D6DA;
}

.e-schedule .e-appointment.corso.nascita-nero,
.birth-year-badge.nascita-nero {
    --birth-band-color: #59616A;
}

.e-schedule .e-appointment.corso[class*="nascita-"] {
    border-left: 5px solid var(--birth-band-color) !important;
}

/* Badge anno di nascita nel dettaglio del corso */
.birth-year-badge {
    min-width: 4.5rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background-color: var(--birth-band-color) !important;
    color: #212529 !important;
    font-weight: 600;
}

.birth-year-badge.nascita-nero {
    color: #fff !important;
}
