/**
 * HealthNet Calendar - Estilos do Calendário
 * 
 * Estilos específicos para o componente de calendário interativo
 */

.calendar-container {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 0.5rem;
    color: white;
}

.calendar-header button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.calendar-header button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.calendar-date {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    min-width: 200px;
}

.calendar-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.slot {
    padding: 1.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    background-color: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

.slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
    pointer-events: none;
}

.slot-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.slot-status {
    font-size: 0.875rem;
    color: #64748b;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* Estado: Livre */
.slot.free {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.slot.free:hover {
    border-color: #059669;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

.slot.free .slot-status {
    color: #10b981;
    font-weight: 600;
}

/* Estado: Ocupado */
.slot.busy {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
    opacity: 0.7;
    cursor: not-allowed;
}

.slot.busy:hover {
    border-color: #dc2626;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    transform: none;
}

.slot.busy .slot-status {
    color: #ef4444;
    font-weight: 600;
}

/* Responsividade */
@media (max-width: 768px) {
    .calendar-container {
        padding: 1rem;
    }

    .calendar-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .calendar-header button {
        width: 100%;
    }

    .calendar-date {
        min-width: auto;
        font-size: 1.25rem;
    }

    .calendar-slots {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .slot {
        padding: 1rem 0.75rem;
        min-height: 80px;
    }

    .slot-time {
        font-size: 1rem;
    }

    .slot-status {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .calendar-slots {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .slot {
        padding: 0.75rem 0.5rem;
        min-height: 70px;
    }

    .slot-time {
        font-size: 0.9rem;
    }

    .slot-status {
        font-size: 0.65rem;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-slots {
    animation: slideIn 0.3s ease;
}

.slot {
    animation: slideIn 0.3s ease backwards;
}

.slot:nth-child(1) { animation-delay: 0.05s; }
.slot:nth-child(2) { animation-delay: 0.1s; }
.slot:nth-child(3) { animation-delay: 0.15s; }
.slot:nth-child(4) { animation-delay: 0.2s; }
.slot:nth-child(5) { animation-delay: 0.25s; }
.slot:nth-child(6) { animation-delay: 0.3s; }
.slot:nth-child(7) { animation-delay: 0.35s; }
.slot:nth-child(8) { animation-delay: 0.4s; }
.slot:nth-child(9) { animation-delay: 0.45s; }
.slot:nth-child(10) { animation-delay: 0.5s; }

/* ====================================================
   HealthNet Calendar v3.0 — Slots com médico + semana
==================================================== */

/* Header aprimorado */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0 12px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cal-nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    transition: all .15s;
}
.cal-nav-btn:hover { background: #e2e8f0; }

.cal-date-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}

.cal-weekday {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #94a3b8;
    font-weight: 600;
}

.cal-date-label {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.cal-view-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.cal-view-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    transition: all .15s;
}
.cal-view-btn.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* Filtro de médicos */
.cal-prof-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    overflow-x: auto;
}

.cal-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.cal-prof-pills {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
}

.cal-prof-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    min-width: fit-content;
}
.cal-prof-pill:hover:not(:disabled) { border-color: #0f172a; background: #f8fafc; }
.cal-prof-pill.active { background: #0f172a; border-color: #0f172a; color: #fff; }
.cal-prof-pill.active .pill-spec { color: #94a3b8; }
.cal-prof-pill.vacation { background: #fffbeb; border-color: #fde68a; cursor: not-allowed; opacity: .8; }

.pill-name  { font-size: 12px; font-weight: 600; }
.pill-spec  { font-size: 10px; color: #94a3b8; }
.pill-vacation { font-size: 10px; color: #d97706; margin-top: 1px; }

/* Slots — visão diária */
.cal-day-view {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all .15s;
    background: #fff;
}
.cal-slot.busy  { border-color: #bfdbfe; background: #eff6ff; }
.cal-slot.free  { border-color: #e2e8f0; background: #fff; }
.cal-slot.busy:hover  { box-shadow: 0 2px 12px rgba(59,130,246,.15); border-color: #93c5fd; }
.cal-slot.free:hover  { background: #f8fafc; border-color: #cbd5e1; }

.slot-time-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}
.slot-time     { font-size: 15px; font-weight: 700; color: #1e40af; }
.slot-duration { font-size: 10px; color: #94a3b8; }
.cal-slot.free .slot-time { color: #64748b; }

.slot-info { flex: 1; }

.slot-doctor {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.slot-doctor-icon { font-size: 18px; line-height: 1.3; }
.slot-doctor div  { display: flex; flex-direction: column; gap: 2px; }
.slot-doctor-name { font-size: 14px; font-weight: 600; color: #1e3a8a; }
.slot-doctor-spec { font-size: 11px; color: #64748b; }
.slot-doctor-crm  { font-size: 10px; color: #94a3b8; }

.slot-patient {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: #374151;
}
.slot-patient-icon { font-size: 13px; }

.slot-notes {
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}

.slot-free-info { display: flex; align-items: center; }
.slot-free-text { font-size: 13px; color: #94a3b8; }

.slot-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.busy-badge { background: #dbeafe; color: #1d4ed8; }
.free-badge { background: #f1f5f9; color: #94a3b8; }

/* Detalhe do agendamento */
.appt-detail-card { display: flex; flex-direction: column; gap: 16px; padding: 4px 0; }
.appt-detail-row  { display: flex; align-items: flex-start; gap: 12px; }
.appt-detail-icon { font-size: 22px; line-height: 1.2; }
.appt-detail-row strong { font-size: 11px; text-transform: uppercase;
    letter-spacing: .5px; color: #64748b; display: block; margin-bottom: 2px; }
.appt-detail-row p    { margin: 0; font-size: 14px; color: #0f172a; font-weight: 500; }
.appt-detail-row small { font-size: 12px; color: #64748b; }

.status-badge { padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.status-scheduled { background: #dbeafe; color: #1d4ed8; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Visão semanal */
.cal-week-view {
    display: grid;
    grid-template-rows: auto;
    overflow-x: auto;
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 4px;
}

.week-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s;
}
.week-day-header:hover { background: #f1f5f9; }
.week-day-header.today { background: #eff6ff; }
.week-day-name { font-size: 10px; text-transform: uppercase; color: #64748b; letter-spacing: .5px; font-weight: 600; }
.week-day-num  { font-size: 18px; font-weight: 700; color: #0f172a; }
.week-day-header.today .week-day-num { color: #2563eb; }
.week-time-col { padding: 8px 8px 8px 0; color: #94a3b8; font-size: 11px; font-weight: 600; }

.week-row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    gap: 2px;
    min-height: 48px;
}

.week-cell {
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    transition: background .12s;
    min-height: 48px;
}
.week-cell:hover     { background: #f8fafc; }
.week-cell.has-appt  { background: #eff6ff; border-color: #bfdbfe; }

.week-appt {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.week-appt-time { font-size: 10px; font-weight: 700; color: #1d4ed8; }
.week-appt-doc  { font-size: 10px; color: #1e3a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-appt-pat  { font-size: 10px; color: #374151; }
