@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8fafc; /* Light slate */
    color: #0f172a;
}

/* Premium Card & App Feel */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.calendar-container {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

/* Grid layout with custom borders */
.calendar-grid {
    background-color: #e2e8f0; /* Slate 200 for borders */
    gap: 1px;
    border-radius: 16px;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

.calendar-day {
    min-height: 100px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background-color: #ffffff;
}

@media (min-width: 640px) {
    .calendar-day {
        min-height: 130px;
    }
}

.calendar-day:not(.is-past):hover {
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    transform: scale(1.03);
    z-index: 10;
    border-radius: 12px;
}

/* Today indicator */
.day-today {
    background-color: #f0f9ff !important; /* Sky 50 */
}

.day-today .date-number {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

@media (min-width: 640px) {
    .day-today .date-number {
        width: 32px;
        height: 32px;
    }
}

/* Status Colors (Market Tool Style) */
.bg-com-filhos {
    background-color: #ecfdf5 !important; /* Emerald 50 */
    position: relative;
}
.bg-com-filhos::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: #10b981; /* Emerald 500 */
}

.bg-sem-filhos {
    background-color: #fff7ed !important; /* Orange 50 */
    position: relative;
}
.bg-sem-filhos::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: #f97316; /* Orange 500 */
}

.is-past {
    background-color: #f8fafc !important; 
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Glassmorphism Modals */
.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Badges */
.event-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

/* Separator */
.month-separator {
    display: flex;
    align-items: center;
    margin: 3rem 0 1.5rem;
}
.month-separator::before,
.month-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}
.month-separator span {
    padding: 0 1.5rem;
    font-weight: 800;
    color: #1e293b; /* Slate 800 */
    font-size: 1.35rem;
    letter-spacing: -0.025em;
}

/* Animations */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-fade-in {
    animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- DARK MODE OVERRIDES --- */
body.dark-theme {
    background-color: #0f172a;
    color: #f1f5f9;
}
body.dark-theme .bg-white { background-color: #1e293b !important; }
body.dark-theme .bg-slate-50 { background-color: #0f172a !important; }
body.dark-theme .text-slate-800 { color: #f1f5f9 !important; }
body.dark-theme .text-slate-700 { color: #e2e8f0 !important; }
body.dark-theme .text-slate-600 { color: #cbd5e1 !important; }
body.dark-theme .text-slate-500 { color: #94a3b8 !important; }
body.dark-theme .text-slate-400 { color: #64748b !important; }
body.dark-theme .border-slate-100, 
body.dark-theme .border-slate-200, 
body.dark-theme .border-slate-300 { border-color: #334155 !important; }

body.dark-theme .app-header {
    background: rgba(15, 23, 42, 0.85);
    border-bottom-color: rgba(51, 65, 85, 0.8);
}
body.dark-theme .calendar-container {
    background: #1e293b;
    border-color: rgba(51, 65, 85, 0.8);
}
body.dark-theme .calendar-grid {
    background-color: #334155;
}
body.dark-theme .calendar-day {
    background-color: #1e293b;
}
body.dark-theme .day-today {
    background-color: #172554 !important; /* blue-950 */
}
body.dark-theme .bg-com-filhos {
    background-color: rgba(6, 78, 59, 0.4) !important; /* emerald-900/40 */
}
body.dark-theme .bg-sem-filhos {
    background-color: rgba(124, 45, 18, 0.4) !important; /* orange-900/40 */
}
body.dark-theme .is-past {
    background-color: #0f172a !important;
}
body.dark-theme .modal-content {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(51, 65, 85, 0.5);
}
body.dark-theme .month-separator span {
    color: #f1f5f9;
}
body.dark-theme .month-separator::before,
body.dark-theme .month-separator::after {
    background: linear-gradient(to right, transparent, #334155, transparent);
}
body.dark-theme input, body.dark-theme select, body.dark-theme textarea {
    color: #f1f5f9;
}
body.dark-theme #splash-screen {
    background-color: #0f172a !important;
}

/* --- CASA "APOIO" / MÓDULO ESCALA (apoio.js) --- */
/* Escala desligada: some o que só faz sentido com Com/Sem Filhos; nada é apagado */
body.escala-off .escala-only { display: none !important; }

/* Casa "Apoio": some a legenda e a linha dos dias da semana, que são do calendário */
body.home-apoio .cal-only { display: none !important; }
body.home-apoio #view-calendario { display: none !important; }

/* O header é fixo: a altura muda conforme legenda/dias da semana aparecem */
body.escala-off main { margin-top: 111px; }
body.home-apoio main { margin-top: 80px; }
@media (min-width: 640px) {
    body.escala-off main { margin-top: 135px; }
    body.home-apoio main { margin-top: 80px; }
}

.apoio-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #8b5cf6 100%);
}
body.dark-theme .apoio-hero {
    background: linear-gradient(135deg, #3730a3 0%, #4338ca 55%, #6d28d9 100%);
}

.home-view-btn.is-active { background: #fff; color: #4f46e5; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
body.dark-theme .home-view-btn.is-active { background: #1e293b !important; color: #a5b4fc; }

@media (prefers-reduced-motion: reduce) {
    .animate-fade-in, .animate-pulse { animation: none !important; }
}

body.dark-theme .apoio-sug { background: rgba(19, 78, 74, 0.25); border-color: rgba(45, 212, 191, 0.25); }
body.dark-theme .apoio-sug-date { background: #0f172a !important; border-color: rgba(45, 212, 191, 0.3); }
body.dark-theme .apoio-sug-add { background: #0f172a !important; color: #5eead4; border-color: rgba(45, 212, 191, 0.4); }
body.dark-theme .apoio-sug-add:hover { background: #14b8a6 !important; color: #fff; }
body.dark-theme #view-apoio .text-slate-400 { color: #94a3b8 !important; }
body.dark-theme #view-apoio .border-dashed { border-color: #475569 !important; }
