/* ===========================
   CSS FINAL - V3 (Animação do Menu Corrigida)
   =========================== */

/* ===========================
   ESTILOS GERAIS E BASE
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


/* ===========================
   BARRA DE NAVEGAÇÃO
   =========================== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 70px;
}

.nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.nav-list a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-list a:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ===========================
   MENU MOBILE
   =========================== */
.menu-toggle {
    display: none;
}

@media (max-width: 850px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between; /* Alterado para space-between */
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1010;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        /* Adicionado para conter as linhas durante a animação */
        -webkit-transform-style: preserve-3d;
		transform-style: preserve-3d;
    }

    .hamburger-line {
        width: 30px;
        height: 3px;
        background-color: #333;
        border-radius: 10px;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
        transform-origin: center; /* Garante que a rotação aconteça no centro da linha */
    }

    /* ANIMAÇÃO CORRIGIDA - ROTAÇÃO NO LUGAR */
    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg); /* Move para o centro e gira */
    }

    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0; /* A linha do meio some */
    }

    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
       transform: translateY(-10.5px) rotate(-45deg); /* Move para o centro e gira */
    }
    
    .nav-list {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, #667eea, #764ba2);
        z-index: 1005; 
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity 0.35s ease-in-out, visibility 0.35s ease-in-out, transform 0.35s ease-in-out;
    }

    .nav-list[data-visible="true"] {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-list a {
        color: white;
        font-size: 1.5rem;
        font-weight: 500;
        opacity: 0.9;
    }
    
    .nav-list a:hover {
        opacity: 1;
        transform: scale(1.1);
        background: none;
        box-shadow: none;
    }
}

/* ===========================
   ESTILOS GERAIS DAS SEÇÕES
   =========================== */

.hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 100px 0; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>'); animation: float 20s ease-in-out infinite; }
.hero-title { font-size: 3.5rem; font-weight: 700; margin-bottom: 1rem; animation: fadeInUp 1s ease-out; position: relative; z-index: 2; }
.hero-subtitle { font-size: 1.5rem; font-weight: 300; opacity: 0.9; animation: fadeInUp 1s ease-out 0.2s both; position: relative; z-index: 2; }
.section { padding: 80px 0; position: relative; }
.bg-light { background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%); }
.section-title { font-size: 2.5rem; font-weight: 600; text-align: center; margin-bottom: 3rem; color: #2d3748; position: relative; animation: fadeInUp 0.8s ease-out; }
.section-title::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 60px; height: 4px; background: linear-gradient(90deg, #667eea, #764ba2); border-radius: 2px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; animation: slideInLeft 0.8s ease-out; }
.text-content p { font-size: 1.1rem; margin-bottom: 2rem; color: #4a5568; line-height: 1.8; }
.project-info { background: white; padding: 2rem; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid rgba(102, 126, 234, 0.1); }
.info-item { display: flex; margin-bottom: 1rem; padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0; }
.info-item:last-child { border-bottom: none; margin-bottom: 0; }
.info-item strong { color: #667eea; min-width: 100px; margin-right: 1rem; }
.responsive-img { width: 100%; height: auto; border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); transition: transform 0.3s ease; }
.responsive-img:hover { transform: scale(1.05); }

/* =========================================================
   TIMELINE COM CORREÇÃO FINAL DE RENDERIZAÇÃO
   ========================================================= */
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #667eea, #764ba2); border-radius: 2px; transform: translateX(-50%); z-index: 0; }
.timeline-item { 
    position: relative; 
    margin-bottom: 4rem; 
    animation: fadeInUp 0.8s ease-out;
    transform: translateZ(0);
}
.timeline-item:nth-child(odd) .timeline-content { margin-right: 60%; text-align: right; }
.timeline-item:nth-child(even) .timeline-content { margin-left: 60%; text-align: left; }
.timeline-marker { position: absolute; left: 50%; top: 0; width: 40px; height: 40px; background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; transform: translateX(-50%); box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3); z-index: 2; }
.timeline-content { 
    background: white; 
    padding: 2rem; 
    border-radius: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
    border: 1px solid rgba(102, 126, 234, 0.1); 
    transition: transform 0.3s ease; 
    position: relative; 
    z-index: 1;
}
.timeline-content:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.timeline-content h3 { color: #667eea; margin-bottom: 1rem; font-size: 1.3rem; }
.timeline-img { width: 100%; height: 200px; object-fit: cover; border-radius: 15px; margin-top: 1rem; }

@media (max-width: 768px) { 
    .timeline::before { left: 20px; } 
    .timeline-marker { left: 20px; } 
    .timeline-item:nth-child(odd) .timeline-content, 
    .timeline-item:nth-child(even) .timeline-content { 
        margin-left: 60px; 
        margin-right: 0; 
        text-align: left; 
    } 
}
/* ========================================================= */

.test-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-top: 2rem; }
.test-card { background: white; padding: 2rem; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid rgba(102, 126, 234, 0.1); transition: all 0.3s ease; animation: fadeInUp 0.8s ease-out; }
.test-card:hover { transform: translateY(-10px); box-shadow: 0 25px 50px rgba(0,0,0,0.15); }
.test-card h3 { color: #667eea; margin-bottom: 1rem; font-size: 1.3rem; }
.test-img { width: 100%; height: 200px; object-fit: cover; border-radius: 15px; margin-top: 1rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.gallery-item { position: relative; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); transition: transform 0.3s ease; animation: fadeInUp 0.8s ease-out; }
.gallery-item:hover { transform: scale(1.05); }
.gallery-img { width: 100%; height: 250px; object-fit: cover; transition: transform 0.3s ease; }
.gallery-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.8)); color: white; padding: 2rem 1rem 1rem; transform: translateY(100%); transition: transform 0.3s ease; }
.gallery-item:hover .gallery-overlay { transform: translateY(0); }
.gallery-item:hover .gallery-img { transform: scale(1.1); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-top: 2rem; }
.video-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid rgba(102, 126, 234, 0.1); transition: transform 0.3s ease; animation: fadeInUp 0.8s ease-out; }
.video-card:hover { transform: translateY(-10px); box-shadow: 0 25px 50px rgba(0,0,0,0.15); }
.video-placeholder { height: 200px; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; position: relative; cursor: pointer; }
.play-button { width: 60px; height: 60px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; transition: all 0.3s ease; }
.video-placeholder:hover .play-button { background: rgba(255,255,255,0.3); transform: scale(1.1); }
.video-card h3 { padding: 1rem; color: #667eea; margin-bottom: 0.5rem; }
.video-card p { padding: 0 1rem 1rem; color: #4a5568; }
.results-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-top: 2rem; }
.result-card { background: white; padding: 2rem; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid rgba(102, 126, 234, 0.1); transition: transform 0.3s ease; animation: fadeInUp 0.8s ease-out; }
.result-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.result-card h3 { color: #667eea; margin-bottom: 1rem; font-size: 1.3rem; }
.result-card ul { list-style: none; padding-left: 0; }
.result-card li { padding: 0.5rem 0; position: relative; padding-left: 1.5rem; }
.result-card li::before { content: '✓'; position: absolute; left: 0; color: #667eea; font-weight: bold; }
.footer { background: #2d3748; color: white; text-align: center; padding: 2rem 0; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-20px); } }
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.animate-on-scroll.animated { opacity: 1; transform: translateY(0); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #667eea, #764ba2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #5a67d8, #6b46c1); }
#saneamento .content-grid, #análise .content-grid, #proposta .content-grid, #observações .content-grid { grid-template-columns: 1fr !important; justify-items: center; }
#saneamento .text-content, #análise .text-content, #proposta .text-content, #observações .text-content { max-width: 700px; margin: 0 auto; }
#saneamento .text-content p, #análise .text-content p, #proposta .text-content p, #observações .text-content p { text-align: justify; }
#saneamento .project-info { margin: 0 auto; max-width: 400px; }
