﻿/* --- css/calendar.css --- */
/* Stili globali per il Calendario Interattivo Magistralis */

.calendar-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #c5a059;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    user-select: none;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    min-height: 280px; 
}

.cal-global-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid #c5b89a;
    z-index: 2; position: relative; background: rgba(0,0,0,0.2); 
}

.cal-months-container {
    display: flex; gap: 20px; justify-content: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.3s ease;
    opacity: 1; transform: translateX(0);
}

/* Animazioni Slide */
.slide-out-left { transform: translateX(-50px) !important; opacity: 0 !important; }
.slide-out-right { transform: translateX(50px) !important; opacity: 0 !important; }
.slide-in-from-right { animation: slideInRight 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }
.slide-in-from-left { animation: slideInLeft 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }

@keyframes slideInRight { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInLeft { from { transform: translateX(-50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.single-month { flex: 1; min-width: 250px; }
.cal-month-label { text-align: center; color: #c5a059; font-family: 'Cinzel', serif; font-weight: 700; margin-bottom: 10px; font-size: 0.9rem; }
.cal-btn { background: none; border: 1px solid #c5b89a; color: #c5a059; border-radius: 4px; cursor: pointer; padding: 4px 10px; transition: all 0.3s; }
.cal-btn:hover { background: #c5a059; color: #000; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-day-name { font-size: 0.8rem; color: #b0bec5; text-transform: uppercase; margin-bottom: 5px; }

/* --- CELLE GIORNI --- */
.cal-day {
    padding: 6px 0; border-radius: 4px; cursor: pointer; color: #c5b89a; font-size: 0.85rem;
    transition: all 0.2s; border: 1px solid transparent; position: relative;
}
.cal-day:hover:not(.empty) { background: rgba(255, 255, 255, 0.1); border-color: #c5b89a; z-index: 10; }
.cal-day.empty { cursor: default; }

/* STILI GIORNI SPECIALI */
.cal-day.today { border: 1px solid #c5a059; }
.cal-day.saturday { color: #e67e22; }
.cal-day.sunday { color: #e74c3c; }

/* FESTIVITÀ */
.cal-day.holiday {
    color: #fff !important;
    text-shadow: 0 0 5px #ffd700, 0 0 10px #c5a059;
    font-weight: 700;
    font-size: 1.1rem; 
}

/* TOOLTIP FESTIVITÀ */
.cal-day.holiday:hover::after {
    content: attr(data-tooltip);
    white-space: pre;
    position: absolute;
    bottom: 115%; left: 50%; transform: translateX(-50%);
    background: rgba(10, 16, 25, 0.98);
    border: 1px solid #c5a059;
    color: #c5a059;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 100;
    text-shadow: none;
    font-weight: normal;
    min-width: 120px;
}

.cal-day.holiday:hover::before {
    content: '';
    position: absolute;
    bottom: 95%; left: 50%; transform: translateX(-50%);
    border-width: 6px; border-style: solid;
    border-color: #c5a059 transparent transparent transparent;
    z-index: 100;
}

/* ============================================================
   STATI SELEZIONE (Highlight Oro Magistralis - NO GLOW)
   ============================================================ */

/* Data di Inizio e Fine (Punti di ancoraggio) */
.cal-day.selected { 
    background: #c5a059 !important; /* Oro Pieno */
    color: #0f2027 !important;      /* Testo Scuro */
    font-weight: 700; 
    text-shadow: none !important; 
    
    /* MODIFICA: Rimossa qualsiasi ombra esterna (alone) */
    box-shadow: none !important; 
    
    font-size: 0.9rem; 
    z-index: 20;
    border: 1px solid #c5a059;
}

/* Range Intermedio */
.cal-day.in-range { 
    background-color: #c5b89a !important;
    box-shadow: inset 0 0 10px rgba(197, 160, 89, 0.5); /* Manteniamo l'ombra INTERNA per profondità */
    
    color: #ffffff !important; 
    text-shadow: none; 
    
    border-top: 1px solid rgba(197, 160, 89, 0.5);
    border-bottom: 1px solid rgba(197, 160, 89, 0.5);
    border-left: none;
    border-right: none;
    
    border-radius: 0; 
    font-size: 0.85rem;
    z-index: 5;
}

/* Arrotondamenti estremi (Senza ombre di connessione esterne) */
.cal-day.range-start { 
    border-top-right-radius: 0; 
    border-bottom-right-radius: 0; 
    box-shadow: none !important; /* Rimosso alone di connessione */
}

.cal-day.range-end { 
    border-top-left-radius: 0; 
    border-bottom-left-radius: 0; 
    box-shadow: none !important; /* Rimosso alone di connessione */
}