:root {
    /* Cores fixas */
    --primary: #2e7d32;
    --primary-dark: #1b5e20;
    --secondary: #ff9800;
    --plastic-color: #e53935; /* Vermelho */
    --paper-color: #1e88e5;   /* Azul */
    --glass-color: #43a047;   /* Verde */
    --metal-color: #fdd835;   /* Amarelo */
    --organic-color: #6d4c41; /* Marrom */

    /* Cores do tema (Light por padrão) */
    --bg-page: #f9f9f9;
    --bg-section-alt: #f5f5f5;
    --bg-card: #ffffff;
    --text-main: #333;
    --text-muted: #757575;
    --border-light: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg-page: #1a1a1a;
    --bg-section-alt: #252525;
    --bg-card: #333333;
    --text-main: #f0f0f0;
    --text-muted: #9e9e9e;
    --border-light: #444444;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-page);
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    /* Adiciona a imagem de fundo com um gradiente por cima para garantir a legibilidade do texto */
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.85), rgba(27, 94, 32, 0.85)), url('assets/images/Pimenta-Bueno-Ro.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 1.5rem 0;
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

.header-content {
    position: relative;
    text-align: center;
    padding: 2rem 0;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.theme-toggle .fa-sun { display: none; }
.theme-toggle .fa-moon { display: block; }

body.dark-mode .theme-toggle .fa-sun { display: block; }
body.dark-mode .theme-toggle .fa-moon { display: none; }
body.dark-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.tagline {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: var(--bg-card);
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--text-muted);
}

/* Waste Types */
.waste-types {
    padding: 4rem 0;
    position: relative;
    background-image: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url('assets/images/reciclado.jpg');
    background-size: cover;
    background-position: center;
    background-color: var(--bg-section-alt); /* Fallback */
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary);
}

body.dark-mode .waste-types {
    background-image: linear-gradient(rgba(37, 37, 37, 0.88), rgba(37, 37, 37, 0.88)), url('assets/images/reciclado.jpg');
}

.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    flex: 1 1 300px;
    max-width: 450px;
    
    /* Propriedades para animação de entrada */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease-in-out;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-header {
    padding: 1.5rem;
    color: white;
    text-align: center;
}

.common-waste .card-header {
    background-color: #9e9e9e;
}

.recyclable .card-header {
    background-color: var(--primary);
}

.card-body {
    padding: 1.5rem;
}

.card-body ul {
    list-style-type: none;
    padding: 0;
}

.card-body li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.card-body li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Colors Guide Section */
.colors-guide {
    padding: 4rem 0;
    position: relative;
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url('assets/images/reciclado.jpg');
    background-size: cover;
    background-position: center;
    background-color: var(--bg-card); /* Fallback */
}

.material-guide-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.material-card {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease-in-out;
    flex: 1 1 280px;
    max-width: 450px;

    /* Propriedades para animação de entrada */
    opacity: 0;
    transform: translateY(30px);
}

.material-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.material-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.material-header {
    padding: 1rem;
    color: #fff;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.material-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
}

.plastic-color { background-color: var(--plastic-color); }
.paper-color { background-color: var(--paper-color); }
.glass-color { background-color: var(--glass-color); }
.metal-color { background-color: var(--metal-color); color: var(--dark); }
.organic-color { background-color: var(--organic-color); }

.metal-color h3 { color: #333; }

.material-body {
    padding: 1.5rem;
    padding-top: 0;
    flex-grow: 1;
}

.material-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding-top: 1.5rem;
}

.material-columns.single-column {
    grid-template-columns: 1fr;
    text-align: center;
}

.material-column {
    /* Ocupa o espaço disponível */
}

.material-body h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.25rem;
}

.material-column:first-child h4 { color: var(--primary); }
.material-column:last-child h4 { color: var(--plastic-color); }
.single-column .material-column h4 { color: var(--plastic-color); }

.material-body ul { list-style-type: none; }
.material-body li { padding: 0.25rem 0; font-size: 0.9rem; }

.guide-footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

body.dark-mode .colors-guide {
    background-image: linear-gradient(rgba(51, 51, 51, 0.9), rgba(51, 51, 51, 0.9)), url('assets/images/reciclado.jpg');
}

/* Schedule Section */
.schedule {
    padding: 4rem 0;
    background-color: var(--bg-card);
}

.schedule-container {
    background-color: var(--bg-section-alt);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.schedule-container #search-container {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid var(--border-light);
}

.schedule-container #bairro-select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid var(--border-light);
    font-size: 1rem;
}

.schedule-container #search-result {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    text-align: left;
    transition: background-color 0.3s ease;
}

td {
    padding: 1rem;
    border: 1px solid var(--border-light);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Estilo para a coluna destacada */
th.highlight-day {
    background-color: var(--secondary);
    color: #333;
}

td.highlight-day {
    background-color: #fffbeb; /* Um amarelo bem claro */
    border-color: var(--secondary);
}

.schedule-container td {
    padding: 0;
    vertical-align: top;
}

.schedule-container ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.schedule-container li {
    padding: 0.75rem 1rem;
}

.schedule-container li:nth-child(even) {
    background-color: #f7f7f7;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background-color: var(--bg-section-alt);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.faq-item {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-light);

    /* Propriedades para animação de entrada */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.faq-question:hover {
    background-color: rgba(0,0,0,0.02);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease;
    background-color: #fafafa;
    padding: 0 1.5rem;
}

.faq-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Estilos para o estado "aberto" do FAQ */
.faq-item.active .faq-answer {
    max-height: 500px; /* Um valor alto o suficiente para qualquer resposta */
    padding: 1.5rem;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

body.dark-mode .faq-question:hover { background-color: rgba(255,255,255,0.05); }
body.dark-mode .faq-answer { background-color: var(--bg-section-alt); }
body.dark-mode .schedule-container li:nth-child(even) { background-color: var(--bg-card); }
body.dark-mode td.highlight-day { background-color: #423c2b; }


/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 3rem 0 1.5rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    flex: 1 1 300px;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-section h3::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    color: white;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--secondary);
}

.copyright {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.fa, .fas, .fab {
    -webkit-font-smoothing: antialiased;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--secondary);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    text-decoration: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover { background-color: var(--primary); }

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    th, td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .waste-types, .schedule {
        padding: 2rem 0;
    }
    
    .card {
        flex: 1 1 100%;
    }
}
