/* css/contador-dias.css */

/* --- VARIÁVEIS GLOBAIS DESTE ARQUIVO --- */
:root {
    --primary-hover: #005bb5;
    --input-height: 52px;
}

/* --- AJUSTE DE LARGURA DO CONTAINER PRINCIPAL (Estilo Legado) --- */
.container.my-5 {
    max-width: 1100px; 
}

/* --- ESTILOS GERAIS DA PÁGINA --- */
.section-title-modern {
    grid-column: 1 / -1;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.4em;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.section-separator {
    grid-column: 1 / -1;
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 35px 0;
}

/* --- GRIDS E FORMULÁRIOS --- */
.form-grid-two-col,
.form-grid-three-col {
    grid-column: 1 / -1;
    display: grid;
    gap: 15px 20px;
    align-items: flex-end;
}

.form-grid-two-col {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.form-grid-three-col {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.input-with-button .input-icon-wrapper {
    flex-grow: 1;
    position: relative;
    width: 100%;
}

/* Botão "Hoje" */
.btn-today {
    padding: 12px 15px;
    font-size: 0.9em;
    width: auto;
    flex-shrink: 0;
    background-color: var(--btn-light-bg);
    color: var(--btn-light-text);
    border: 1px solid var(--btn-light-border);
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 8px;
    height: 48px; 
    display: flex;
    align-items: center;
}

.btn-today:hover {
     background-color: var(--btn-light-hover-bg);
}

body.dark-mode .btn-today {
    background-color: #2c2c2e;
    border-color: #3a3a3c;
    color: #e0e0e0;
}
body.dark-mode .btn-today:hover {
    background-color: #3a3a3c;
}

/* Container de opções de intervalo (Checkboxes) */
.interval-options-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 5px;
    margin-bottom: 10px;
}

.form-group.checkbox-simple {
    margin: 0;
}

.form-group.checkbox-group-horizontal {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* Separador Mobile (Invisível no Desktop) */
.mobile-separator {
    display: none;
}

/* --- NOVO ESTILO: SELETOR TIPO DE DIAS --- */
.toggle-container {
    display: flex;
    background-color: #f2f2f7; 
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    margin-top: 5px;
}

.toggle-option {
    flex: 1;
    position: relative;
}

.toggle-option input[type="radio"] {
    display: none; 
}

.toggle-option label {
    display: block;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0;
    user-select: none;
    border: 1px solid transparent; 
}

.toggle-option label:hover {
    background-color: rgba(0,0,0,0.03);
}

/* Estado Ativo (Selecionado) */
.toggle-option input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Dark Mode para Toggle */
body.dark-mode .toggle-container {
    background-color: #2c2c2e;
    border-color: #3a3a3c;
}

body.dark-mode .toggle-option label:hover {
    background-color: rgba(255,255,255,0.05);
}

body.dark-mode .toggle-option input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: #fff;
}

/* --- BOTÕES DE ATALHO (+5, +10...) --- */
.shortcut-buttons {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.shortcut-buttons span {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-right: 8px;
}

.shortcut-buttons button {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.shortcut-buttons button:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

/* --- GRUPO DE BOTÕES DE AÇÃO --- */
.button-group {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
    margin-top: 20px;
}

.button-group .btn {
    flex-grow: 1;
    width: 100%; /* Inteiriço */
}

.button-group .btn-light {
    flex-grow: 0;
    width: auto;
    /* Ajustes específicos para botões light (Imprimir/Limpar) */
    background-color: #f0f0f5; 
    color: #333;
    border: 1px solid #d1d1d6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-group .btn-light:hover {
    background-color: #e5e5ea;
}

/* Dark Mode para botões light */
body.dark-mode .button-group .btn-light {
    background-color: #2c2c2e;
    color: #fff;
    border-color: #3a3a3c;
}
body.dark-mode .button-group .btn-light:hover {
    background-color: #3a3a3c;
}

@media (max-width: 500px) {
    .button-group {
        flex-direction: column-reverse;
    }
    .button-group .btn-light {
        width: 100%;
    }
}

/* --- LAYOUT DO CALENDÁRIO INTERATIVO (USADO NO INDEX) --- */
.interval-grid-container {
    grid-column: 1 / -1;
    display: grid;
    /* Responsivo: empilha se menor que 280px */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    align-items: start;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .interval-grid-container {
        grid-template-columns: 1fr;
    }
}

.interval-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Container do Calendário (Estilo Proporcional ao Referência) */
.interactive-calendar-container {
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px; 
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    width: 100%; 
    max-width: 400px; 
    margin: 0 auto;
    box-sizing: border-box;
}

body.dark-mode .interactive-calendar-container {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-color: #333;
    background-color: #1c1c1e;
}

.interactive-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cal-nav-btn {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
}

.cal-nav-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

body.dark-mode .cal-nav-btn {
    background-color: #2c2c2e;
    border-color: #3a3a3c;
    color: #e0e0e0;
}
body.dark-mode .cal-nav-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.interactive-calendar-header .month-year-display {
    font-weight: 700;
    font-size: 1.2em;
    text-transform: capitalize;
    color: var(--text-color);
}

.interactive-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.interactive-calendar-grid .weekday {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--secondary-color);
    padding-bottom: 8px;
}

.weekday.weekend-label {
    color: #ff6b6b;
    font-weight: 700;
}

/* BOTÕES DOS DIAS - PROPORÇÃO CORRIGIDA */
.interactive-calendar-grid .day-btn {
    background: none;
    border: none;
    border-radius: 50%;
    
    /* Proporção e Tamanho */
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; 
    max-width: 45px; 
    
    padding: 0;
    cursor: pointer;
    font-family: var(--font-family-base);
    font-size: 0.95em;
    color: var(--text-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    outline: none;
}

.interactive-calendar-grid .day-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.interactive-calendar-grid .day-btn:not(:disabled):hover {
    background-color: var(--btn-light-bg);
}

.interactive-calendar-grid .day-btn.weekend:not(.other-month) {
    background-color: #f9f9f9;
    color: #777;
}

.interactive-calendar-grid .day-btn.holiday {
    color: #dc3545;
    font-weight: bold;
    background-color: #fff5f5;
    position: relative;
}

.interactive-calendar-grid .day-btn.in-range {
    background-color: rgba(0, 113, 227, 0.15);
    border-radius: 0;
    color: var(--text-color);
}

.interactive-calendar-grid .day-btn.start-date,
.interactive-calendar-grid .day-btn.end-date {
    background-color: var(--primary-color) !important;
    color: var(--white-color) !important;
    font-weight: bold;
    opacity: 1;
}

.interactive-calendar-grid .day-btn.start-date {
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
    border-radius: 50%;
}

.interactive-calendar-grid .day-btn.end-date {
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
    border-radius: 50%;
}

.interactive-calendar-grid .day-btn.today {
    box-shadow: inset 0 0 0 2px var(--primary-color);
    font-weight: bold;
}

/* Dark Mode Grid */
body.dark-mode .interactive-calendar-grid .day-btn.weekend:not(.other-month) {
    background-color: #2a2a2a; 
    color: #98989d;
}

body.dark-mode .interactive-calendar-grid .day-btn.holiday {
    background-color: #3e2020; 
    color: #ff6b6b;
}

body.dark-mode .interactive-calendar-grid .day-btn.in-range {
    background-color: rgba(64, 156, 255, 0.25);
    color: #ffffff;
}

body.dark-mode .interactive-calendar-grid .day-btn:not(:disabled):hover:not(.start-date):not(.end-date) {
    background-color: #3a3a3c;
}

/* --- LISTA DE FERIADOS NO RODAPÉ --- */
.calendar-footer-separator {
    height: 1px;
    background-color: #eee;
    margin: 15px 0 10px 0;
}

.calendar-footer-holidays {
    list-style: none;
    padding: 0 5px;
    margin: 0;
    text-align: left;
    font-size: 0.85rem;
    color: #666;
}

.calendar-footer-holidays li {
    margin-bottom: 4px;
    line-height: 1.3;
}

.calendar-footer-holidays li strong {
    color: #333;
    margin-right: 5px;
}

body.dark-mode .calendar-footer-separator {
    background-color: #444;
}

body.dark-mode .calendar-footer-holidays {
    color: #aaa;
}

body.dark-mode .calendar-footer-holidays li strong {
    color: #ddd;
}

/* --- PAINEL DE RESULTADOS --- */
.result-container-modern {
    margin-top: 25px; 
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--light-bg);
    animation: fadeIn 0.5s;
    scroll-margin-top: 80px;
    border-left: 4px solid var(--primary-color);
    max-width: 100%; /* Garantir que não estoure */
    box-sizing: border-box;
}

body.dark-mode .result-container-modern {
    background-color: var(--content-bg);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--primary-color);
}

.result-actions {
    display: flex;
    gap: 10px;
}

/* --- ESTILOS CORRIGIDOS PARA BOTÕES DE AÇÃO (TEXTO) --- */
.result-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px; 
    font-weight: 500;
    padding: 8px 15px;
}

/* Botão Imprimir/Limpar/Partilhar (Secundários) */
.result-actions .btn-secondary,
.result-actions .btn-light {
    background-color: #f0f0f5; 
    color: #333 !important;
    border: 1px solid #d1d1d6;
}

body.dark-mode .result-actions .btn-secondary,
body.dark-mode .result-actions .btn-light {
    background-color: #2c2c2e;
    color: #fff !important;
    border-color: #3a3a3c;
}

@media (max-width: 600px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .result-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }
    .result-actions .btn {
        flex: 1;
        padding: 10px 5px;
        font-size: 0.85em;
        justify-content: center;
        text-align: center;
    }
}

.result-main-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.result-numbers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-box {
    background-color: var(--content-bg);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.result-value {
    display: block;
    font-size: 2.8em;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary-color);
}

.result-label {
    display: block;
    font-size: 1em;
    font-weight: 500;
    color: var(--secondary-color);
    margin-top: 5px;
}

.result-label .label-detail {
    font-size: 0.8em;
}

.result-mode-indicator {
    font-size: 0.8em;
    font-weight: 500;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-options-footer {
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

/* --- MINI CALENDÁRIO NO RESULTADO --- */
.mini-calendar-wrapper {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--content-bg);
}

.mini-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    min-height: 30px;
}

.mini-calendar-header {
    text-align: center;
    font-weight: 600;
    text-transform: capitalize;
    flex-grow: 1;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.mini-calendar-grid .weekday {
    font-size: 0.8em;
    font-weight: 500;
    color: var(--secondary-color);
}

.mini-calendar-grid .day {
    padding: 5px 0;
    border-radius: 50%;
    font-size: 0.9em;
}

.mini-calendar-grid .day.weekend { color: var(--secondary-color); }
.mini-calendar-grid .day.holiday { color: var(--danger-color); font-weight: bold; position: relative; }
.mini-calendar-grid .day.holiday::after {
    content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background-color: var(--danger-color);
}
.mini-calendar-grid .day.in-range { background-color: rgba(0, 113, 227, 0.15); border-radius: 0; }
.mini-calendar-grid .day.start-date { background-color: var(--primary-color); color: var(--white-color); font-weight: bold; border-top-left-radius: 50%; border-bottom-left-radius: 50%; }
.mini-calendar-grid .day.end-date { background-color: var(--primary-color); color: var(--white-color); font-weight: bold; border-top-right-radius: 50%; border-bottom-right-radius: 50%; }
.mini-calendar-grid .day.start-date.end-date { border-radius: 50%; }

/* --- CARDS DE INSIGHTS --- */
.result-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--content-bg);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.insight-card ion-icon {
    font-size: 1.8em;
    color: var(--primary-color);
}

.insight-value {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    display: block;
}

.insight-label {
    font-size: 0.85em;
    color: var(--secondary-color);
    display: block;
}

/* --- BOX PROMOCIONAL CONTAGEM REGRESSIVA (Estilo Antigo/Index) --- */
.countdown-promo-box {
    background-color: #f0f7ff;
    border: 1px solid #cce5ff;
    border-left: 5px solid #0071e3;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: background-color 0.3s, border-color 0.3s;
}

.countdown-promo-content {
    flex: 1;
    min-width: 250px;
}

.countdown-promo-title {
    color: #004085;
    margin: 0 0 5px 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.countdown-promo-text {
    color: #555;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.countdown-promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #0071e3;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,113,227,0.3);
}

.countdown-promo-btn:hover {
    background-color: #005bb5;
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
}

.countdown-promo-btn-wrapper {
    flex-shrink: 0;
}

body.dark-mode .countdown-promo-box {
    background-color: #1c2b36;
    border-color: #2c4a63;
    border-left-color: #0071e3;
}

body.dark-mode .countdown-promo-title {
    color: #60a5fa;
}

body.dark-mode .countdown-promo-text {
    color: #d1d5db;
}

/* --- 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;
}

.tool-info h4 {
    margin: 0 0 5px 0;
    font-size: 1em;
    font-weight: 600;
}

.tool-info p {
    margin: 0;
    font-size: 0.85em;
    color: var(--secondary-color);
}

body.dark-mode .tool-card {
    background-color: #2c2c2e;
}

/* =========================================================================
   ESTILOS ESPECÍFICOS PARA PÁGINA "QUANTOS DIAS FALTAM"
   ========================================================================= */

:root {
    --cp-radius: 12px;
    --cp-shadow: 0 4px 12px rgba(0,0,0,.06);
    --cp-shadow-hover: 0 8px 24px rgba(0,0,0,.10);
}

/* 1. ESTRUTURA E CALCULADORA */
.tool-hero {
    text-align: center;
    margin-bottom: 40px;
}

.tool-hero h1 { font-size: 2.2em; font-weight: 700; color: var(--text-color); margin-bottom: 10px; }
.tool-hero p { color: var(--secondary-color); font-size: 1.1em; }

.tool-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--cp-radius);
    padding: 30px;
    box-shadow: var(--cp-shadow);
    margin-bottom: 50px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

/* ESTILO DO CALENDÁRIO VISUAL (QUANTOS DIAS FALTAM) */
.calendar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.cal-month-label {
    font-weight: 700;
    color: var(--primary-color);
    text-transform: capitalize;
    font-size: 1.15em;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; 
    cursor: pointer;
    font-size: 1em;
    color: var(--text-color);
    transition: all 0.2s ease;
    user-select: none;
    margin: 0 auto;
    width: 100%; /* Ajuste para responsividade */
    max-width: 45px;
}

.cal-day:hover:not(.empty) {
    background-color: var(--btn-light-hover-bg);
}

.cal-day.empty {
    cursor: default;
    background: transparent;
}

.cal-day.weekend {
    color: #999;
    background-color: #fafafa;
}

.cal-day.holiday {
    color: var(--danger-color);
    font-weight: 700;
    background-color: #fff0f0;
    position: relative;
}

.cal-day.selected {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,113,227,0.4);
}

.cal-day.today {
    border: 1px solid var(--primary-color);
    font-weight: 700;
}

/* Ajustes Dark Mode - Calendário */
body.dark-mode .cal-day.weekend {
    background-color: #2c2c2e;
    color: #6e6e73;
}
body.dark-mode .cal-day.holiday {
    background-color: #3e1f1f;
    color: #ff6b6b;
}
body.dark-mode .cal-day:hover:not(.empty):not(.selected) {
    background-color: #3a3a3c;
}

/* Outros Inputs */
.tool-input {
    width: 100%;
    height: var(--input-height);
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--content-bg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.tool-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
    outline: none;
}

.tool-btn-action {
    height: var(--input-height);
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%; /* Inteiriço */
}

.tool-btn-action:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* 2. RESULTADOS E ETIQUETAS */
.result-box-highlight {
    display: none;
    margin-top: 30px;
    padding: 25px;
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: var(--cp-radius);
    text-align: center;
    animation: fadeIn 0.4s ease-out;
    position: relative;
}

.result-main-text {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-color);
}

.result-main-text .highlight {
    color: var(--primary-color);
}

.result-sub-text {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.result-details-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
}

.result-details-list li {
    background-color: var(--light-bg);
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
}

.badge {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.badge-util { background: #dcfce7; color: #166534; }
.badge-fds { background: #fef3c7; color: #92400e; }

/* 3. CARDS DE CONTAGEM */
.countdown-boxes-container {
    display: grid;
    /* Ajuste para melhor distribuição de 5 itens e centralização */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
}

.countdown-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--cp-radius);
    padding: 25px 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.countdown-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--cp-shadow-hover);
    border-color: var(--primary-color);
}

.countdown-box h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    line-height: 1.4;
}

.countdown-icon {
    font-size: 2rem;
    background: var(--light-bg);
    color: var(--primary-color);
    width: 64px;
    height: 64px;
    line-height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.countdown-box:hover .countdown-icon {
    background-color: rgba(0, 113, 227, 0.1);
}

.countdown-days {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 5px 0 10px 0;
    line-height: 1;
}

.countdown-target-date {
    font-size: 0.9em;
    color: var(--secondary-color);
    font-weight: 500;
    margin: 0;
}

.countdown-box[data-holiday="proximo-feriado"] {
    background: linear-gradient(135deg, var(--content-bg) 0%, var(--light-bg) 100%);
    border-color: rgba(0, 113, 227, 0.3);
}

/* 4. MODAL DETALHES */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--card-bg); /* Garante que não fique transparente */
    margin: auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s;
}

.close-button {
    color: var(--secondary-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    position: absolute;
    top: 20px;
    right: 20px;
    transition: color 0.2s;
}

.close-button:hover {
    color: var(--text-color);
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5em;
    text-align: center;
}

.result-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    background-color: var(--light-bg);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 0.85em;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.detail-value {
    display: block;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-color);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 5. CONFIGURAÇÃO ANIVERSÁRIO (MODAL) */
#modal-aniversario-config {
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-top: 20px;
}

.aniver-config-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.small-input {
    width: 70px !important;
    padding: 5px 10px !important;
    text-align: center;
    height: 42px !important; 
    border-radius: 8px;
}

.tool-btn-action.btn-sm {
    height: 42px;
    padding: 0 20px;
    font-size: 0.95rem;
    border-radius: 8px;
}

.btn-clean-data {
    background-color: #fff0f0;
    border: 1px solid #ff3b30;
    color: #ff3b30;
    height: 42px;
    width: auto;
    min-width: 42px;
    padding: 0 20px;
    gap: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.btn-clean-data:hover {
    background-color: #ff3b30;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.3);
    transform: translateY(-2px);
}

/* 6. DARK MODE ESPECÍFICO */
body.dark-mode .tool-container,
body.dark-mode .countdown-box,
body.dark-mode .result-box-highlight,
body.dark-mode .tool-input,
body.dark-mode .interactive-calendar-container,
body.dark-mode .modal-content {
    background-color: #1c1c1e;
    border-color: #38383a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body.dark-mode .detail-item {
    background-color: #2c2c2e;
}

body.dark-mode .countdown-icon { background-color: #2c2c2e; color: #0a84ff; }
body.dark-mode .countdown-box:hover .countdown-icon { background-color: rgba(10, 132, 255, 0.15); }
body.dark-mode .countdown-box[data-holiday="proximo-feriado"] {
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
}

body.dark-mode .btn-clean-data {
    background-color: rgba(255, 69, 58, 0.15);
    border-color: #ff453a;
    color: #ff453a;
}
body.dark-mode .btn-clean-data:hover {
    background-color: #ff453a;
    color: #ffffff;
}

/* Confetti Canvas */
.confetti-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10;
}

/* --- FAQ INTERATIVO (NOVO) --- */
.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);
    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; /* Altura suficiente para o conteúdo */
    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;
}

/* =========================================================================
   MEDIA QUERIES PARA LAYOUT MOBILE (NOVO - BASEADO NO LEGADO)
   ========================================================================= */

@media (max-width: 768px) {
    /* 1. Transformar Grid em Coluna Flex com Gap do Legado */
    .interval-grid-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* 2. Mover Calendário Principal (Entrada) para o Topo (Ordem -1) */
    .interactive-calendar-container {
        order: -1;
        width: 100%;
        max-width: 100%; /* Ocupar largura total no mobile */
        margin-bottom: 15px;
        padding: 10px; /* Reduzido de 15px para 10px para dar mais espaço */
        box-sizing: border-box;
    }

    /* 2.1 Ajuste de Fonte no Header do Calendário de Entrada (Mês/Ano) */
    .interactive-calendar-header .month-year-display {
        font-size: 1rem; /* Reduz para caber numa linha */
        white-space: nowrap;
        margin: 0; 
    }

    /* 3. Inputs de Data e Opções */
    .interval-inputs {
        order: 2;
        width: 100%;
    }

    /* 4. Separador Mobile visível */
    .mobile-separator {
        display: block;
        border: 0;
        border-top: 1px solid var(--border-color);
        margin: 15px 0;
    }

    /* 5. Checkboxes lado a lado (mesma linha) */
    .interval-options-row {
        justify-content: space-between; 
        flex-wrap: nowrap; /* Tentar manter na mesma linha */
    }

    .interval-options-row .form-group {
        flex: 1; /* Dividir espaço igualmente */
        min-width: 0; /* Evitar overflow */
    }
    
    .interval-options-row label {
        white-space: nowrap; /* Evitar quebra de linha no texto curto */
        font-size: 0.9em;
    }

    /* 6. Botões: Limpar acima, Calcular abaixo */
    .button-group-interval,
    .button-group-addsub,
    .button-group-proj {
        flex-direction: column-reverse; /* Inverte a ordem visual */
    }
    
    .button-group .btn,
    .button-group .btn-light {
        width: 100%; /* Largura total */
    }

    /* 7. Redução de Padding do Container Pai para ganhar espaço */
    .tool-container {
        padding: 15px; /* Reduz padding lateral de 30px para 15px */
    }

    /* 8. Ajuste de GAP do Grid de Dias para caber melhor */
    .interactive-calendar-grid {
        gap: 2px; /* Reduzido de 5px para 2px */
    }

    /* ============================================================
       NOVO: AJUSTE DE RESULTADOS NO MOBILE (FLEX COLUMN)
       ============================================================ */
    
    /* 9. Ajuste de Título do Resultado */
    .result-header h3 {
        font-size: 1.1em; /* Menor para caber em 2 linhas */
        line-height: 1.3;
    }

    /* Container de resultado menos "apertado" */
    .result-container-modern {
        padding: 15px; /* Legado usa 15px em vez de 20px */
    }

    .result-main-panel {
        display: flex;         /* Muda de Grid para Flex */
        flex-direction: column;/* Empilha os itens verticalmente */
        gap: 15px;
    }

    /* Calendário do Resultado no TOPO */
    .mini-calendar-wrapper {
        order: -1;         /* Joga para o topo (antes dos números) */
        width: 100%;       /* Largura total */
        max-width: 100%;   /* Remove restrições para não ficar espremido */
        margin: 0;         /* Reset de margens */
        box-sizing: border-box;
        padding: 10px;     /* Legado */
    }

    /* Container de Números/Boxes abaixo do calendário */
    .result-numbers {
        width: 100%;
        order: 0;          /* Mantém ordem natural */
    }

    /* Boxes individuais (soltos e auto ajustáveis) */
    .result-box {
        width: 100%;       /* Garante que ocupem a largura disponível */
        box-sizing: border-box; /* Previne estouro */
        padding: 15px;     /* Reduz padding interno (Legado) */
        overflow: hidden;
    }

    /* Reduzir fonte do número gigante para evitar estouro */
    .result-value {
        font-size: 2.2em; 
        word-wrap: break-word;
    }

    /* Insights Cards (Abaixo dos resultados) */
    .result-insights {
        grid-template-columns: 1fr; /* Uma coluna por linha */
    }
}

/* ==========================================================================
   NOVOS ESTILOS - LANDING PAGES DINÂMICAS (QUANTOS DIAS FALTAM)
   ========================================================================== */

/* Hero da Página de Evento */
.event-hero {
    margin-bottom: 3rem;
}

/* Flex Container para Header (Icone + H1 na mesma linha) */
.event-hero-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    text-align: center;
    margin-bottom: 1rem;
}

.event-icon-wrapper {
    font-size: 3rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: floatIcon 3s ease-in-out infinite;
}

.event-hero-header h1 {
    font-size: 2.5rem; /* Ajuste conforme necessidade */
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Wrapper de Destaque */
.countdown-highlight-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-direction: column; /* Para empilhar o box e os micro cards */
    align-items: center;
}

/* Ajuste no Countdown Box para Destaque */
.countdown-box.featured-countdown {
    border-top: 5px solid var(--primary-color);
    background: linear-gradient(to bottom, var(--bg-card), rgba(0, 113, 227, 0.03));
    width: 100%;
    max-width: 500px;
}

/* Número Gigante (Override) */
.countdown-days.big-number {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin: 20px 0 5px 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

/* Micro Cards Grid */
.micro-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    max-width: 700px;
}

.micro-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.micro-card:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 113, 227, 0.02);
    transform: translateY(-2px);
}

.micro-card-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.micro-card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2px;
}

.micro-card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Conteúdo Rico (Intro e Curiosidades) */
.rich-content-section {
    max-width: 800px;
    margin: 0 auto 30px auto;
}

.event-intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.event-intro-text p {
    margin-bottom: 20px;
}

.curiosities-box {
    background-color: var(--bg-card);
    border-left: 4px solid #fca311;
    padding: 25px;
    border-radius: 0 12px 12px 0;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.curiosities-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.3rem;
}

.curiosities-box ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.curiosities-box li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--secondary-color);
}

.curiosities-box li::before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9em;
}

/* Lista de Próximas Datas */
.next-dates-list {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px !important;
    background-color: var(--card-bg);
}

/* BOTÃO "BONITO" (Ver outros feriados) */
.btn-outline-pretty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 113, 227, 0.1);
}

.btn-outline-pretty:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 113, 227, 0.2);
    text-decoration: none;
}

/* Dark Mode Adjustments para novos elementos */
body.dark-mode .micro-card {
    background-color: #2c2c2e;
    border-color: #3a3a3c;
}
body.dark-mode .curiosities-box {
    background-color: #2c2c2e;
}
body.dark-mode .next-dates-list {
    background-color: #2c2c2e;
    border-color: #3a3a3c;
}
body.dark-mode .btn-outline-pretty {
    color: #60a5fa;
    border-color: #60a5fa;
    box-shadow: 0 4px 6px rgba(96, 165, 250, 0.1);
}
body.dark-mode .btn-outline-pretty:hover {
    background-color: #60a5fa;
    color: #1c1c1e;
}
/* ==========================================================================
   CORREÇÕES ESPECÍFICAS: TABELA DE FÉRIAS ESCOLARES (DARK MODE + BORDAS)
   ========================================================================== */

/* 1. Forçar fundo escuro no container rico (sobrepõe o style="background: white" do PHP) */
body.dark-mode .rich-content-section {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    border: 1px solid var(--border-color);
}

/* 2. Estilo da Tabela com Bordas Definidas */
.table-bordered {
    border: 1px solid var(--border-color);
    border-collapse: collapse;
    width: 100%;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-color);
    padding: 12px 15px;
}

/* Cabeçalho da Tabela */
.table thead th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

/* 3. Ajustes Específicos para Dark Mode na Tabela */
body.dark-mode .table {
    color: var(--text-color);
    background-color: transparent;
}

body.dark-mode .table-bordered,
body.dark-mode .table-bordered th,
body.dark-mode .table-bordered td {
    border-color: #38383a; /* Cor da borda mais visível no escuro */
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Hover suave no escuro */
}

/* Ajuste de contraste para o texto pequeno (*Depende do ano escolar) */
body.dark-mode .text-muted {
    color: #98989d !important;
}