/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9fafb;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, #7c2d12 0%, #5c1a1a 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    text-align: center;
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

.nav {
    display: flex;
    justify-content: center;
}

.nav-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.25rem;
    backdrop-filter: blur(4px);
}

.nav-button {
    background: transparent;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.nav-button:last-child {
    margin-right: 0;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-button.active {
    background: white;
    color: #7c2d12;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

.filters-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #7c2d12;
    box-shadow: 0 0 0 3px rgba(124, 45, 18, 0.1);
}

.content-section {
    animation: fadeIn 0.5s ease-out;
}

.content-section.hidden {
    display: none;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7c2d12;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #7c2d12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Schedule Cards */
.schedule-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.schedule-header {
    background: #fef7f0;
    padding: 1.5rem;
    border-bottom: 1px solid #fed7aa;
}

.schedule-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.schedule-class-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: #7c2d12;
}

.schedule-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-trimester-1 {
    background: #dbeafe;
    color: #1e40af;
}

.badge-trimester-2 {
    background: #dcfce7;
    color: #166534;
}

.badge-trimester-3 {
    background: #fef3c7;
    color: #d97706;
}

.badge-trimester-4 {
    background: #f3e8ff;
    color: #7c3aed;
}

.schedule-theme {
    font-size: 0.875rem;
    color: #7c2d12;
    font-weight: 500;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.schedule-table thead {
    background: #fef7f0;
}

.schedule-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #7c2d12;
    border-bottom: 1px solid #fed7aa;
}

.schedule-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.schedule-table tbody tr:hover {
    background: rgba(254, 247, 240, 0.5);
}

.lesson-number {
    font-weight: 600;
    color: #7c2d12;
}

.teacher-name {
    font-weight: 500;
    color: #374151;
}

/* Lessons Grid */
.lessons-section {
    margin-bottom: 2rem;
}

.lessons-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.lessons-section-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #7c2d12;
}

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.lesson-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lesson-image {
    position: relative;
    height: 12rem; 
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-image img {
    width: 100%;   
    height: 100%;  
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lesson-card:has(.badge-type-professor) .lesson-image {
    background-color: #f7e0d3; 
}

.lesson-card:has(.badge-type-aluno) .lesson-image {
    background-color: #d3eaf7; 
}

.lesson-card:has(.badge-type-livro-de-apoio) .lesson-image {
    background-color: #e0f7d3; 
}

.lesson-card:has(.badge-type-material) .lesson-image {
    background-color: #f7d3e0; 
}

.lesson-card:not(:has(.badge-type-professor)):not(:has(.badge-type-aluno)):not(:has(.badge-type-livro-de-apoio)):not(:has(.badge-type-material)) .lesson-image {
    background-color: #f0f0f0;
}

.lesson-card:hover .lesson-image img {
    transform: scale(1.05);
}

.lesson-badges-bottom {
    display: flex;
    flex-wrap: wrap; 
    gap: 0.5rem;
    margin-bottom: 0.75rem; 
    align-items: center; 
}

.badge-type-professor {
    --badge-bg-professor: #fef7f0;
    --badge-color-professor: #7c2d12; 
    background: var(--badge-bg-professor);
    color: var(--badge-color-professor);
}

.badge-type-aluno {
    --badge-bg-aluno: #fff7ed; 
    --badge-color-aluno: #ea580c; 
    background: var(--badge-bg-aluno);
    color: var(--badge-color-aluno);
}

.badge-type-livro-de-apoio {
    --badge-bg-livro-de-apoio: #ecfccb;
    --badge-color-livro-de-apoio: #365314;
    background: var(--badge-bg-livro-de-apoio);
    color: var(--badge-color-livro-de-apoio);
}

.badge-type-material {
    --badge-bg-material: #e0f2fe;
    --badge-color-material: #0369a1;
    background: var(--badge-bg-material);
    color: var(--badge-color-material);
}

.lesson-badges-bottom .badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap; 
}

.lesson-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lesson-card:hover .lesson-overlay {
    background: rgba(0, 0, 0, 0.2);
}

.lesson-icon {
    width: 2rem;
    height: 2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lesson-card:hover .lesson-icon {
    opacity: 1;
}

.lesson-content {
    padding: 1.5rem;
}

.lesson-title {
    font-size: 1.125rem;
    font-weight: bold;
    color: #7c2d12;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.lesson-card:hover .lesson-title {
    color: #5c1a1a;
}

.lesson-theme {
    color: #7c2d12;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.lesson-description {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #d1d5db;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #7c2d12 0%, #5c1a1a 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .nav-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .schedule-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .filters-card {
        padding: 1rem;
    }
    
    .schedule-header {
        padding: 1rem;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 0.5rem;
    }
}

/* --- Estilos da Visão Geral (Dashboard) --- */

.overview-container {
    animation: fadeIn 0.5s ease-out;
}

.overview-header {
    text-align: center;
    margin-bottom: 1rem;
}

.overview-header h3 {
    color: #7c2d12;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.shadow-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
}

.overview-table th {
    background-color: #fff7ed; /* Um laranja bem clarinho */
    color: #9a3412;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.overview-table .class-col {
    font-weight: 700;
    color: #7c2d12;
}

.overview-table .teacher-col {
    color: #1f2937;
    font-weight: 600;
}

.lesson-cell {
    display: flex;
    flex-direction: column;
}

.lesson-tag {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: normal;
}

.theme-text {
    font-weight: 500;
    color: #374151;
}

/* Estilos do Card de Destaque Individual */
.highlight-card {
    border-left: 5px solid #ea580c;
    background-color: #fff7ed;
    margin-bottom: 2rem;
}

.highlight-header {
    background-color: #ffedd5;
    border-bottom: 1px solid #fed7aa;
}

.highlight-badge {
    background: #ea580c; 
    color: white; 
    margin-bottom: 0.5rem; 
    display: inline-block;
}

.label-sm {
    font-size: 0.875rem; 
    color: #666; 
    margin-bottom: 0.25rem;
}

.value-lg {
    font-size: 1.125rem; 
    font-weight: bold; 
    color: #333;
}


/* --- Modal de Vídeo --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fundo escuro transparente */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px; /* Tamanho máximo do player */
    background: black;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0 10px;
}

.modal-close:hover {
    color: #ea580c; /* Laranja da identidade */
}

/* Truque para manter proporção 16:9 (YouTube padrão) */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- Barra de Pesquisa --- */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem; /* Espaço para o ícone */
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.search-wrapper input:focus {
    border-color: #7c2d12;
    box-shadow: 0 0 0 3px rgba(124, 45, 18, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none; /* Para clicar através do ícone */
}

/* --- Estilos da Agenda (Timeline) --- */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Linha vertical central */
.timeline-container::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #fed7aa; /* Laranja clarinho */
    top: 0;
    bottom: 0;
    left: 20px; /* Alinhado à esquerda para mobile */
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    margin-left: 50px; /* Espaço para a linha */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border-left: 4px solid #ea580c; /* Borda laranja destaque */
}

.timeline-item:hover {
    transform: translateX(5px);
}

/* A bolinha na linha do tempo */
.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    left: -42px; /* Posiciona em cima da linha */
    background-color: #ea580c;
    border: 4px solid #fff7ed;
    border-radius: 50%;
    top: 1.5rem;
    z-index: 10;
}

.timeline-date {
    font-weight: bold;
    color: #ea580c;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-event {
    font-size: 1.125rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.timeline-location {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tags de Local coloridas (Opcional - baseado na sua imagem) */
.badge-location {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.loc-rodovia { background: #dcfce7; color: #166534; } /* Verde */
.loc-paralela { background: #dbeafe; color: #1e40af; } /* Azul */
.loc-comemorativa { background: #ffedd5; color: #9a3412; } /* Laranja */
.loc-indefinido { background: #fee2e2; color: #991b1b; } /* Vermelho */

/* --- Versículo do Dia --- */
.daily-verse {
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-style: italic;
}
.verse-text { font-size: 0.95rem; margin-bottom: 0.25rem; color: #fff; }
.verse-ref { font-size: 0.8rem; color: #fed7aa; font-weight: bold; text-align: right; }

/* --- Ferramentas (Botões) --- */
.tools-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 5px solid #7c2d12;
}
.tools-grid { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.tool-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}
.tool-button:hover { transform: translateY(-2px); }
.whatsapp-btn { background-color: #25D366; color: white; }
.print-btn { background-color: #374151; color: white; }

/* --- Configuração de Impressão (Ctrl+P) --- */
@media print {
    /* Esconde o que não precisa no papel */
    .header, .nav, .filters-card, .tools-card, .footer, #videoModal {
        display: none !important;
    }
    
    body { background: white; color: black; }
    .container { max-width: 100%; margin: 0; padding: 0; }
    
    /* Ajusta a tabela para impressão */
    .schedule-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid; /* Não quebra card no meio da página */
    }
    .schedule-header { background: #eee; color: black; }
    .schedule-class-name { color: black; }
    .badge { border: 1px solid #ccc; color: black !important; background: white !important; }
    
    /* Título para Impressão */
    .main::before {
        content: "Escala EBD - AD Rodovia A";
        display: block;
        font-size: 20pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
    }
}

/* --- Toast Notification (Aviso Suave) --- */
#toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#toast-container.show {
    opacity: 1;
    visibility: visible;
    bottom: 3rem; /* Efeito de subida */
}

