/* File: frontend/html/css/ferie.css (VERSIONE FINALE CON POSIZIONAMENTO TOOLTIP CORRETTO) */

.ferie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ferie-counters-container {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ferie-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.counter-color-box {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.2);
}

.counter-label {
    font-size: 0.85rem;
    color: #555;
}

.counter-value {
    font-weight: bold;
    font-size: 0.9rem;
}

.ferie-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e8ed;
}

.palette-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

#ferieClearSelectionBtn.hidden {
    display: none;
}

.ferie-tooltip {
    position: absolute;
    display: none;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 0.75rem;
    z-index: 1000;
    /* *** CORREZIONE FINALE: Applica solo un piccolo offset verticale *** */
    transform: translateY(-15px); /* Sposta il tooltip 15px più in alto rispetto alla sua posizione calcolata */
}

/* Freccia del tooltip (ripristinata e corretta) */
.ferie-tooltip::after {
    content: '';
    position: absolute;
    display: block; /* Assicura che sia visibile */
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}


.color-palette {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    align-items: center;
    justify-items: center;
}

.color-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    box-sizing: border-box;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ferie-calendar-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.month-grid {
    background: #fdfdfd;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.month-grid.hiding {
    opacity: 0;
    transform: scale(0.95);
}

.month-grid.hidden {
    display: none;
}

.month-grid h4 {
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

.day-names, .days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.day-names { margin-bottom: 0.5rem; font-size: 0.75rem; text-align: center; color: #7f8c8d; font-weight: 500; }
.days-grid { gap: 4px; }


.day-cell {
    width: 100%;
    padding-top: 100%;
    position: relative;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.day-cell-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.day-cell.weekend { background-color: #ecf0f1; color: #7f8c8d; }
.day-cell:not(.empty):hover { transform: scale(1.05); box-shadow: 0 0 0 2px #3498db; }
.day-cell.selected { box-shadow: 0 0 0 3px #3498db; border-color: white; }
.day-cell.empty { background: transparent; cursor: default; border-color: transparent; }
.day-cell.colored .day-cell-content { font-weight: bold; }
.day-cell.dark-background .day-cell-content { color: white; }

/* Stile per il tooltip delle etichette */
.ferie-label-tooltip {
    position: absolute;
    display: none;
    background-color: #2c3e50;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1001;
    pointer-events: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .ferie-header, .ferie-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
