/* ===== CALENDÁRIO MODERNO ===== */
.calendar-container {
    padding: 0 10px;
    margin-bottom: 10px;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* HEADERS ESTÁTICOS - VERSÃO FINAL CORRIGIDA */
.day-header {
    font-weight: 700;
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%) !important;
    color: #ffffff !important;
    text-align: center;
    min-height: 30px !important; /* Reduzido de 45px para 30px */
    padding: 8px 4px !important; /* Reduzido de 12px 5px */
    border-radius: 10px; /* Ligeiramente menor */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Sombra mais suave */
    font-size: 0.8rem; /* Texto um pouco menor */
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.3px; /* Reduzido */
    cursor: default;
    user-select: none;
    pointer-events: none;
}

/* DIAS NORMAIS */
.day {
    border: none;
    padding: 12px 8px;
    min-height: 100px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.day:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.day:hover::before {
    opacity: 1;
}

.day:active {
    transform: translateY(-1px);
    transition: transform 0.1s;
}

/* TEXTO DENTRO DOS DIAS */
.day strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #2d3748;
}

.day p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #4a5568;
}

.day p strong {
    display: inline;
    font-size: 0.75rem;
    font-weight: 600;
}

/* CORES DE STATUS */
.calendar .day.disponivel { 
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border: 2px solid #38b2ac;
}

.calendar .day.disponivel::before {
    background: linear-gradient(90deg, #38b2ac, #319795);
    opacity: 1;
}

.calendar .day.indisponivel { 
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 2px solid #fc8181;
}

.calendar .day.empty { 
    background: rgba(237, 242, 247, 0.5);
    cursor: default;
    border: 2px dashed #cbd5e0;
    box-shadow: none;
}

.calendar .day.empty:hover {
    transform: none;
    box-shadow: none;
}

/* DIAS COM MARCAÇÕES DO UTILIZADOR */
.day[data-date] {
    position: relative;
}

.day.has-bookings::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
}

/* ANIMAÇÃO DE DESTAQUE */
@keyframes pulse-gentle {
    0%, 100% { 
        box-shadow: 
            0 4px 15px rgba(0, 0, 0, 0.08),
            0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% { 
        box-shadow: 
            0 4px 15px rgba(0, 0, 0, 0.08),
            0 0 0 8px rgba(102, 126, 234, 0);
    }
}

.highlight-day {
    animation: pulse-gentle 2s ease-in-out infinite;
    border: 2px solid #667eea !important;
}

/* LEGENDA MODERNA */
.legend-modern {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #4a5568;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-color.disponivel { 
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border: 1px solid #38b2ac;
}
.legend-color.indisponivel { 
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 1px solid #fc8181;
}
.legend-color.nao-aplicavel { 
    background: rgba(237, 242, 247, 0.8);
    border: 1px dashed #cbd5e0;
}

/* ===== RESPONSIVE MOBILE FIRST ===== */
@media (max-width: 768px) {
    .calendar {
        gap: 4px;
        padding: 10px;
        border-radius: 16px;
    }
    
    .day {
        min-height: 80px;
        padding: 8px 4px;
        border-radius: 12px;
    }
    
    .day-header {
        min-height: 25px !important; /* Ainda mais compacto em mobile */
        padding: 6px 3px !important; /* Menos padding */
        font-size: 0.75rem; /* Texto menor */
        border-radius: 8px; /* Cantos mais suaves */
        letter-spacing: 0.2px;
    }
    
    .day strong {
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .day p {
        font-size: 0.7rem;
    }
    
    .legend-modern {
        gap: 10px;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .calendar {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
        padding: 8px;
    }
    .day-header {
        min-height: 20px !important; /* Mínimo possível */
        padding: 5px 2px !important; /* Mínimo padding */
        font-size: 0.7rem; /* Texto muito compacto */
    }    
    .day {
        min-height: 70px;
        padding: 6px 2px;
    }
    
    .day strong {
        font-size: 0.9rem;
    }
    
    .day p {
        font-size: 0.65rem;
    }
}

/* ESTADO DE CARREGAMENTO */
.calendar.loading {
    opacity: 0.7;
    pointer-events: none;
}

.calendar.loading::after {
    content: 'A carregar...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #667eea;
    font-weight: 600;
}

/* ===== CALENDAR STATUS COLORS transitado do my_shedules.php ===== */
/* .calendar .day.disponivel {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border: 2px solid #38b2ac;
} */

.calendar .day.ferias {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 2px solid #feb2b2;
}

.calendar .day.ausencia {
    background: linear-gradient(135deg, #faf5ff 0%, #e9d8fd 100%);
    border: 2px solid #d6bcfa;
}

/* .calendar .day.indisponivel {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 2px solid #fc8181;
} */

.calendar .day.indisponivel.past {
    background-color: #f8f9fa;
    opacity: 0.7;
}

/* Legend Colors */
.legend-color.disponivel {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border: 1px solid #38b2ac;
}

.legend-color.ferias {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #feb2b2;
}

.legend-color.ausencia {
    background: linear-gradient(135deg, #faf5ff 0%, #e9d8fd 100%);
    border: 1px solid #d6bcfa;
}

.legend-color.indisponivel {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 1px solid #fc8181;
}

.legend-color.nao-aplicavel {
    background: rgba(237, 242, 247, 0.8);
    border: 1px dashed #cbd5e0;
}