/* Estilos do calendário do FAB Registro de Voos - visual moderno e responsivo */

.rv-calendario-wrapper,
.rv-calendario-wrapper *,
.rv-calendario-wrapper *::before,
.rv-calendario-wrapper *::after {
    box-sizing: border-box;
}

/* Wrapper geral */
.rv-calendario-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    background: linear-gradient(135deg, #f7fbff 0%, #ffffff 65%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Cabeçalho */
.rv-calendario-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding-bottom: 12px;
}

/* Filtro de ano */
.rv-year-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.rv-year-filter label {
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
}

.rv-year-filter select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 999px;
    padding: 8px 34px 8px 16px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    font-size: 0.9rem;
    min-height: 40px;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.rv-year-filter select:hover {
    border-color: #94a3b8;
}

.rv-year-filter select:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* Legenda */
.rv-calendario-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    color: #475569;
}

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

.rv-legend-box {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    flex-shrink: 0;
}

.rv-legend-has-registro {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    border-color: #1d4ed8;
}

.rv-legend-empty {
    background: #e5e7eb;
}

/* Grid de meses (4 colunas telas grandes, 3 desktop, 2 tablet, 1 mobile) */
.rv-year-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media (min-width: 1280px) {
    .rv-year-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .rv-year-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .rv-year-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 12px;
    }
}

/* Cartão de mês */
.rv-month-card {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 10px 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.rv-month-card:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.rv-month-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}

.rv-month-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Tabela de calendário */
.rv-calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.78rem;
}

.rv-calendar-table thead th {
    text-align: center;
    padding: 4px 2px 8px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.rv-calendar-table tbody td {
    text-align: center;
    padding: 3px 0;
    border-bottom: 1px solid #f1f5f9;
}

.rv-calendar-table tbody tr:last-child td {
    border-bottom: none;
}

/* Dias */
.rv-day-cell {
    position: relative;
    height: 30px;
    vertical-align: middle;
}

.rv-day-cell a {
    display: inline-flex;
}

.rv-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    font-weight: 500;
    color: #0f172a;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.rv-day-cell.rv-has-registro .rv-day-number {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    color: #f9fafb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3), 0 6px 15px rgba(37, 99, 235, 0.35);
}

.rv-day-cell.rv-has-registro a {
    text-decoration: none;
}

.rv-day-cell.rv-has-registro a:hover .rv-day-number,
.rv-day-cell.rv-has-registro a:focus-visible .rv-day-number {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4), 0 10px 20px rgba(37, 99, 235, 0.45);
}

.rv-day-cell.rv-has-registro a:focus-visible .rv-day-number {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

/* Células vazias */
.rv-empty {
    background-color: transparent;
}

/* Tablet: cabeçalho e filtro ocupam a largura toda */
@media (max-width: 640px) {
    .rv-calendario-wrapper {
        padding: 18px 12px;
        border-radius: 12px;
    }

    .rv-calendario-header {
        justify-content: center;
    }

    .rv-year-filter {
        width: 100%;
        justify-content: center;
    }

    .rv-year-filter select {
        flex: 1;
        max-width: 220px;
    }

    .rv-calendario-legend {
        justify-content: center;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .rv-calendar-table thead th {
        font-size: 0.68rem;
        padding: 4px 1px 6px;
    }

    .rv-day-cell {
        height: 28px;
    }

    .rv-day-number {
        width: 24px;
        height: 24px;
        font-size: 0.72rem;
    }

    .rv-month-header h3 {
        font-size: 0.85rem;
    }
}

/* Telas muito pequenas */
@media (max-width: 360px) {
    .rv-day-number {
        width: 22px;
        height: 22px;
        font-size: 0.68rem;
    }

    .rv-month-card {
        padding: 10px 6px 12px;
    }
}
