/* ===== REDES SOCIALES MODERNAS - CSS ===== */

/* Variables para redes sociales */
:root {
    --social-bg: #ffffff;
    --social-border: #e2e8f0;
    --social-hover: #f8fafc;
    --social-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --social-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --social-radius: 12px;
    --social-transition: all 0.2s ease;
}

/* Contenedor principal de redes sociales */
.social-links {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--social-bg);
    border: 1px solid var(--social-border);
    border-radius: var(--social-radius);
    box-shadow: var(--social-shadow);
}

/* Enlaces individuales */
.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: var(--social-radius);
    transition: var(--social-transition);
    position: relative;
    overflow: hidden;
    background: var(--social-hover);
    border: 1px solid var(--social-border);
    text-decoration: none;
    cursor: pointer;
}

/* Efecto de brillo sutil */
.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.social-links a:hover::before {
    transform: translateX(100%);
}

/* Imágenes de redes sociales */
.social-links a img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: var(--social-transition);
    z-index: 1;
    filter: grayscale(0.2); /* Solo un toque de gris, nunca brillo/invert */
}

/* Efectos hover generales */
.social-links a:hover {
    transform: translateY(-2px);
    box-shadow: var(--social-shadow-hover);
    border-color: transparent;
}

.social-links a:hover img {
    transform: scale(1.1);
    filter: none; /* Mostrar logo a color en hover */
}

/* ===== COLORES ESPECÍFICOS POR RED SOCIAL ===== */

/* Facebook */
.social-links a[href*="facebook"]:hover {
    background: linear-gradient(135deg, #1877f2, #42a5f5);
    box-shadow: 0 10px 25px rgba(24, 119, 242, 0.25);
}

.social-links a[href*="facebook"]:hover img {
    filter: none;
}

/* Instagram */
.social-links a[href*="instagram"]:hover {
    background: linear-gradient(135deg, #e4405f, #fd1d1d, #fcb045);
    box-shadow: 0 10px 25px rgba(228, 64, 95, 0.25);
}

.social-links a[href*="instagram"]:hover img {
    filter: none;
}

/* Twitter/X */
.social-links a[href*="twitter"]:hover,
.social-links a[href*="x.com"]:hover {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
    box-shadow: 0 10px 25px rgba(29, 161, 242, 0.25);
}

.social-links a[href*="twitter"]:hover img,
.social-links a[href*="x.com"]:hover img {
    filter: none;
}

/* YouTube */
.social-links a[href*="youtube"]:hover {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.25);
}

.social-links a[href*="youtube"]:hover img {
    filter: none;
}

/* TikTok */
.social-links a[href*="tiktok"]:hover {
    background: linear-gradient(135deg, #000000, #ff0050);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.social-links a[href*="tiktok"]:hover img {
    filter: none;
}

/* Reddit */
.social-links a[href*="reddit"]:hover {
    background: linear-gradient(135deg, #ff4500, #ff6500);
    box-shadow: 0 10px 25px rgba(255, 69, 0, 0.25);
}

.social-links a[href*="reddit"]:hover img {
    filter: none;
}

/* Pinterest */
.social-links a[href*="pinterest"]:hover {
    background: linear-gradient(135deg, #bd081c, #e60023);
    box-shadow: 0 10px 25px rgba(189, 8, 28, 0.25);
}

.social-links a[href*="pinterest"]:hover img {
    filter: none;
}

/* WhatsApp */
.social-links a[href*="whatsapp"]:hover,
.social-links a[href*="wa.me"]:hover {
    background: linear-gradient(135deg, #25d366, #128c7e);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.25);
}

.social-links a[href*="whatsapp"]:hover img,
.social-links a[href*="wa.me"]:hover img {
    filter: none;
}

/* Telegram */
.social-links a[href*="telegram"]:hover,
.social-links a[href*="t.me"]:hover {
    background: linear-gradient(135deg, #0088cc, #0066aa);
    box-shadow: 0 10px 25px rgba(0, 136, 204, 0.25);
}

.social-links a[href*="telegram"]:hover img,
.social-links a[href*="t.me"]:hover img {
    filter: none;
}

/* Linktree */
.social-links a[href*="linktr.ee"]:hover {
    background: linear-gradient(135deg, #39e09b, #2dd4bf);
    box-shadow: 0 10px 25px rgba(57, 224, 155, 0.25);
}

.social-links a[href*="linktr.ee"]:hover img {
    filter: none;
}

/* ===== VARIANTES DE DISEÑO ===== */

/* Variante compacta */
.social-links.compact {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 320px;
    padding: 1.5rem;
}

.social-links.compact a {
    width: 40px;
    height: 40px;
}

.social-links.compact a img {
    width: 24px;
    height: 24px;
}

/* Variante horizontal */
.social-links.horizontal {
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: 1fr;
    max-width: 600px;
    gap: 0.75rem;
}

/* Variante vertical */
.social-links.vertical {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(10, 1fr);
    max-width: 80px;
    gap: 0.75rem;
}

/* Variante para footer */
.social-links.footer {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 1rem 0;
    margin: 1rem auto;
}

.social-links.footer a {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.social-links.footer a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets */
@media (max-width: 1024px) {
    .social-links {
        max-width: 350px;
        gap: 0.875rem;
        padding: 1.75rem;
    }
    
    .social-links a {
        width: 45px;
        height: 45px;
    }
    
    .social-links a img {
        width: 26px;
        height: 26px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .social-links {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 0.75rem;
        max-width: 300px;
        padding: 1.5rem;
    }
    
    .social-links a {
        width: 40px;
        height: 40px;
    }
    
    .social-links a img {
        width: 22px;
        height: 22px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .social-links {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 0.5rem;
        max-width: 200px;
        padding: 1rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        border-radius: 8px;
    }
    
    .social-links a img {
        width: 20px;
        height: 20px;
    }
    
    /* Horizontal en móviles pequeños */
    .social-links.horizontal {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(2, 1fr);
        max-width: 250px;
    }
}

/* ===== ANIMACIONES ===== */

/* Animación de entrada */
@keyframes socialFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.social-links a {
    animation: socialFadeIn 0.6s ease forwards;
    opacity: 0;
}

/* Delays escalonados para efecto cascada */
.social-links a:nth-child(1) { animation-delay: 0.1s; }
.social-links a:nth-child(2) { animation-delay: 0.15s; }
.social-links a:nth-child(3) { animation-delay: 0.2s; }
.social-links a:nth-child(4) { animation-delay: 0.25s; }
.social-links a:nth-child(5) { animation-delay: 0.3s; }
.social-links a:nth-child(6) { animation-delay: 0.35s; }
.social-links a:nth-child(7) { animation-delay: 0.4s; }
.social-links a:nth-child(8) { animation-delay: 0.45s; }
.social-links a:nth-child(9) { animation-delay: 0.5s; }
.social-links a:nth-child(10) { animation-delay: 0.55s; }

/* Animación de pulso sutil */
@keyframes subtlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.social-links a:hover {
    animation: subtlePulse 2s ease-in-out infinite;
}

/* ===== ACCESIBILIDAD ===== */

/* Focus para navegación por teclado */
.social-links a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    transform: translateY(-2px);
}

/* Reducir animaciones para usuarios que las prefieren reducidas */
@media (prefers-reduced-motion: reduce) {
    .social-links a {
        animation: none;
        transition: none;
    }
    
    .social-links a:hover {
        animation: none;
        transform: none;
    }
}

/* ===== MODO OSCURO ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --social-bg: #1e293b;
        --social-border: #334155;
        --social-hover: #334155;
    }
    .social-links a img {
        filter: grayscale(0.3) brightness(0.9); /* Solo un toque de gris, nunca brillo/invert */
    }
    .social-links a:hover img {
        filter: none; /* Mostrar logo a color en hover en modo oscuro */
    }
}

/* ===== UTILIDADES ===== */

/* Ocultar en impresión */
@media print {
    .social-links {
        display: none;
    }
}

/* Centrado perfecto */
.social-links.center {
    margin-left: auto;
    margin-right: auto;
}

/* Sin margen */
.social-links.no-margin {
    margin: 0;
}

/* Espaciado extra */
.social-links.spaced {
    margin: 3rem auto;
}

/* ===== INTEGRACIÓN CON FOOTER ===== */
.footer .social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 1rem 0;
    margin: 1rem 0;
    max-width: none;
    grid-template-columns: none;
    grid-template-rows: none;
}

.footer .social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: visible; /* Permitir expansión visible */
}

/* Animación de expansión de color en hover */
.footer .social-links a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: background 0.3s, transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), width 0.5s, height 0.5s;
    z-index: 0;
    pointer-events: none;
}

.footer .social-links a:hover::before {
    background: rgba(255,255,255,0.7);
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%) scale(1.2);
}

.footer .social-links a:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px) scale(1.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.footer .social-links a img {
    width: 24px;
    height: 24px;
    filter: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}

.footer .social-links a:hover img {
    filter: none;
    transform: scale(1.18);
}

/* Colores específicos para footer en hover - Simplificado */
.footer .social-links a:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== EFECTOS ESPECIALES ===== */

/* Efecto de ondas al hacer clic */
.social-links a {
    position: relative;
    overflow: hidden;
}

.social-links a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.social-links a:active::after {
    width: 100px;
    height: 100px;
}

/* Tooltip simple */
.social-links a[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Footer: siempre mostrar logos a color */
.footer .social-links a img,
.footer .social-links a:hover img {
    filter: none !important;
}

/* Solo para la caja de contacto principal, NO para el footer */
.contact-info-col .social-links a img,
.contact-info-col .social-links a:hover img {
    filter: none !important;
}