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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== ANIMACIONES GLOBALES ===== */
@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 slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

/* ===== HEADER TOP BAR ===== */
.header-top {
    background: var(--secondary-color);
    color: var(--text-color);
    padding: 8px 0;
    font-size: 0.85rem;
    position: relative;
    z-index: 1001;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.header-top .contact-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-top .contact-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.header-top .contact-info span:hover {
    transform: translateX(3px);
}

.header-top .contact-info i {
    font-size: 0.85rem;
    opacity: 0.9;
}

.header-top .social-links {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.header-top .social-links a {
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.2);
}

.header-top .social-links a:hover {
    transform: translateY(-2px);
    background: var(--primary-color);
    color: white;
}

/* ===== MAIN HEADER MEJORADO ===== */
.main-header {
    background: var(--bg-color);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    box-shadow: var(--shadow-medium);
    background: var(--bg-color);
}

.navbar {
    padding: 0.5rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: translateX(3px);
}

.navbar-brand .logo-container {
    flex-shrink: 0;
}

.navbar-brand img {
    max-height: 70px;
    width: auto;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.02);
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.navbar-brand .brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

/* ===== NAVEGACIÃ“N MEJORADA ===== */
.navbar-collapse {
    flex-grow: 0;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.navbar-nav .nav-item {
    list-style: none;
}

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
}

.navbar-nav .nav-link i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

/* Efecto hover */
.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background: rgba(39, 174, 96, 0.1);
    transform: translateY(-2px);
}

.navbar-nav .nav-link:hover i {
    transform: scale(1.1);
}

/* Enlace activo - BIEN MARCADO */
.navbar-nav .nav-link.active {
    color: white !important;
    background: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active i {
    color: white !important;
    transform: scale(1.05);
}

/* BotÃ³n especial de alcaldÃ­a */
.navbar-nav .nav-item:last-child .nav-link {
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.3);
    padding: 6px 12px;
}

.navbar-nav .nav-item:last-child .nav-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.navbar-nav .nav-item:last-child .nav-link.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color);
}

/* Navbar Toggler */
.navbar-toggler {
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(39, 174, 96, 0.1);
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(39, 174, 96, 0.2);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px var(--primary-color);
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2844, 62, 80, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== SECCIONES GENERALES ===== */
.section {
    animation: fadeInUp 0.6s ease-out;
    padding: 20px 0;
    color: var(--text-color);
    background: var(--bg-color);
}

/* Asegurar que todas las secciones tengan el color de fondo correcto */
section {
    background: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== FOOTER PROFESIONAL ===== */
footer {
    background: var(--bg_color);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    margin-top: 50px;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(128, 128, 128, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-brand {
    margin-bottom: 20px;
}

.footer-brand h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.footer-brand h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.footer-brand p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.7;
    margin-top: 15px;
    color: var(--text-color);
}

.footer-section {
    margin-bottom: 30px;
}

.footer-section h5 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 12px;
    letter-spacing: 0.5px;
}

.footer-section h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 45px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.footer-section:hover h5::after {
    width: 70px;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    padding: 8px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    color: var(--text-color);
}

.footer-contact-item:hover {
    transform: translateX(8px);
    background: rgba(128, 128, 128, 0.1);
    padding-left: 10px;
}

.footer-contact-item i {
    font-size: 1.2rem;
    margin-right: 15px;
    color: var(--primary-color);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.footer-contact-item:hover i {
    background: var(--primary-color);
    transform: scale(1.1);
    color: white;
}

.footer-contact-item span {
    font-size: 0.9rem;
    opacity: 0.9;
    flex: 1;
    color: var(--text-color);
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--primary-color);
    transform: translateY(-5px) rotate(360deg);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
    color: white;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(128, 128, 128, 0.3), rgba(128, 128, 128, 0.5), rgba(128, 128, 128, 0.3), transparent);
    margin: 35px 0 25px 0;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0 10px 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-bottom p {
    margin: 0;
    letter-spacing: 0.3px;
    color: var(--text-color);
}

.footer-bottom i {
    color: #ff4757;
    animation: pulse 1.5s infinite;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===== RESPONSIVE MEJORADO ===== */
@media (max-width: 1200px) {
    .navbar-nav .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .navbar-nav .nav-link i {
        font-size: 0.85rem;
    }
}

@media (max-width: 992px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        padding: 15px 20px;
        border-radius: 0 0 15px 15px;
        box-shadow: var(--shadow-medium);
        z-index: 999;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .navbar-nav .nav-link {
        justify-content: center;
        padding: 12px 20px;
        width: 100%;
        text-align: center;
    }
    
    .navbar-nav .nav-item:last-child .nav-link {
        width: auto;
        display: inline-flex;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .header-top .contact-info {
        justify-content: center;
        gap: 15px;
        margin-bottom: 8px;
    }
    
    .header-top .social-links {
        justify-content: center;
    }
    
    .navbar-brand img {
        max-height: 55px;
    }
    
    .navbar-brand .brand-title {
        font-size: 1rem;
    }
    
    .footer-brand h3 {
        font-size: 1.5rem;
    }
    
    .footer-section h5 {
        margin-top: 20px;
    }
}

@media (max-width: 576px) {
    .navbar-brand .brand-text {
        display: none;
    }
    
    .navbar-brand img {
        max-height: 50px;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.85rem;
        padding: 10px 16px;
    }
    
    .footer-social a {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

/* ===== UTILIDADES ADICIONALES ===== */
a {
    text-decoration: none;
    transition: all 0.3s ease;
}

section, .section {
    transition: all 0.3s ease;
}

.glass-effect {
    background: rgba(128, 128, 128, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(128, 128, 128, 0.2);
}

/* Forzar colores del tema en los men¨²s especiales */
#menu1.section,
#menu2.section {
    background: var(--bg-color) !important;
    color: var(--text-color) !important;
    min-height: 100vh;
    padding: 40px 20px;
}

/* Forzar todos los elementos dentro de los men¨²s a usar el color del tema */
#menu1 *,
#menu2 * {
    color: var(--text-color) !important;
}

/* Excepci¨®n para los enlaces (que mantengan su color primario al hacer hover) */
#menu1 a,
#menu2 a {
    color: var(--primary-color) !important;
}

#menu1 a:hover,
#menu2 a:hover {
    color: var(--secondary-color) !important;
    text-decoration: underline;
}

/* Forzar fondos de elementos que puedan venir con fondo blanco */
#menu1 div, #menu1 section, #menu1 article,
#menu2 div, #menu2 section, #menu2 article {
    background: transparent !important;
}

/* Si hay tablas, tarjetas o contenedores con fondo blanco */
#menu1 .card, #menu1 .table, #menu1 .panel,
#menu2 .card, #menu2 .table, #menu2 .panel {
    background: var(--bg-color) !important;
    border-color: rgba(128, 128, 128, 0.2) !important;
}

/* Forzar color en t¨ªtulos y p¨¢rrafos */
#menu1 h1, #menu1 h2, #menu1 h3, #menu1 h4, #menu1 h5, #menu1 h6,
#menu1 p, #menu1 span, #menu1 li, #menu1 div,
#menu2 h1, #menu2 h2, #menu2 h3, #menu2 h4, #menu2 h5, #menu2 h6,
#menu2 p, #menu2 span, #menu2 li, #menu2 div {
    color: var(--text-color) !important;
}

/* Mantener el color blanco para fondos oscuros en elementos espec¨ªficos */
#menu1 .text-white, #menu2 .text-white,
#menu1 .bg-dark, #menu2 .bg-dark {
    color: white !important;
}