/**
 * CECWEB Calendar
 * Estilos padrão para integração do FullCalendar ao CECWEB.
 */

/* -------------------------------------------------------------------------- */
/* CONTAINER PRINCIPAL                                                        */
/* -------------------------------------------------------------------------- */

.cec-calendar-wrapper {
    position: relative;
    width: 100%;
    padding: 16px;
    border: 1px solid #dde3ea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.cec-calendar {
    min-height: 640px;
}

/* -------------------------------------------------------------------------- */
/* CABEÇALHO E BOTÕES                                                         */
/* -------------------------------------------------------------------------- */

.fc .fc-toolbar {
    margin-bottom: 1.25rem;
    gap: 10px;
}

.fc .fc-toolbar-title {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 700;
}

.fc .fc-button {
    border-radius: 8px;
    font-weight: 600;
    text-transform: capitalize;
    box-shadow: none !important;
}

.fc .fc-button-primary {
    border-color: #245f9e;
    background-color: #245f9e;
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus {
    border-color: #1d4d80;
    background-color: #1d4d80;
}

.fc .fc-button-primary:disabled {
    border-color: #9aa9b8;
    background-color: #9aa9b8;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    border-color: #173b67;
    background-color: #173b67;
}

/* -------------------------------------------------------------------------- */
/* GRADE DO CALENDÁRIO                                                        */
/* -------------------------------------------------------------------------- */

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: #e5e7eb;
}

.fc .fc-col-header-cell {
    background: #f8fafc;
}

.fc .fc-col-header-cell-cushion {
    padding: 8px 4px;
    color: #334155;
    font-weight: 700;
    text-decoration: none;
}

.fc .fc-daygrid-day-number {
    padding: 6px 8px;
    color: #334155;
    font-weight: 600;
    text-decoration: none;
}

.fc .fc-day-today {
    background: #eff6ff !important;
}

.fc .fc-daygrid-day:hover {
    background: #f8fafc;
}

/* -------------------------------------------------------------------------- */
/* EVENTOS                                                                    */
/* -------------------------------------------------------------------------- */

.fc .fc-event {
    border-radius: 6px;
    padding: 1px 3px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
}

.fc .fc-event-title {
    white-space: normal;
}

.cec-event-pendente {
    border-color: #0d6efd !important;
    background-color: #0d6efd !important;
}

.cec-event-concluido {
    border-color: #198754 !important;
    background-color: #198754 !important;
}

.cec-event-reagendado {
    border-color: #fd7e14 !important;
    background-color: #fd7e14 !important;
}

.cec-event-cancelado {
    border-color: #6c757d !important;
    background-color: #6c757d !important;
}

.cec-event-nao-comparece {
    border-color: #dc3545 !important;
    background-color: #dc3545 !important;
}

/* -------------------------------------------------------------------------- */
/* VISUALIZAÇÕES DE HORA E LISTA                                              */
/* -------------------------------------------------------------------------- */

.fc .fc-timegrid-slot-label {
    color: #64748b;
    font-size: 0.8rem;
}

.fc .fc-timegrid-axis-cushion {
    color: #64748b;
}

.fc .fc-list-event:hover td {
    background: #f8fafc;
}

.fc .fc-list-day-cushion {
    background: #eef2f7;
}

/* -------------------------------------------------------------------------- */
/* ESTADOS DE CARREGAMENTO                                                    */
/* -------------------------------------------------------------------------- */

.cec-calendar-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* -------------------------------------------------------------------------- */
/* LEGENDA                                                                    */
/* -------------------------------------------------------------------------- */

.cec-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    color: #475569;
    font-size: 0.82rem;
}

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

.cec-calendar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* -------------------------------------------------------------------------- */
/* VISUALIZAÇÃO MENSAL                                                        */
/* -------------------------------------------------------------------------- */

/*
 * Remove o azul padrão dos links de dias, cabeçalhos e eventos.
 */
.fc a {
    color: inherit;
    text-decoration: none;
}

/*
 * Dias da semana: segunda, terça, quarta...
 */
.fc .fc-col-header-cell-cushion {
    display: block;
    padding: 10px 5px;
    color: #334155 !important;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/*
 * Número dos dias do mês.
 */
.fc .fc-daygrid-day-number {
    color: #334155 !important;
    font-size: 0.88rem;
    font-weight: 700;
}

/*
 * Dias que pertencem ao mês anterior ou seguinte.
 */
.fc .fc-day-other .fc-daygrid-day-number {
    color: #a0aec0 !important;
}

/*
 * Destaca o dia atual.
 */
.fc .fc-day-today {
    background-color: #fff7df !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    margin: 3px;
    border-radius: 50%;
    color: #ffffff !important;
    background-color: #d97706;
}

/*
 * Altura mínima das células do calendário mensal.
 */
.fc .fc-daygrid-day-frame {
    min-height: 110px;
}

/*
 * Espaçamento entre eventos dentro do dia.
 */
.fc .fc-daygrid-event-harness {
    margin-top: 2px;
}

/*
 * Aparência dos eventos na visualização mensal.
 */
.fc .fc-daygrid-event {
    margin: 2px 4px;
    padding: 3px 6px;
    border-radius: 5px;
}

/*
 * Horário apresentado dentro do evento.
 */
.fc .fc-daygrid-event .fc-event-time {
    color: #ffffff !important;
    font-size: 0.72rem;
    font-weight: 700;
}

/*
 * Título apresentado dentro do evento.
 */
.fc .fc-daygrid-event .fc-event-title {
    color: #ffffff !important;
    font-size: 0.76rem;
    font-weight: 600;
}

/*
 * Botão "+ mais" quando o dia possui muitos eventos.
 */
.fc .fc-daygrid-more-link {
    display: block;
    margin: 3px 5px;
    color: #475569 !important;
    font-size: 0.76rem;
    font-weight: 700;
}

.fc .fc-daygrid-more-link:hover {
    color: #111827 !important;
    text-decoration: underline;
}
/* -------------------------------------------------------------------------- */
/* VISUALIZAÇÃO EM LISTA                                                      */
/* -------------------------------------------------------------------------- */

/*
 * Contêiner da lista.
 */
.fc .fc-list {
    border-color: #dce3ea;
    border-radius: 10px;
    overflow: hidden;
}

/*
 * Cabeçalho de cada dia.
 */
.fc .fc-list-day-cushion {
    padding: 10px 14px;
    color: #1f2937;
    background: #eef2f7;
}

/*
 * Texto da data.
 */
.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
    color: #1f2937 !important;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none !important;
}

/*
 * Linhas dos eventos.
 */
.fc .fc-list-event td {
    padding-top: 10px;
    padding-bottom: 10px;
    border-color: #edf0f3;
    background: #ffffff;
}

/*
 * Efeito ao passar o mouse.
 */
.fc .fc-list-event:hover td {
    background: #f8fafc !important;
}

/*
 * Horário dos eventos.
 */
.fc .fc-list-event-time {
    width: 105px;
    color: #475569 !important;
    font-size: 0.82rem;
    font-weight: 700;
}

/*
 * Título do evento.
 */
.fc .fc-list-event-title,
.fc .fc-list-event-title a {
    color: #1f2937 !important;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none !important;
}

/*
 * Ponto colorido que identifica o status.
 */
.fc .fc-list-event-dot {
    border-width: 5px;
}

/*
 * Remove a cor azul dos links internos da lista.
 */
.fc .fc-list a {
    color: #1f2937 !important;
}

/* -------------------------------------------------------------------------- */
/* MODO COMPACTO DO CALENDÁRIO                                                */
/* -------------------------------------------------------------------------- */

body {
    font-size: 12px;
}

/*
 * Cabeçalho principal mais baixo.
 */
.calendar-page-header {
    padding: 10px 16px;
}

.calendar-page-header h1 {
    margin-bottom: 2px;
    font-size: 16px;
}

.calendar-page-header .small {
    font-size: 10px;
}

/*
 * Painel principal com margens menores.
 */
.calendar-panel {
    margin: 8px;
    padding: 10px;
    border-radius: 9px;
}

/*
 * Área dos filtros mais compacta.
 */
.calendar-filters {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 8px;
}

.calendar-filters .row {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.35rem;
}

/*
 * Labels menores.
 */
.calendar-filters .form-label {
    margin-bottom: 2px;
    color: #667085;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

/*
 * Inputs e selects compactos.
 */
.calendar-filters .form-control,
.calendar-filters .form-select {
    min-height: 29px;
    height: 29px;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.2;
}

/*
 * Botões mais baixos.
 */
.calendar-filters .btn {
    min-height: 29px;
    padding: 4px 9px;
    font-size: 10px;
}

/*
 * Reduz o espaço da linha de botões inferiores.
 */
.calendar-filters .col-12 {
    margin-top: 4px !important;
}

/*
 * Toolbar do FullCalendar mais compacta.
 */
.fc .fc-toolbar {
    margin-bottom: 8px;
}

.fc .fc-toolbar-title {
    font-size: 15px !important;
}

.fc .fc-button {
    padding: 4px 8px !important;
    font-size: 10px !important;
}

/*
 * Cabeçalho dos dias da semana.
 */
.fc .fc-col-header-cell-cushion {
    padding: 5px 3px !important;
    font-size: 10px !important;
}

/*
 * Número do dia.
 */
.fc .fc-daygrid-day-number {
    padding: 3px 5px !important;
    font-size: 10px !important;
}

/*
 * Reduz a altura de cada célula do mês.
 */
.fc .fc-daygrid-day-frame {
    min-height: 72px !important;
}

/*
 * Eventos menores.
 */
.fc .fc-daygrid-event {
    margin: 1px 2px !important;
    padding: 1px 3px !important;
    border-radius: 4px;
}

.fc .fc-daygrid-event .fc-event-time {
    font-size: 9px !important;
}

.fc .fc-daygrid-event .fc-event-title {
    font-size: 9px !important;
    line-height: 1.15;
}

/*
 * Horários das visualizações Dia e Semana.
 */
.fc .fc-timegrid-slot {
    height: 28px;
}

.fc .fc-timegrid-slot-label,
.fc .fc-timegrid-axis-cushion {
    font-size: 9px !important;
}

/*
 * Lista compacta.
 */
.fc .fc-list-day-cushion {
    padding: 5px 8px !important;
}

.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
    font-size: 10px !important;
}

.fc .fc-list-event td {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.fc .fc-list-event-time {
    width: 82px;
    font-size: 10px !important;
}

.fc .fc-list-event-title,
.fc .fc-list-event-title a {
    font-size: 10px !important;
}

/*
 * Legenda menor.
 */
.calendar-legend {
    gap: 8px;
    margin-top: 7px;
    font-size: 10px;
}

.calendar-legend-dot {
    width: 8px;
    height: 8px;
}

/*
 * Modal compacto.
 */
#modalEvento .modal-header,
#modalEvento .modal-footer {
    padding: 8px 12px;
}

#modalEvento .modal-body {
    padding: 10px 12px;
    font-size: 11px;
}

#modalEvento .modal-title {
    font-size: 14px;
}

#modalEvento dt,
#modalEvento dd {
    margin-bottom: 4px;
}

#modalEvento .btn {
    padding: 4px 9px;
    font-size: 10px;
}
/* -------------------------------------------------------------------------- */
/* RESPONSIVIDADE                                                             */
/* -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .cec-calendar-wrapper {
        padding: 10px;
        border-radius: 10px;
    }

    .cec-calendar {
        min-height: 520px;
    }

    .fc .fc-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    .fc .fc-toolbar-title {
        margin: 4px 0;
        font-size: 1.05rem;
        text-align: center;
    }

    .fc .fc-button {
        padding: 0.35rem 0.55rem;
        font-size: 0.78rem;
    }
}
