/* css/calendario.css */

/* --- VARIÁVEIS GLOBAIS --- */
:root {
    /* Cores Específicas do Calendário */
    --weekend-bg: #f0f0f0;
    --weekend-text: #606060;
    --holiday-bg: #fce8e6;
    --holiday-text: #d93025;
    
    /* Cores do Modal */
    --modal-week-bg: #e8e8e8;
    --modal-week-text: #555;
    --modal-week-border: #ccc; 
    --modal-weekend-bg: #e4e4e4; 
    --modal-holiday-bg: #fff0f0;
    --widget-border-color: #d0d0d0; 
}

/* --- HEADER ESTILO APPLE --- */
.calendar-page-header {
    text-align: center;
    padding: 45px 20px 35px;
    background-color: var(--light-bg);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 24px;          
    margin-bottom: 40px;          
    max-width: 100%;              
    box-sizing: border-box;
}

.calendar-page-header h1 {
    margin: 0 auto;
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    max-width: 900px;
    width: 100%;
}

/* --- ESTILOS DO HUB (Página Principal do Calendário) --- */
.hub-cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-color);
    min-width: 160px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.hub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.hub-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.hub-year {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
}

/* Destaque para o Ano Atual no Hub */
.hub-card.current-year {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.15);
    padding: 30px;
}

.hub-card.current-year:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 40px rgba(0, 113, 227, 0.25);
}

.hub-card.current-year .hub-year {
    color: var(--primary-color);
}

.hub-cta {
    margin-top: 15px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Grid de Recursos do Hub */
.feature-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.feature-item .f-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* --- CONTROLES DE NAVEGAÇÃO (Página de Ano) --- */
.nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px; 
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .nav-controls {
        flex-wrap: wrap; /* Permite quebra de linha para não estourar */
        gap: 10px;
        padding: 0 5px;
    }

    .nav-year-btn {
        min-width: auto;
        padding: 0 12px;
        font-size: 1.1rem;
        flex: 1; /* Distribui espaço */
    }

    .nav-year-btn span {
        display: inline-block; /* Mantém o texto se couber, ou ajusta */
    }

    .year-selector-container {
        flex-grow: 1;
        min-width: 100px;
        padding: 0 10px;
        order: 2; /* Mantém no meio ou ajusta se necessário */
    }
    
    .current-year-display {
        font-size: 1rem;
    }
}

.nav-year-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 80px; 
    height: 44px;
    padding: 0 16px;
    background-color: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-year-btn:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.nav-year-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    background-color: rgba(0,0,0,0.05);
    color: #999;
}

/* Seletor Central do Ano */
.year-selector-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    height: 44px;
    padding: 0 20px;
    min-width: 120px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.year-selector-container:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.current-year-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none; 
}

.dropdown-icon { font-size: 0.9rem; color: var(--secondary-color); }

.year-selector-container select {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
    font-size: 16px; appearance: none; -webkit-appearance: none;
}

/* --- BOTÕES DE AÇÃO --- */
.seo-actions-wrapper {
    text-align: center;
    width: 100%;
    clear: both;
    margin-top: 45px; 
    margin-bottom: 0; 
}

.calendar-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Ajuste Mobile para Botões de Ação */
@media (max-width: 600px) {
    .calendar-actions {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 10px;
    }

    .btn-action {
        /* Imprimir e PDF na mesma linha (50% aprox menos gap) */
        flex: 1 1 45%; 
    }

    .btn-share {
        /* Partilhar na linha de baixo (100%) */
        flex: 1 1 100%;
        margin-top: 5px;
    }
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px; 
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
    text-decoration: none;
    background-color: var(--primary-color);
    color: #fff !important; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.06); 
}

.btn-action:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.btn-action .icon { font-size: 1.2em; }
.btn-print { background-color: #333; }
.btn-print:hover { background-color: #000; }
.btn-share { background-color: #28a745; }
.btn-share:hover { background-color: #218838; }
.btn-custom-pdf { background-color: #dc3545; }
.btn-custom-pdf:hover { background-color: #c82333; }

/* --- GRID ANUAL DO CALENDÁRIO --- */
#annual-calendar-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 1024px) {
    #annual-calendar-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.month-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    background-color: var(--content-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer; 
    position: relative;
    outline: none;
}

.month-container:hover,
.month-container:focus {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: var(--primary-color);
}

.month-container:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.4);
    outline-offset: 2px;
}

.month-container:hover::after {
    content: "Ver detalhes 🔍";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    pointer-events: none;
}

@keyframes fadeIn { to { opacity: 1; } }

.month-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    color: var(--primary-color);
    font-size: 1em;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.9em;
    gap: 3px;
    margin-bottom: 10px;
}

.calendar-header-day {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.75em;
    text-transform: uppercase;
    padding-bottom: 6px;
}

.calendar-day {
    padding: 5px 0;
    border-radius: 6px;
    font-size: 0.95em;
}

.calendar-day.weekend {
    background-color: var(--weekend-bg);
    color: var(--weekend-text);
}

.calendar-day.holiday {
    color: var(--holiday-text);
    font-weight: 700;
    background-color: var(--holiday-bg);
    cursor: help;
}

.calendar-day.weekend.holiday {
    background-color: var(--holiday-bg);
    color: var(--holiday-text);
}

/* Estilo padrão da lista de feriados dentro do card do mês */
.month-holiday-list-screen {
    list-style: none;
    padding: 0;
    margin: auto 0 0 0;
    font-size: 0.8em;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    color: var(--secondary-color);
}

.month-holiday-list-screen li {
    margin-bottom: 4px;
    line-height: 1.3;
}

.month-holiday-list-screen strong {
    color: var(--primary-color);
}

/* LISTA DE FERIADOS GLOBAIS (Abaixo do Calendário) - COLUNAS */
.holiday-list-ul {
    list-style: none;
    padding: 10px 0 0 0;
    margin: 0;
    /* Divide em colunas (leitura vertical) */
    column-count: 2; 
    column-gap: 40px;
}

@media (min-width: 1024px) {
    .holiday-list-ul {
        column-count: 3; /* 3 Colunas em telas largas */
    }
}

@media (max-width: 600px) {
    .holiday-list-ul {
        column-count: 1; /* 1 Coluna em mobile */
    }
}

.holiday-list-ul li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.85em; 
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    line-height: 1.3;
    /* Evita quebra de item entre colunas */
    break-inside: avoid;
    page-break-inside: avoid;
}

.holiday-list-ul li:last-child {
    border-bottom: none;
}

.holiday-date {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 60px;
    margin-right: 8px;
}

/* --- CONTEÚDO DINÂMICO E CARDS --- */
.dynamic-facts-box {
    background-color: var(--light-bg);
    border-left: 4px solid var(--primary-color);
    padding: 20px 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.dynamic-facts-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2em;
}

/* --- CARDS LUNARES --- */
.lunar-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.lunar-month-card {
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.lunar-month-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.lunar-month-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 8px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.lunar-phase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.lunar-phase-row:last-child { border-bottom: none; }
.lunar-icon { font-size: 1.2rem; margin-right: 8px; width: 25px; text-align: center; }
.lunar-info { display: flex; flex-direction: column; line-height: 1.2; }
.lunar-name { font-weight: 600; color: #444; }
.lunar-date { font-size: 0.8em; color: #888; }
.lunar-phase-row.is-full-moon .lunar-name { color: var(--holiday-text); }

/* --- NAVEGAÇÃO ENTRE ANOS (Rodapé) --- */
.years-navigation-section {
    margin-top: 40px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
}

.years-navigation-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.years-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.year-grid-item {
    display: inline-block;
    padding: 10px 20px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 60px;
}

.year-grid-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    color: var(--primary-color);
}

.year-grid-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.year-grid-item.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    pointer-events: none;
}

/* --- GRID DE "OUTRAS FERRAMENTAS" --- */
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.tool-card {
    background-color: var(--card-bg, #fff);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    height: 100%;
    box-sizing: border-box;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

.tool-icon {
    font-size: 1.8em;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
    margin-right: 0;
}

.tool-title {
    font-weight: 600;
    font-size: 1.1em;
    display: block;
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 0.9em;
    color: var(--secondary-color);
    line-height: 1.3;
}

/* --- MODAL DE DETALHES DO MÊS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: 2147483647;
    display: flex; align-items: center; justify-content: center;
    padding: 10px; box-sizing: border-box;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}

/* Modal com Rodapé Fixo (Scroll Interno) */
.modal-container {
    position: relative; background: #fff; width: 100%; 
    max-width: 900px; 
    border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 2;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    max-height: 95vh; 
    height: 95vh; 
}

.modal-overlay.open .modal-container { transform: scale(1); }

/* Corpo do Modal com Scroll */
.modal-body-grid {
    overflow-y: auto;
    flex-grow: 1; 
    -webkit-overflow-scrolling: touch; 
    height: auto;
    display: block; 
}

/* Header Modal */
.modal-header-content {
    padding: 20px 30px; 
    border-bottom: 1px solid #eee; 
    background: #f9f9f9; 
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 20px; 
    position: relative; 
}

.modal-month-title {
    font-size: 1.8rem; color: var(--primary-color); margin: 0; text-transform: uppercase; font-weight: 700;
    text-align: center;
    flex-grow: 0;
    line-height: 1;
    min-width: 220px;
}

.modal-nav-btn {
    background: none; border: none; color: var(--primary-color); font-size: 2.5rem;
    cursor: pointer; padding: 0 10px; transition: transform 0.2s, color 0.2s; user-select: none;
    height: 40px; 
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    border-radius: 4px;
}
.modal-nav-btn:hover { color: var(--primary-hover); transform: scale(1.2); }

.modal-close-btn {
    position: absolute; 
    top: 50%; transform: translateY(-50%); right: 20px; 
    background: none; border: none;
    font-size: 2.5rem; line-height: 1; color: #666; cursor: pointer; z-index: 20;
    transition: color 0.2s;
    padding: 0; height: auto;
}
.modal-close-btn:hover { color: #000; }

/* Rodapé Fixo do Modal */
.modal-footer-bar {
    flex-shrink: 0; 
    position: relative;
    z-index: 10;
    width: 100%;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: center;
}

.btn-close-modal-action {
    display: inline-block;
    width: 100%;
    max-width: 300px;
    background: transparent; 
    border: 2px solid #666; 
    color: #444;
    padding: 10px 30px; 
    border-radius: 30px; 
    font-weight: 700; 
    cursor: pointer;
    transition: all 0.2s; 
    font-size: 0.95em;
}

.btn-close-modal-action:hover {
    background: #333; color: #fff; border-color: #333;
}

/* Conteúdo do Modal (Calendário) */
.modal-calendar-section {
    padding: 25px; 
    margin: 20px auto 0; 
    max-width: 580px; 
    width: 95%; 
    border: 1px solid var(--widget-border-color); 
    border-radius: 12px; 
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    box-sizing: border-box;
}

.modal-cal-grid {
    display: grid;
    grid-template-columns: 70px 15px repeat(7, 1fr);
    gap: 5px 0; text-align: center; align-items: stretch;
}

.modal-cal-header {
    font-weight: bold; color: #666; padding-bottom: 8px;
    text-transform: uppercase; font-size: 0.8rem;
    display: flex; align-items: flex-end; justify-content: center;
}

.modal-week-num {
    background-color: var(--modal-week-bg); color: var(--modal-week-text);
    font-size: 0.75rem; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 4px; height: 100%; text-align: center; line-height: 1.2;
    border: 1px solid rgba(0,0,0,0.05);
    border-right: 2px solid var(--modal-week-border);
}

.modal-day {
    min-height: 50px; 
    border: 1px solid #eee; border-radius: 6px;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 4px 6px; font-size: 1rem; position: relative;
    background: #fff; margin: 0 3px;
    transition: transform 0.1s;
}

.modal-day:hover { transform: scale(1.05); z-index: 2; border-color: var(--primary-color); }
.modal-day.weekend { background-color: var(--modal-weekend-bg); color: var(--weekend-text); border-color: #dcdcdc; }
.modal-day.holiday { background-color: var(--modal-holiday-bg); color: var(--holiday-text); font-weight: bold; border-color: #ffcccc; }
.modal-day.today { border: 2px solid var(--primary-color); }

/* Widgets */
.modal-widgets-section {
    padding: 25px 30px; background-color: #fafafa;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.modal-widget {
    background: #fff; border-radius: 12px; padding: 15px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid var(--widget-border-color); 
}

.widget-summary { border-left: 4px solid var(--primary-color); }
.widget-moons { border-left: 4px solid #6f42c1; }
.widget-holidays { border-left: 4px solid #d93025; }

.widget-title {
    font-size: 0.95rem; font-weight: 700; color: var(--secondary-color);
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
    border-bottom: 2px solid #f0f0f0; padding-bottom: 6px;
}

.widget-fact-row {
    display: flex; justify-content: space-between; padding: 6px 0;
    border-bottom: 1px dashed #eee; font-size: 0.9rem;
}
.widget-fact-row:last-child { border: none; }
.wf-label { color: #555; }
.wf-value { font-weight: bold; color: var(--primary-color); }

.widget-moon-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px dashed #eee; font-size: 0.85rem;
}
.widget-moon-item:last-child { border: none; }
.w-moon-icon { font-size: 1rem; margin-right: 8px; }

.widget-holiday-item { padding: 6px 0; font-size: 0.85rem; color: #444; border-bottom: 1px solid #eee; }
.w-holiday-date { color: var(--holiday-text); font-weight: bold; margin-right: 5px; }

/* --- RESPONSIVIDADE DO MODAL (MOBILE) --- */
@media (max-width: 768px) {
    .modal-container {
        height: 90vh;
        width: 100%; max-width: 100%;
        border-radius: 16px 16px 0 0;
        position: absolute; bottom: 0;
    }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-footer-bar { padding-bottom: max(15px, env(safe-area-inset-bottom)); }

    .modal-header-content { padding: 15px 10px; gap: 10px; }
    .modal-month-title { font-size: 1.3rem; min-width: auto; }
    .modal-nav-btn { font-size: 2rem; padding: 0 5px; }
    .modal-close-btn { font-size: 2rem; right: 10px; }

    .modal-calendar-section { padding: 10px; margin: 10px auto 0; max-width: 90%; }
    
    .modal-cal-grid {
        grid-template-columns: repeat(7, 1fr) !important; 
        gap: 2px;
    }

    /* Esconde coluna de semana no mobile */
    .modal-week-num, .modal-week-label { display: none !important; }
    .modal-cal-grid > .modal-cal-header:first-child { display: none !important; }
    
    /* CORREÇÃO DO BUG DO TABULEIRO DE XADREZ NO MOBILE */
    .modal-grid-spacer { display: none !important; }

    .modal-day { min-height: 45px; font-size: 0.85rem; padding: 2px 0; }
    .day-moon-icon { font-size: 0.7rem; }
    
    .modal-widgets-section { padding: 15px; }
}

/* --- FAQ INTERATIVO --- */
.faq-interactive-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.faq-container-interactive {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item-interactive {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--card-bg); /* Garante compatibilidade */
    transition: all 0.2s ease;
}

.faq-item-interactive.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.faq-question-btn {
    width: 100%;
    text-align: left;
    padding: 18px 20px;
    background: none;
    border: none;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.faq-question-btn:hover {
    background-color: var(--light-bg);
}

.faq-question-btn::after {
    content: '+';
    font-size: 1.5em;
    font-weight: 400;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.faq-item-interactive.active .faq-question-btn::after {
    transform: rotate(45deg);
}

.faq-answer-interactive {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--content-bg);
}

.faq-item-interactive.active .faq-answer-interactive {
    max-height: 500px;
    border-top: 1px solid var(--border-color);
}

.faq-answer-interactive-content {
    padding: 20px;
    font-size: 0.95em;
    color: var(--secondary-color);
    line-height: 1.6;
}

/* --- DARK MODE --- */
body.dark-mode .calendar-page-header { background-color: #1c1c1e; border-color: #333; }
body.dark-mode .nav-year-btn, body.dark-mode .year-selector-container { background-color: #2c2c2e; border-color: #444; color: #fff; }
body.dark-mode .nav-year-btn:hover, body.dark-mode .year-selector-container:hover { border-color: var(--primary-color); }
body.dark-mode .current-year-display { color: #fff; }
body.dark-mode .year-selector-container select option { background-color: #2c2c2e; color: #fff; }
body.dark-mode .calendar-day.weekend { background-color: #2c2c2e; color: #aaa; }
body.dark-mode .calendar-day.holiday { color: #ff6b6b; background-color: #3e1f1f; }
body.dark-mode .calendar-day.weekend.holiday { background-color: #3e1f1f; color: #ff6b6b; }
body.dark-mode .dynamic-facts-box { background-color: #2c2c2e; border-left-color: #0a84ff; }
body.dark-mode .tool-card { background: #2c2c2e; border-color: #444; }
body.dark-mode .tool-card:hover { border-color: #7abaff; }
body.dark-mode .tool-card.featured-card { background: linear-gradient(to right, #2c2c2e, #3a3a3c); border-color: #0a84ff; }

/* Dark Mode - Modal */
body.dark-mode .lunar-month-card { background-color: #2c2c2e; border-color: #444; }
body.dark-mode .lunar-name { color: #ddd; }
body.dark-mode .lunar-phase-row { border-bottom-color: #444; }
body.dark-mode .lunar-month-title { border-bottom-color: #444; color: #fff; }
body.dark-mode .modal-container { background: #1c1c1e; }
body.dark-mode .modal-header-content { background: #2c2c2e; border-color: #333; }
body.dark-mode .modal-calendar-section { border-color: #333; background-color: #2c2c2e; }
body.dark-mode .modal-widgets-section { background: #242426; border-top-color: #333; }
body.dark-mode .modal-widget { background: #2c2c2e; border-color: #333; }
body.dark-mode .modal-day { background: #2c2c2e; border-color: #333; color: #fff; }
body.dark-mode .modal-day.weekend { background: #3a3a3c; color: #aaa; border-color: #444; }
body.dark-mode .modal-day.holiday { background: #3e1f1f; color: #ff6b6b; border-color: #662222; }
body.dark-mode .modal-week-num { background: #333; color: #777; border-color: #444; }
body.dark-mode .widget-title { color: #bbb; border-color: #333; }
body.dark-mode .widget-moon-item { color: #ddd; border-color: #333; }
body.dark-mode .widget-fact-row { border-color: #333; }
body.dark-mode .wf-label { color: #aaa; }
body.dark-mode .modal-close-btn { color: #fff !important; }
body.dark-mode .modal-nav-btn { color: #fff; }
body.dark-mode .modal-footer-bar { background: #252525; border-top-color: #333; box-shadow: 0 -4px 15px rgba(0,0,0,0.3); }
body.dark-mode .btn-close-modal-action { color: #ccc; border-color: #666; }
body.dark-mode .btn-close-modal-action:hover { background: #eee; color: #000; }

/* Dark Mode - Navegação de Anos e Hub */
body.dark-mode .years-navigation-section { background-color: #2c2c2e; border-color: #444; }
body.dark-mode .year-grid-item { background-color: #1c1c1e; border-color: #444; color: #ddd; }
body.dark-mode .year-grid-item:hover { border-color: var(--primary-color); color: #fff; }
body.dark-mode .year-grid-item.active { background-color: var(--primary-color); color: #fff; }
body.dark-mode .hub-card { background-color: #2c2c2e; border-color: #444; color: #ddd; }
body.dark-mode .hub-card:hover { border-color: var(--primary-color); color: #fff; }
body.dark-mode .hub-year { color: #fff; }
body.dark-mode .hub-label { color: #aaa; }
body.dark-mode .hub-card.current-year { border-color: var(--primary-color); background-color: #333; }
body.dark-mode .feature-item { background-color: #2c2c2e; border-color: #444; color: #ccc; }

/* Impressão */
@media print {
    .calendar-page-header { border: none; padding-bottom: 0; }
    .hub-cards-container, .feature-list-grid, .nav-controls, .seo-actions-wrapper, .dynamic-facts-box, .lunar-year-grid, .modal-overlay, .years-navigation-section, .related-tools-section { display: none !important; }
    .month-container { break-inside: avoid; border: 1px solid #ccc !important; box-shadow: none !important; }
    .calendar-day.weekend { background-color: #e0e0e0 !important; color: #000 !important; }
    .calendar-day.holiday { color: #d93025 !important; font-weight: bold !important; }

    /* FORÇAR EXIBIÇÃO DA LISTA DE FERIADOS NA IMPRESSÃO */
    .holiday-list-container.dynamic-facts-box {
        display: block !important;
        border: none;
        background: none;
        margin: 20px 0;
        padding: 0;
    }
    
    .holiday-list-container h2 {
        font-size: 1.2rem;
        border-bottom: 2px solid #333;
        margin-bottom: 10px;
        color: #000 !important;
    }

    /* FORMATAR EM COLUNAS NA IMPRESSÃO */
    .holiday-list-ul {
        display: block !important; /* Sobrescreve grid */
        column-count: 2; /* Divide em 2 colunas */
        column-gap: 40px;
    }
    
    .holiday-list-ul li {
        break-inside: avoid;
        page-break-inside: avoid;
        border-bottom: 1px solid #ddd;
        display: block;
        width: 100%;
        color: #000 !important;
        padding: 2px 0; 
        font-size: 0.8rem;
    }
    
    .holiday-date {
        font-weight: bold;
        color: #000 !important;
        margin-right: 10px;
    }
}