/* ── CONTENEDOR PRINCIPAL ─────────────────────────────────────────────────── */
.main-footer {
    position: relative;
    /* Fondo oscuro profundo como base */
    background-color: #080f1e;
    color: var(--white);
    overflow: hidden;
}

/* Destello esmeralda principal — desde el centro superior, como luz de ambiente */
.main-footer::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    height: 340px;
    background: radial-gradient(
        ellipse at top,
        rgba(16, 185, 129, 0.18) 0%,
        rgba(5, 150, 105, 0.08)  40%,
        transparent              70%
    );
    pointer-events: none;
    z-index: 0;
}

/* Segundo destello — esquina inferior izquierda, muy sutil, da profundidad */
.main-footer::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -5%;
    width: 40%;
    height: 220px;
    background: radial-gradient(
        ellipse at bottom left,
        rgba(16, 185, 129, 0.07) 0%,
        transparent              65%
    );
    pointer-events: none;
    z-index: 0;
}

/* ── GRID DE COLUMNAS ─────────────────────────────────────────────────────── */

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.2fr;
    gap: var(--space-12);
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
    position: relative;
    z-index: 1;
}

.footer-grid-general {
    grid-template-columns: 1.2fr 0.8fr 1fr 1.5fr;
}

/* ── BRANDING (Columna 1) ─────────────────────────────────────────────────── */
.branding .logo-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: var(--space-6);
}

.logo-img-footer {
    height: 4.5rem;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    transition: transform var(--transition-slow), filter var(--transition-slow);
}

.branding .logo-wrapper:hover .logo-img-footer {
    transform: scale(1.06);
    filter: drop-shadow(0 0 14px rgba(52, 211, 153, 0.35));
}

.branding .inst-name {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.branding .inst-sub {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--emerald-400);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-top: 0.25rem;
}

.footer-description {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--slate-400);
    max-width: 320px;
    margin-bottom: var(--space-8);
    text-align: left;
}

/* ── REDES SOCIALES — Círculos sin etiqueta ───────────────────────────────── */
.social-links {
    display: flex;
    gap: 1.25rem;
    margin-top: var(--space-6);
    align-items: center;
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-decoration: none;
    position: relative;
}

/* Ocultar la etiqueta de texto (FB / ME) sin tocar el HTML */
.inst-name-log {
    display: none;
}

.social-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    overflow: hidden;
    /* Sin padding — la imagen llenará el círculo completo */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.15),
        0 4px 14px rgba(0, 0, 0, 0.5),
        0 2px 6px  rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.9);
    background-color: #ffffff;
    transition:
        transform    0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow   var(--transition-slow),
        border-color var(--transition-slow);
    position: relative;
}

.social-icon img {
    width: 100%;
    height: 100%;
    /* contain: la imagen escala manteniendo proporciones sin recortarse */
    object-fit: contain;
    object-position: center;
    padding: 3px; /* Reducido para que el logo se vea más grande en su contenedor */
    display: block;
    transition: transform var(--transition-slow);
    /* Mejora de renderizado para imágenes pequeñas */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Hover: salta con halo esmeralda */
.social-item:hover .social-icon {
    transform: translateY(-7px);
    border-color: var(--emerald-300);
    box-shadow:
        0 0 0 2px rgba(52, 211, 153, 0.5),
        0 18px 32px rgba(16, 185, 129, 0.35),
        0 8px 16px  rgba(0, 0, 0, 0.45);
}

.social-item:hover .social-icon img {
    transform: scale(1.1);
}


/* ── TÍTULOS DE SECCIÓN (Gestión / Contacto) ──────────────────────────────── */
.footer-title,
.footer-column h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--emerald-400);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid rgba(52, 211, 153, 0.15);
    position: relative;
    display: block;
}

/* Acento corto debajo del título */
.footer-title::after,
.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--emerald-500);
    border-radius: var(--radius-full);
    transition: width 0.4s var(--transition-bounce);
}

.footer-column:hover .footer-title::after,
.footer-column:hover h4::after {
    width: 56px;
}

/* ── LISTA DE GESTIÓN — Texto limpio + chevron ────────────────────────────── */
.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 0.65rem;
}

.footer-links-list a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--slate-300);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
    transition: color var(--transition-slow), transform var(--transition-slow);
}

/* Icono chevron (ya está en el HTML vía FontAwesome) */
.footer-links-list a .fa-chevron-right,
.footer-links-list a i {
    font-size: 0.65rem;
    color: var(--emerald-600);
    transition: color var(--transition-slow), transform var(--transition-slow);
    flex-shrink: 0;
}

.footer-links-list a:hover {
    color: var(--white);
    transform: translateX(3px);
}

.footer-links-list a:hover i {
    color: var(--emerald-400);
    transform: translateX(2px);
}

/* ── INFORMACIÓN DE CONTACTO ──────────────────────────────────────────────── */
.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    color: var(--slate-300);
    font-size: 0.9rem;
    line-height: 1.6;
    transition: color var(--transition-slow);
}

.contact-info li:hover {
    color: var(--white);
}

/* Caja del emoji */
.contact-info li span:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    transition:
        background      var(--transition-slow),
        border-color    var(--transition-slow),
        transform       0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-info li:hover span:first-child {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.3);
    transform: scale(1.1);
}

/* ── FRANJA INFERIOR ──────────────────────────────────────────────────────── */
.footer-bottom {
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.4rem 0;
    font-size: 0.875rem;
    color: var(--slate-400);
}

.bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright-text {
    margin: 0;
    color: var(--slate-400);
}

.legal-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legal-links a {
    color: var(--slate-400);
    text-decoration: none;
    transition: color var(--transition-slow);
}

.legal-links a:hover {
    color: var(--emerald-400);
}

.legal-dot {
    width: 3px;
    height: 3px;
    background-color: var(--slate-600);
    border-radius: var(--radius-full);
    display: inline-block;
}

/* ── CRÉDITOS DE DESARROLLADOR ────────────────────────────────────────────── */
.dev-credit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--slate-500);
}

.dev-credit strong {
    color: var(--slate-300);
    font-weight: 600;
}

.dev-link {
    color: var(--emerald-500);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-slow);
}

.dev-link:hover {
    color: var(--emerald-300);
}

.dev-separator {
    color: var(--slate-700);
}

.dev-version {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-md);
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .footer-grid, .footer-grid-general {
        grid-template-columns: 1fr !important;
        gap: var(--space-10) !important;
        padding-top: 5rem !important; /* Asegurar padding arriba del logo en pantallas chicas */
        text-align: center !important;
    }
    
    .branding {
        grid-column: 1 / -1 !important;
        margin-bottom: 1.5rem !important;
    }

    .footer-title::after {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .footer-description {
        max-width: 100% !important;
        text-align: center !important;
    }

    /* Centrar iconos sociales y logo */
    .branding .logo-wrapper, .social-links {
        justify-content: center !important;
    }

    /* Centrar bloque de contacto, pero que los íconos queden alineados a la izquierda entre sí */
    .contact-info {
        align-items: center !important;
    }
    
    .contact-info li {
        width: max-content !important;
        max-width: 100% !important;
        justify-content: flex-start !important; /* Mantiene el texto y el icono alineados a la izquierda */
        text-align: left !important;
    }

    /* Franja inferior (créditos y legales) */
    .footer-bottom {
        margin-top: 2rem !important; /* Separación extra entre contacto y footer-bottom */
    }

    .bottom-flex {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }
}
