/* ==================== UX IMPROVEMENTS - CALENDAR ==================== */

/* 1. MODAL ANIMAZIONI */
.modal.active {
    animation: fadeIn 0.2s ease-out;
}

.modal-fullscreen {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 2. PULSANTI VISTA - Animazioni hover migliorate */
#viewDayBtn, #viewWeekBtn, #viewMonthBtn {
    position: relative;
    overflow: hidden;
}

#viewDayBtn::before,
#viewWeekBtn::before,
#viewMonthBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#viewDayBtn:hover::before,
#viewWeekBtn:hover::before,
#viewMonthBtn:hover::before {
    width: 300px;
    height: 300px;
}

/* 3. CALENDARIO - Smooth transitions */
#slotCalendarDays {
    transition: all 0.3s ease-in-out;
}

/* 4. SLOT CELLS - Migliori animazioni hover */
#slotCalendarDays > div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#slotCalendarDays > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 10;
}

/* 5. LOADING STATE */
.calendar-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.calendar-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 6. NAVIGAZIONE - Feedback visivo */
.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.nav-btn:active::after {
    width: 200px;
    height: 200px;
}

/* 7. SLOT SELECTION - Feedback visivo */
.slot-selected {
    animation: pulse 0.5s;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3) !important;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 8. TOOLTIP SU HOVER */
[title] {
    position: relative;
    cursor: help;
}

/* 9. SCROLL SMOOTH */
#slotCalendarDays {
    scroll-behavior: smooth;
}

.modal-body {
    scroll-behavior: smooth;
}

/* 10. FOCUS STATES - Accessibility */
button:focus,
.nav-btn:focus,
#viewDayBtn:focus,
#viewWeekBtn:focus,
#viewMonthBtn:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* 11. RESPONSIVE - Mobile gestures */
@media (max-width: 768px) {
    .modal-fullscreen {
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    #slotCalendarDays {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
}

/* 12. SKELETON LOADING per calendario */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 13. SUCCESSO/ERRORE FEEDBACK */
.slot-success {
    animation: successPulse 0.6s;
}

.slot-error {
    animation: errorShake 0.4s;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* 14. DARK MODE SUPPORT (future) */
@media (prefers-color-scheme: dark) {
    .calendar-body {
        background: #1e293b;
        color: #e2e8f0;
    }
}

