﻿/* ========================================
   FIX CORES CABEÇALHO - FULLCALENDAR
   Funciona em Dark e Light Mode
   ======================================== */

/* ----------------------------------------
   TOKENS (cores escolhidas)
   ---------------------------------------- */
/* Light: indigo claro (texto preto não ofusca) */
:root {
    --fc-header-bg: #1E3A8A; /* indigo claro */
    --fc-header-border: #1E40AF; /* indigo borda */
    --fc-today-bg: rgba(79, 70, 229, 0.08); /* indigo suave */
}

/* ========================================
   CABEÇALHO PRINCIPAL (Toolbar)
   ======================================== */

.fc .fc-toolbar {
    background-color: transparent !important;
    margin-bottom: 1rem !important;
}

.fc .fc-toolbar-title {
    color: var(--mud-palette-text-primary) !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Botões do toolbar (mantive, mas podes ligar ao Primary se quiseres) */
.fc .fc-button {
    background-color: var(--mud-palette-primary) !important;
    border-color: var(--mud-palette-primary) !important;
    color: #FFFFFF !important;
    font-weight: 500 !important;
}

    .fc .fc-button:hover {
        filter: brightness(0.92) !important;
    }

    .fc .fc-button:disabled {
        opacity: 0.5 !important;
    }

.fc .fc-button-active {
    filter: brightness(0.88) !important;
}

/* ========================================
   CABEÇALHO DOS DIAS DA SEMANA
   ======================================== */

/* VISTA DE SEMANA/DIA - Cabeçalho dos dias */
.fc .fc-col-header-cell {
    background-color: var(--fc-header-bg) !important;
    border-color: var(--fc-header-border) !important;
    padding: 10px 5px !important;
}

/* VISTA DE MÊS - Cabeçalho dos dias (reforço) */
.fc .fc-scrollgrid-section-header .fc-col-header-cell {
    background-color: var(--fc-header-bg) !important;
    border-color: var(--fc-header-border) !important;
}

/* Texto dos dias da semana (tu disseste que já está correto) */
.fc .fc-col-header-cell-cushion {
    color: #FFFFFF !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-transform: capitalize !important;
    padding: 8px !important;
    display: block !important;
}

    /* Hover do link do dia */
    .fc .fc-col-header-cell-cushion:hover {
        color: rgba(255, 255, 255, 0.9) !important;
        text-decoration: none !important;
    }

/* ========================================
   NÚMEROS DOS DIAS (Vista Mês)
   ======================================== */

.fc .fc-daygrid-day-number {
    color: var(--mud-palette-text-primary) !important;
    font-weight: 500 !important;
    padding: 4px 8px !important;
    font-size: 0.95rem !important;
}

/* Dia atual (número do dia) */
.fc .fc-day-today .fc-daygrid-day-number {
    background-color: var(--mud-palette-primary) !important;
    color: #FFFFFF !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
}

/* ========================================
   GRID DO CALENDÁRIO
   ======================================== */

/* Bordas das células */
.fc .fc-scrollgrid {
    border-color: var(--mud-palette-divider) !important;
}

.fc .fc-daygrid-day {
    background-color: var(--mud-palette-background-default) !important;
}

.fc .fc-timegrid-slot {
    border-color: var(--mud-palette-divider) !important;
}

/* Dia atual - fundo suave (indigo) */
.fc .fc-day-today {
    background-color: var(--fc-today-bg) !important;
}

/* ========================================
   LABELS DE HORA (Vista Semana/Dia)
   ======================================== */

.fc .fc-timegrid-axis-cushion {
    color: var(--mud-palette-text-secondary) !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
}

.fc .fc-timegrid-slot-label-cushion {
    color: var(--mud-palette-text-secondary) !important;
}

/* ========================================
   LINHA "AGORA" (Now Indicator)
   ======================================== */

.fc .fc-timegrid-now-indicator-line {
    border-color: var(--mud-palette-primary) !important;
    border-width: 2px !important;
}

.fc .fc-timegrid-now-indicator-arrow {
    border-color: var(--mud-palette-primary) !important;
    border-width: 8px !important;
}

/* ========================================
   POPOVER "+X MAIS" (Vista Mês)
   ======================================== */

.fc .fc-popover {
    background-color: var(--mud-palette-surface) !important;
    border: 1px solid var(--mud-palette-divider) !important;
    box-shadow: var(--mud-elevation-8) !important;
}

.fc .fc-popover-header {
    background-color: var(--mud-palette-primary) !important;
    color: #FFFFFF !important;
    padding: 10px 12px !important;
    font-weight: 600 !important;
}

.fc .fc-popover-body {
    background-color: var(--mud-palette-surface) !important;
    padding: 8px !important;
}

.fc .fc-popover-close {
    color: #FFFFFF !important;
    opacity: 0.9 !important;
}

    .fc .fc-popover-close:hover {
        opacity: 1 !important;
    }

/* ========================================
   COMPATIBILIDADE TEMA DARK
   ======================================== */

/* Quando MudThemeProvider está em dark mode */
.mud-theme-dark .fc .fc-scrollgrid,
.mud-theme-dark .fc .fc-daygrid-day,
.mud-theme-dark .fc .fc-timegrid-slot {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.mud-theme-dark .fc .fc-daygrid-day {
    background-color: var(--mud-palette-background-default) !important;
}

/* ========================================
   FIX ESPECÍFICO MUDBLAZOR
   ======================================== */

/* Garantir que o container MudPaper não interfira */
.fc-container {
    background-color: transparent !important;
}

/* Scrollbars personalizados (opcional) */
.fc-scroller::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fc-scroller::-webkit-scrollbar-track {
    background: var(--mud-palette-background-grey);
    border-radius: 4px;
}

.fc-scroller::-webkit-scrollbar-thumb {
    background: var(--mud-palette-action-disabled);
    border-radius: 4px;
}

    .fc-scroller::-webkit-scrollbar-thumb:hover {
        background: var(--mud-palette-text-secondary);
    }

/* ========================================
   AJUSTES FINAIS
   ======================================== */

.fc * {
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Não herdar cor no texto do cabeçalho (evita cinza no dark) */
.fc .fc-col-header-cell,
.fc .fc-daygrid-day-top {
    color: inherit !important;
}

/* Contraste no texto do cabeçalho */
.fc .fc-col-header-cell-cushion {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.mud-theme-dark .fc .fc-col-header-cell-cushion {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}


/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    .fc .fc-toolbar-title {
        font-size: 1.2rem !important;
    }

    .fc .fc-col-header-cell-cushion {
        font-size: 0.75rem !important;
        padding: 6px 2px !important;
    }

    .fc .fc-button {
        font-size: 0.85rem !important;
        padding: 4px 8px !important;
    }
}
