:root {
    /* Light Theme (Default) */
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-color: #333;
    --bg-light: #f3f4f6;
    --white: #fff;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.05);
    --header-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --border-color: rgba(0,0,0,0.05);
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition-speed: 0.3s;
}

html[data-theme="dark"] {
    --primary-color: #3b82f6; /* Lighter blue */
    --secondary-color: #2563eb; /* Original primary blue */
    --text-color: #d1d5db; /* Light gray */
    --bg-light: #1f2937; /* Dark gray */
    --white: #111827; /* Near black */
    --card-shadow: 0 4px 6px rgba(0,0,0,0.2);
    --header-shadow: 0 2px 4px rgba(0,0,0,0.4);
    --border-color: rgba(255,255,255,0.1);
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-light);
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
}
a { text-decoration: none; color: inherit; }

/* Header */
header { 
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    box-shadow: var(--header-shadow); position: sticky; top: 0; left: 0; right: 0; z-index: 99999; transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease; 
}

nav { max-width: 1200px; margin: 0 auto; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.8rem; font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }
.logo img { height: 40px; width: auto; }

html[data-theme="dark"] .logo img {
    filter: invert(10%) sepia(100%) saturate(200%) hue-rotate(180deg) brightness(1.2);
}
html[data-theme="dark"] header { background: rgba(17, 24, 39, 0.85); }

.nav-controls { display: flex; align-items: center; gap: 1.5rem; }

.nav-links { display: flex; gap: 1rem; list-style: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary-color); font-weight: 600; }

/* Estilo para o link ativo (ScrollSpy) */
.nav-links a { position: relative; transition: color 0.3s; white-space: nowrap; }
.nav-links a:not(.btn-cta).active { color: var(--primary-color); font-weight: 600; }
.nav-links a:not(.btn-cta).active::after {
    content: ''; position: absolute; bottom: -5px; left: 0;
    width: 100%; height: 3px; background: var(--accent-color); border-radius: 2px;
}

.btn-cta { background: var(--primary-color); color: var(--white); padding: 0.5rem 1.2rem; border-radius: 5px; }
.btn-cta:hover { background: var(--secondary-color); }

/* Theme Toggle Button */
.theme-toggle { background: none; border: none; cursor: pointer; color: var(--primary-color); display: flex; align-items: center; padding: 0.5rem; border-radius: 50%; }
.theme-toggle:hover { background-color: var(--bg-light); }
.theme-toggle .moon-icon { display: none; }
.theme-toggle .sun-icon { display: block; }

html[data-theme="dark"] .theme-toggle {
    color: var(--accent-color);
}
html[data-theme="dark"] .theme-toggle:hover {
    background-color: var(--white); /* Near black in dark mode */
}
html[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}
html[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

/* Mobile Menu Icon */
.mobile-menu-icon { display: none; cursor: pointer; background: none; border: none; padding: 0.5rem; }
.hamburger-icon {
    fill: var(--primary-color);
    transition: transform 0.3s ease-in-out;
}
.hamburger-icon rect {
    transition: all 0.3s ease-in-out;
}
/* Animação do ícone para 'X' */
.mobile-menu-icon.is-active .hamburger-icon { transform: rotate(180deg); }
.mobile-menu-icon.is-active .hamburger-icon rect:nth-child(1) { transform: translate(15px, 20px) rotate(45deg); width: 70px; }
.mobile-menu-icon.is-active .hamburger-icon rect:nth-child(2) { opacity: 0; }
.mobile-menu-icon.is-active .hamburger-icon rect:nth-child(3) { transform: translate(-15px, -20px) rotate(-45deg); width: 70px; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: #fff; padding: 1.5rem 2rem; text-align: center; }
.hero h1 { 
    font-size: 2.8rem; margin-bottom: 0.75rem; line-height: 1.2; text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    /* Opcional: Efeito de destaque sutil no texto */
    background: linear-gradient(to right, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.btn-hero { background: var(--accent-color); color: var(--white); padding: 0.6rem 1.5rem; border-radius: 50px; font-weight: bold; display: inline-block; margin-top: 0.75rem; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); font-size: 0.95rem; }
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6); }

/* Sections */
.section { padding: 5rem 2rem; max-width: 1200px; margin: 0 auto; }
.section-title {
    text-align: center; margin-bottom: 3rem; color: var(--secondary-color); font-size: 2rem; position: relative; padding-bottom: 1rem; transition: color var(--transition-speed) ease;
    opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; /* Animação inicial */
}
.section-title.is-visible { opacity: 1; transform: translateY(0); }
.section-title::after { content: ''; display: block; width: 60px; height: 4px; background: var(--accent-color); margin: 0.5rem auto 0; border-radius: 2px; }
.bg-light { background-color: var(--bg-light); transition: background-color var(--transition-speed) ease; }

/* Grid Layouts */
.section-content-narrow {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.section-content-narrow p + p {
    margin-top: 1rem;
}
.section-intro {
    text-align: center;
    margin-bottom: 2rem;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-image-placeholder { 
    background: #e5e7eb linear-gradient(to right, #e5e7eb 4%, #f3f4f6 25%, #e5e7eb 36%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    height: 200px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: #666; 
}
/* Remove animação de fundo se for apenas um ícone grande transparente */
.about-image-placeholder.large-icon { font-size: 5rem; background: transparent; animation: none; }
.about-text h3 + h3 { margin-top: 1.5rem; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.card {
    background: var(--white); padding: 2.5rem 2rem; border-radius: 12px;
    box-shadow: var(--card-shadow); text-align: center;
    border: 1px solid var(--border-color);
    /* Animação de entrada */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, box-shadow 0.3s ease, border-color 0.3s ease, background-color var(--transition-speed) ease;
}
.card.is-visible { opacity: 1; transform: translateY(0); }
.card-icon { font-size: 2.5rem; display: block; margin-bottom: 1rem; }
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.15); border-color: var(--primary-color); }

/* Estilo específico para os cards de planejamento (links) */
.planning-card { display: block; border: 2px solid transparent; cursor: pointer; }
.planning-card:hover {
    border-color: var(--primary-color); 
    background-color: #f0f9ff; /* Azul muito claro */
}

/* Accordion for Planejamentos */
.accordion-container {
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden; /* To keep border-radius on children */
    background-color: var(--white);
    box-shadow: var(--card-shadow);
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* Remove default marker */
    transition: background-color 0.2s;
}

.accordion-header::-webkit-details-marker { display: none; } /* Hide default arrow on Chrome/Safari */

.accordion-header:hover { background-color: var(--bg-light); }

.accordion-header h3 {
    margin: 0;
    flex-grow: 1; /* Make title take up available space */
    color: var(--secondary-color); transition: color var(--transition-speed) ease;
}

.accordion-icon { font-size: 1.5rem; }

/* Estilo do ícone de seta do Acordeão */
.accordion-chevron {
    margin-left: auto; /* Empurra a seta para a direita */
    color: var(--secondary-color);
    transition: transform 0.3s ease-out, color var(--transition-speed) ease;
}

/* Rotaciona a seta quando o acordeão está aberto */
.accordion-item[open] > .accordion-header .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-content {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    background-color: var(--white);
    overflow: hidden;
    max-height: 0;
    padding: 0 1.5rem; /* Horizontal padding remains */
    border-top: 1px solid transparent; /* Placeholder for smooth transition */
    transition: max-height 0.4s ease-in-out, padding-top 0.4s ease-in-out, padding-bottom 0.4s ease-in-out, border-color 0.2s ease-in-out;
}
.accordion-item[open] > .accordion-content {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-top-color: var(--border-color);
}
.btn-bimestre {
    background: #eef2ff; /* Tom de azul bem claro */
    color: var(--secondary-color);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease-in-out;
}
html[data-theme="dark"] .btn-bimestre {
    background: #1e293b; /* Azul acinzentado escuro */
    color: #94a3b8; /* Cinza azulado claro */
}
html[data-theme="dark"] .btn-bimestre:hover {
    background: var(--primary-color); color: var(--white);
}
.btn-bimestre svg {
    width: 1em;
    height: 1em;
    stroke: var(--secondary-color);
    transition: stroke 0.2s ease-in-out;
}
.btn-bimestre:hover svg { stroke: var(--white); }
html[data-theme="dark"] .btn-bimestre svg {
    stroke: #94a3b8;
}
html[data-theme="dark"] .btn-bimestre:hover svg {
    stroke: var(--white);
}
.btn-bimestre:hover { background: var(--primary-color); color: var(--white); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }

/* Estilo para botões desabilitados */
.btn-bimestre.disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
    pointer-events: none; /* Impede eventos de clique e hover */
    filter: grayscale(1);
    opacity: 0.7;
}

/* Botão Voltar ao Topo */
.back-to-top { position: fixed; bottom: 20px; right: 20px; background: var(--primary-color); color: #fff; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s, background-color 0.2s; z-index: 100; }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--secondary-color); }

/* Estilos de foco para acessibilidade */
:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3); /* Melhora visibilidade do foco */
    border-radius: 5px;
}
/* Utilitários de Acessibilidade */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    background: var(--accent-color);
    color: var(--white);
    padding: 1rem;
    z-index: 2000;
    clip: auto;
    width: auto;
    height: auto;
    border-radius: 8px;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; border: 2px solid var(--bg-light); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #1f2937; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #4b5563; border-color: #1f2937; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #6b7280; }

footer { background: #1f2937; color: #d1d5db; padding: 2.5rem 2rem; text-align: center; }
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-email {
    color: inherit;
    font-weight: 500;
    transition: color 0.3s;
}
.footer-email:hover { color: var(--accent-color); text-decoration: underline; }

/* Seção QR Code Instagram */
.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}
.qrcode-img {
    max-width: 250px;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.qrcode-img:hover { transform: scale(1.05); }

.social-links { display: flex; gap: 1rem; }
.social-links svg { fill: currentColor; }
.social-links a {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
}
.social-links a:hover { background-color: var(--primary-color); transform: translateY(-3px); }

/* Responsividade */
@media (max-width: 1100px) {
    .logo-text { display: none; } /* Esconde o texto do logo em telas médias para dar espaço ao menu */
}

@media (max-width: 768px) {
    .mobile-menu-icon { display: block; }
    .nav-controls { position: relative; z-index: 100000; }
    
    .nav-links {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white) !important;
        z-index: 99998;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        /* Animação */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        border-top: 1px solid var(--border-color);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
        pointer-events: none; /* Impede cliques quando invisível */
    }

    .nav-links.active { 
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-controls {
        /* Garante que o toggle de tema e o menu hamburguer fiquem alinhados */
        gap: 0.5rem;
    }
    .about-grid { grid-template-columns: 1fr; }

    .footer-content {
        flex-direction: column;
        justify-content: center;
    }
}

/* Estilos de Impressão (Para professores imprimirem planejamentos) */
@media print {
    header, .theme-toggle, .mobile-menu-icon, .btn-hero, .btn-cta, .back-to-top, footer, .qrcode-container {
        display: none !important;
    }

    body { 
        padding-top: 0; 
        background-color: white !important; 
        color: black !important; 
    }

    .section { padding: 1rem 0; }
    
    /* Expande todos os acordeões na impressão */
    .accordion-content { 
        max-height: none !important; 
        opacity: 1 !important; 
        display: flex !important; 
        padding-top: 1rem;
    }
    
    .accordion-header .accordion-chevron { display: none; }
    .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
    a[href]:after { content: " (" attr(href) ")"; font-size: 0.8em; } /* Exibe URLs na impressão */
}
