/* ===== ESTILOS MODERNOS DO CALENDÁRIO ===== */

/* Container principal do calendário */
.calendar-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 1px 8px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.calendar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px 20px 0 0;
}

.calendar-container:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.08);
}

/* Cabeçalho do calendário */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 10px;
}

.calendar-nav {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
    position: relative;
    overflow: hidden;
}

.calendar-nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.calendar-nav:hover::before {
    width: 100%;
    height: 100%;
}

.calendar-nav:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
}

.calendar-nav:active {
    transform: scale(0.95);
}

.calendar-nav:disabled {
    background: linear-gradient(145deg, #e9ecef, #dee2e6);
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-nav:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Grid do calendário */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

/* Cabeçalhos dos dias da semana */
.calendar-day-header {
    text-align: center;
    font-weight: 700;
    padding: 15px 8px;
    color: var(--primary-color);
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.05));
    border-radius: 10px;
    margin-bottom: 5px;
    position: relative;
    overflow: hidden;
}

.calendar-day-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
    border-radius: 1px;
}

/* Dias do calendário */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    background: white;
    border: 2px solid transparent;
    min-height: 45px;
    overflow: hidden;
}

.calendar-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calendar-day:hover::before {
    opacity: 1;
}

.calendar-day:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Estados dos dias */
.calendar-day.other-month {
    color: #bbb;
    cursor: not-allowed;
    background: #f8f9fa;
    opacity: 0.5;
}

.calendar-day.other-month:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.available {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    color: #2e7d32;
    border: 2px solid #4caf50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.calendar-day.available:hover {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.4);
}

.calendar-day.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: 2px solid var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
    animation: pulse 2s infinite;
}

.calendar-day.today {
    border: 3px solid var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
    position: relative;
}

.calendar-day.today::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

.calendar-day.unavailable {
    color: #ccc;
    cursor: not-allowed;
    background: #f8f9fa;
    opacity: 0.6;
    position: relative;
}

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

.calendar-day.holiday {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 2px solid #ff9800;
    color: #e65100;
    font-weight: 700;
    position: relative;
}

.calendar-day.holiday::before {
    content: '🎉';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    animation: bounce 2s infinite;
}

.calendar-day.holiday:hover {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: white;
    cursor: help;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.3);
}

/* Container de horários */
.time-slots-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 1px 8px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-slots-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    border-radius: 20px 20px 0 0;
}

.time-slots-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.time-slots-title i {
    color: #4caf50;
    font-size: 1.4rem;
    animation: rotate 3s linear infinite;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px;
}

/* Slots de horário */
.time-slot {
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    position: relative;
    overflow: hidden;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.time-slot:hover::before {
    left: 100%;
}

.time-slot:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.05));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.2);
}

.time-slot.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
    animation: pulse 2s infinite;
}

.time-slot.unavailable {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
    opacity: 0.7;
}

.time-slot.unavailable:hover {
    transform: none;
    box-shadow: none;
}

.time-slot-disabled {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.5;
    text-decoration: line-through;
    border: 2px solid #dee2e6 !important;
    position: relative;
}

.time-slot-disabled::after {
    content: '⏰';
    position: absolute;
    top: 0px;
    font-size: 15px;
    opacity: 0.7;
}

.time-slot-disabled:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Estados de carregamento */
.loading-calendar {
    text-align: center;
    padding: 50px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.loading-calendar i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
    color: var(--primary-color);
}

.loading-calendar p {
    font-size: 1.1rem;
    font-weight: 500;
}

.no-times-available {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 30px;
    color: #6c757d;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border: 2px dashed #dee2e6;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.no-times-available::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23dee2e6' fill-opacity='0.3'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.1;
}

.no-times-available i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #adb5bd;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.no-times-available p {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Animações */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.6);
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

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

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

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVIDADE AVANÇADA ===== */

/* Tablets grandes e desktops pequenos */
@media (max-width: 1024px) {
    .calendar-container {
        padding: 25px;
        border-radius: 18px;
    }
    
    .calendar-nav {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .calendar-title {
        font-size: 1.4rem;
    }
    
    .time-slots-container {
        padding: 25px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 12px;
    }
    
    .time-slot {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .calendar-container {
        padding: 20px;
        border-radius: 16px;
        margin-bottom: 25px;
    }
    
    .calendar-header {
        margin-bottom: 20px;
        padding: 0 5px;
    }
    
    .calendar-nav {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .calendar-title {
        font-size: 1.3rem;
    }
    
    .calendar-grid {
        gap: 6px;
        padding: 8px;
    }
    
    .calendar-day-header {
        padding: 12px 6px;
        font-size: 0.85rem;
    }
    
    .calendar-day {
        font-size: 0.9rem;
        min-height: 40px;
        border-radius: 10px;
    }
    
    .time-slots-container {
        padding: 20px;
        border-radius: 16px;
    }
    
    .time-slots-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
        gap: 10px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .time-slot {
        padding: 12px 14px;
        font-size: 0.9rem;
        border-radius: 12px;
    }
    
    .no-times-available {
        padding: 40px 20px;
    }
    
    .no-times-available i {
        font-size: 3rem;
    }
    
    .no-times-available p {
        font-size: 1.1rem;
    }
}

/* Smartphones grandes */
@media (max-width: 480px) {
    .calendar-container {
        padding: 15px;
        border-radius: 14px;
        margin-bottom: 20px;
    }
    
    .calendar-header {
        margin-bottom: 15px;
        gap: 10px;
    }
    
    .calendar-nav {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .calendar-title {
        font-size: 1.1rem;
        flex: 1;
    }
    
    .calendar-grid {
        gap: 4px;
        padding: 6px;
    }
    
    .calendar-day-header {
        padding: 10px 4px;
        font-size: 0.75rem;
    }
    
    .calendar-day {
        font-size: 0.8rem;
        min-height: 35px;
        border-radius: 8px;
    }
    
    .time-slots-container {
        padding: 15px;
        border-radius: 14px;
    }
    
    .time-slots-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 10px;
        min-height: 45px;
    }
    
    .no-times-available {
        padding: 30px 15px;
    }
    
    .no-times-available i {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .no-times-available p {
        font-size: 1rem;
    }
    
    .loading-calendar {
        padding: 40px 15px;
    }
    
    .loading-calendar i {
        font-size: 2rem;
    }
}

/* Smartphones pequenos */
@media (max-width: 375px) {
    .calendar-container {
        padding: 12px;
        border-radius: 12px;
    }
    
    .calendar-nav {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .calendar-title {
        font-size: 1rem;
    }
    
    .calendar-grid {
        gap: 3px;
        padding: 5px;
    }
    
    .calendar-day-header {
        padding: 8px 2px;
        font-size: 0.7rem;
    }
    
    .calendar-day {
        font-size: 0.75rem;
        min-height: 32px;
        border-radius: 6px;
    }
    
    .time-slots-container {
        padding: 12px;
    }
    
    .time-slots-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
        gap: 6px;
    }
    
    .time-slot {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 8px;
        min-height: 40px;
    }
}

/* Smartphones muito pequenos */
@media (max-width: 320px) {
    .calendar-container {
        padding: 10px;
        border-radius: 10px;
    }
    
    .calendar-nav {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    
    .calendar-title {
        font-size: 0.9rem;
    }
    
    .calendar-grid {
        gap: 2px;
        padding: 4px;
    }
    
    .calendar-day-header {
        padding: 6px 1px;
        font-size: 0.65rem;
    }
    
    .calendar-day {
        font-size: 0.7rem;
        min-height: 30px;
        border-radius: 5px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 5px;
    }
    
    .time-slot {
        padding: 7px 8px;
        font-size: 0.75rem;
        border-radius: 6px;
        min-height: 38px;
    }
}

/* Melhorias para dispositivos touch */
@media (hover: none) and (pointer: coarse) {
    .calendar-day {
        min-height: 48px;
    }
    
    .time-slot {
        min-height: 48px;
        padding: 14px 16px;
    }
    
    .calendar-nav {
        width: 48px;
        height: 48px;
    }
    
    /* Aumentar área de toque em dispositivos pequenos */
    @media (max-width: 480px) {
        .calendar-day {
            min-height: 42px;
        }
        
        .time-slot {
            min-height: 44px;
            padding: 12px 14px;
        }
        
        .calendar-nav {
            width: 42px;
            height: 42px;
        }
    }
}

/* Orientação landscape em dispositivos móveis */
@media (max-width: 768px) and (orientation: landscape) {
    .calendar-container {
        padding: 15px;
    }
    
    .calendar-day {
        min-height: 30px;
        font-size: 0.8rem;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .time-slot {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Modo escuro (se suportado pelo sistema) */
@media (prefers-color-scheme: dark) {
    .calendar-container,
    .time-slots-container {
        background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #f8f9fa;
    }
    
    .calendar-day {
        background: #495057;
        color: #f8f9fa;
    }
    
    .calendar-day.available {
        background: linear-gradient(135deg, #1e4620, #2e5930);
        color: #4caf50;
    }
    
    .calendar-day.holiday {
        background: linear-gradient(135deg, #3e2723, #5d4037);
        color: #ff9800;
    }
    
    .time-slot {
        background: linear-gradient(135deg, #495057, #6c757d);
        color: #f8f9fa;
        border-color: #6c757d;
    }
    
    .no-times-available {
        background: linear-gradient(135deg, #495057, #6c757d);
        color: #adb5bd;
        border-color: #6c757d;
    }
}

/* Redução de movimento para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .calendar-day:hover,
    .time-slot:hover,
    .calendar-nav:hover {
        transform: none !important;
    }
}

/* Melhorias para impressão */
@media print {
    .calendar-container,
    .time-slots-container {
        box-shadow: none;
        border: 1px solid #000;
        background: white !important;
    }
    
    .calendar-nav {
        display: none;
    }
    
    .calendar-day,
    .time-slot {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
}

