/* ===== CALENDARIO INTERACTIVO MODERNO ===== */

.calendar-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px 0;
    max-width: 500px;
    width: 100%;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.calendar-nav-btn {
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.calendar-nav-btn:hover {
    background: var(--primary-600);
    transform: scale(1.1);
}

.calendar-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.calendar-month-year {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    min-width: 200px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 15px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.calendar-day:hover {
    background: var(--primary-100);
    transform: scale(1.05);
}

.calendar-day.other-month {
    color: #ccc;
    background: #f0f0f0;
    cursor: not-allowed;
}

.calendar-day.other-month:hover {
    transform: none;
    background: #f0f0f0;
}

.calendar-day.past {
    color: #999;
    background: #f5f5f5;
    cursor: not-allowed;
}

.calendar-day.past:hover {
    transform: none;
    background: #f5f5f5;
}

.calendar-day.available {
    background: white;
    border-color: var(--primary-200);
    color: var(--text-primary);
}

.calendar-day.available:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
}

.calendar-day.selected {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-600);
    transform: scale(1.1);
}

.calendar-day.selected:hover {
    background: var(--primary-600);
}

.calendar-day.unavailable {
    background: #ffebee;
    color: #c62828;
    cursor: not-allowed;
    position: relative;
}

.calendar-day.unavailable:hover {
    transform: none;
    background: #ffebee;
}

.calendar-day.unavailable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #c62828;
    transform: translateY(-50%) rotate(-45deg);
}

.calendar-day.today {
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--primary-300);
}

.calendar-day.today.available {
    background: var(--primary-50);
}

/* Indicadores de disponibilidad */
.calendar-day.limited::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #ff9800;
    border-radius: 50%;
}

.calendar-day.busy::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #f44336;
    border-radius: 50%;
}

/* Leyenda del calendario */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-available { background: var(--primary-500); }
.legend-unavailable { background: #c62828; }
.legend-limited { background: #ff9800; }
.legend-selected { background: var(--primary-600); }

/* Selector de horarios */
.time-slots-container {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.time-slots-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.time-slot {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    background: white;
}

.time-slot:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.time-slot.selected {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-600);
}

.time-slot.unavailable {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
}

.time-slot.unavailable:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

/* Información de la fecha seleccionada */
.selected-date-info {
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    display: none;
}

.selected-date-info.show {
    display: block;
}

.selected-date-text {
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 8px;
}

.selected-time-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-container {
        padding: 20px;
        margin: 15px 0;
    }
    
    .calendar-month-year {
        font-size: 18px;
        min-width: 150px;
    }
    
    .calendar-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .calendar-day {
        font-size: 14px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 6px;
    }
    
    .time-slot {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Animaciones */
@keyframes calendar-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-container {
    animation: calendar-fade-in 0.5s ease-out;
}

.calendar-day {
    animation: calendar-fade-in 0.3s ease-out;
}

.time-slot {
    animation: calendar-fade-in 0.4s ease-out;
}
