/* --- VARIABLES & SETUP (TEMA LIGHT PREMIUM) --- */
:root {
    --py-blue: #0038A8;      /* Azul Paraguay Institucional */
    --py-dark-blue: #001b52; /* Azul Muy Oscuro para Textos */
    --py-red: #D52B1E;       /* Rojo Paraguay */
    
    --bg-body: #f4f6f9;      /* Blanco "Premium" */
    --bg-white: #ffffff;     /* Blanco Puro */
    
    --shadow-soft: 0 10px 40px rgba(0, 56, 168, 0.08);
    --shadow-hover: 0 20px 50px rgba(0, 56, 168, 0.15);
    
    --text-main: #333333;
    --text-light: #666666;
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: var(--py-dark-blue);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-red { color: var(--py-red); }
.text-blue { color: var(--py-blue); }

/* --- BOTONES --- */
.btn {
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary {
    background: var(--py-red);
    color: white;
    box-shadow: 0 10px 20px rgba(213, 43, 30, 0.3);
}
.btn-primary:hover { transform: translateY(-3px); background: #b31f14; }

.btn-outline {
    border: 2px solid var(--py-blue);
    color: var(--py-blue);
    background: transparent;
}
.btn-outline:hover { background: var(--py-blue); color: white; }

/* --- HEADER --- */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
    padding: 15px 0;
    transition: 0.3s;
}

nav { display: flex; justify-content: space-between; align-items: center; }

.logo-container img {
    max-height: 50px; /* Ajustado para móvil */
    width: auto;
    display: block;
}

.nav-links { display: flex; gap: 30px; list-style: none;}
.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.3s;
}
.nav-links a:hover { color: var(--py-red); }

/* Botón Hamburguesa (Oculto en PC) */
.burger-menu {
    display: none;
    font-size: 1.5rem;
    color: var(--py-blue);
    cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
    padding: 150px 0 100px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(to right, rgba(255, 255, 255, 0.85) 30%, rgba(255, 255, 255, 0.7) 100%),
        url('img/fondo_hero.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-content { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }
.hero-text h1 { font-size: 3.2rem; line-height: 1.15; margin-bottom: 25px; color: var(--py-dark-blue); }
.hero-text p { font-size: 1.2rem; color: var(--text-light); margin-bottom: 40px; }

.hero-visual { position: relative; z-index: 2; }
.app-mockup {
    background: white;
    border-radius: 15px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
    transition: transform 0.5s;
}

/* --- STATS BAR --- */
.stats-bar {
    background: white;
    padding: 40px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.stats-grid { display: flex; justify-content: space-around; text-align: center; flex-wrap: wrap; gap: 20px; }
.stat-item h3 { font-size: 2.5rem; color: var(--py-blue); margin-bottom: 5px; }
.stat-item p { font-size: 0.9rem; color: #888; text-transform: uppercase; font-weight: 600; }

/* --- CARDS BLANCAS --- */
.white-card {
    background: var(--bg-white);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.03);
    transition: 0.4s;
}
.white-card i { font-size: 2.5rem; color: var(--py-red); margin-bottom: 20px; }
.white-card h3 { margin-bottom: 15px; font-size: 1.4rem; }
.white-card p { color: var(--text-light); line-height: 1.6; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 50px; }

/* --- SECCION ROLES (GRID) --- */
.roles-section {
    background: var(--py-dark-blue);
    color: white;
    padding: 100px 0;
    margin-top: 80px;
}
.roles-section h2, .roles-section h4 { color: white; }
.roles-grid-layout {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 60px; 
    align-items: center;
}

/* --- ANIMACIÓN JERARQUÍA --- */
.hierarchy-visual {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    /* Importante para que no se salga */
    overflow: hidden; 
}
.hierarchy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    /* Transition suave para resize */
    transition: transform 0.3s ease; 
}

/* Elementos de la Jerarquía */
.node {
    background: #e0e0e0; border-radius: 12px; position: relative;
    opacity: 0; transform: scale(0);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.admin-node { width: 60px; height: 60px; display: grid; place-items: center; color: var(--py-red); font-size: 1.5rem; z-index: 2; background: #fff;}
.concejal-node { width: 50px; height: 50px; background: #d0d0d0; z-index: 2;}
.dirigente-node { width: 35px; height: 35px; background: #c0c0c0; border-radius: 8px; }

.level { display: flex; justify-content: center; gap: 80px; width: 100%; }
.level-3 { gap: 80px; }
.dirigente-group { display: flex; gap: 15px; }

/* Líneas y Animaciones */
.lines { width: 100%; display: flex; flex-direction: column; align-items: center; margin-top: -5px; margin-bottom: -5px;}
.line-group { display: flex; flex-direction: column; align-items: center; width: 50%; }
.line-vertical, .line-horizontal, .line-vertical-split span, .line-horizontal-small, .line-vertical-split-small span {
    background: rgba(255,255,255,0.3); opacity: 0;
    animation: drawLine 0.5s ease-out forwards;
}
.line-vertical { width: 4px; height: 30px; }
.line-horizontal { width: 134px; height: 4px; }
.line-vertical-split { display: flex; justify-content: space-between; width: 134px; }
.line-vertical-split span { width: 4px; height: 20px; }
.line-horizontal-small { width: 54px; height: 4px; }
.line-vertical-split-small { display: flex; justify-content: space-between; width: 54px; }
.line-vertical-split-small span { width: 4px; height: 20px; }

/* Delays */
.admin-node { animation-delay: 0.2s; }
.lines-1 .line-vertical { animation-delay: 0.8s; height: 0; animation-name: growDown; }
.lines-1 .line-horizontal { animation-delay: 1.3s; width: 0; animation-name: growWide; }
.lines-1 .line-vertical-split span { animation-delay: 1.8s; height: 0; animation-name: growDown20; }
.concejal-node { animation-delay: 2.3s; }
.lines-2 .line-vertical { animation-delay: 2.8s; height: 0; animation-name: growDown; }
.lines-2 .line-horizontal-small { animation-delay: 3.1s; width: 0; animation-name: growWide; }
.lines-2 .line-vertical-split-small span { animation-delay: 3.4s; height: 0; animation-name: growDown20; }
.dirigente-node { animation-delay: 3.8s; }

@keyframes popIn { 0% { opacity: 0; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } }
@keyframes drawLine { to { opacity: 1; } }
@keyframes growDown { from { height: 0; opacity: 1; } to { height: 30px; opacity: 1; } }
@keyframes growWide { from { width: 0; opacity: 1; } to { width: 100%; opacity: 1; } }
@keyframes growDown20 { from { height: 0; opacity: 1; } to { height: 20px; opacity: 1; } }

/* --- AGENCIA --- */
.agency-section { padding: 100px 0; }
.agency-box {
    background: white; border-radius: 30px; padding: 60px;
    box-shadow: var(--shadow-soft);
    display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center;
}
.check-list li { margin-bottom: 15px; display: flex; align-items: center; font-size: 1.1rem; color: var(--text-main); }
.check-list i { color: var(--py-blue); margin-right: 15px; font-size: 1.2rem; }

/* --- CTA --- */
.cta-box {
    background: linear-gradient(135deg, var(--py-blue) 0%, #002366 100%);
    border-radius: 20px; padding: 80px 20px;
    text-align: center; color: white; position: relative; overflow: hidden;
}
.cta-box h2 { color: white; font-size: 2.5rem; margin-bottom: 20px; }

/* --- FOOTER --- */
footer {
    background: #111; color: #888; padding: 60px 0 20px; margin-top: 80px; font-size: 0.9rem;
}
.footer-logo img { max-height: 75px; margin-bottom: 20px; opacity: 0.8; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: white; margin-bottom: 20px; font-size: 1.1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #888; text-decoration: none; }

/* --- WHATSAPP --- */
.whatsapp-float {
    position: fixed; width: 60px; height: 60px; bottom: 40px; right: 40px;
    background-color: #25d366; color: #FFF; border-radius: 50px;
    text-align: center; font-size: 30px; box-shadow: 2px 2px 3px #999;
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: 0.3s; animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE FIXES)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Header & Menu Hamburguesa */
    .burger-menu { display: block; } /* Mostrar icono */
    
    .nav-links {
        position: fixed;
        right: -100%; /* Oculto a la derecha */
        top: 80px; /* Debajo del header */
        height: calc(100vh - 80px);
        background-color: white;
        flex-direction: column;
        width: 100%;
        text-align: center;
        padding-top: 40px;
        transition: 0.4s ease;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        gap: 40px;
    }

    .nav-links.active {
        right: 0; /* Aparece */
    }

    /* 2. Textos Hero */
    .hero { padding-top: 120px; }
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-text h1 { font-size: 2.2rem; }
    .hero-visual { display: none; } /* Ocultar mockup en mobile para limpiar vista */

    /* 3. Agencia */
    .agency-box { grid-template-columns: 1fr; padding: 30px; }
    
    /* 4. ARREGLO JERARQUÍA (IMG_0629.jpg) */
    .roles-grid-layout {
        grid-template-columns: 1fr; /* Columna única */
        gap: 40px;
    }
    
    /* Escalamos el gráfico para que quepa en pantalla pequeña */
    .hierarchy-visual {
        padding: 10px;
        min-height: 250px;
    }
    .hierarchy-container {
        transform: scale(0.65); /* Reducir al 65% del tamaño */
        transform-origin: center;
        margin-top: -20px;
        margin-bottom: -20px;
    }

    /* 5. Whatsapp Button */
    .whatsapp-float { width: 50px; height: 50px; font-size: 24px; bottom: 20px; right: 20px; }
}