/**
 * Estilos para Posts Sociales
 * Sistema de posts para compartir en redes sociales
 */

/* Contenedor principal de posts */
.social-posts-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: linear-gradient(135deg, #FFFFFF 0%, #EEF3FF 100%);
}

.social-posts-header {
    text-align: center;
    margin-bottom: 50px;
}

.social-posts-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #2C5AA0;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.social-posts-header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 500;
}

/* Grid de posts */
.social-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

@media (min-width: 768px) {
    .social-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (min-width: 1200px) {
    .social-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

/* Tarjeta de post */
.social-post-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #EEF3FF 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(44, 90, 160, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(44, 90, 160, 0.1);
    scroll-margin-top: 100px; /* Espacio para header sticky al hacer scroll */
    will-change: transform, opacity;
}

/* Animaciones mejoradas con scroll reveal */
.social-post-card.scroll-revealed {
    animation: cardRevealComplete 0.3s ease forwards;
}

@keyframes cardRevealComplete {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.05);
    }
    100% {
        filter: brightness(1);
    }
}

/* Efecto de brillo sutil al aparecer */
.social-post-card.scroll-reveal-complete {
    animation: subtleGlow 0.5s ease;
}

@keyframes subtleGlow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(44, 90, 160, 0.1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(44, 90, 160, 0.2);
    }
}

/* Mejoras adicionales para efecto portal moderno */
.social-post-card.scroll-reveal-item {
    backface-visibility: hidden;
    perspective: 1000px;
}

.social-post-card.scroll-revealed .social-post-image {
    animation: imageReveal 0.6s ease 0.2s both;
}

@keyframes imageReveal {
    from {
        transform: scale(1.1);
        opacity: 0.7;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hover effect para indicar que es clickeable */
.social-post-card:hover {
    cursor: pointer;
}

/* Evitar que los botones de compartir activen el click de la tarjeta */
.social-post-card .social-share-btn,
.social-post-card .social-share-btn *,
.social-post-card a {
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.social-post-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 12px 40px rgba(44, 90, 160, 0.2);
    background: linear-gradient(135deg, #FFFFFF 0%, #E8F0FF 100%);
}

/* Imagen del post */
.social-post-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Aspect ratio 4:3 */
    overflow: hidden;
    background: linear-gradient(135deg, #F0F0F0 0%, #E0E0E0 100%);
}

.social-post-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.social-post-card:hover .social-post-image {
    transform: scale(1.05);
}

/* Contenido del post */
.social-post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #FFFFFF 0%, #EEF3FF 100%);
}

.social-post-title {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: #2C5AA0;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 2.6em;
}

.social-post-description {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    overflow: visible;
    font-weight: 400;
    word-wrap: break-word;
    white-space: normal;
}

/* Botones de compartir */
.social-post-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #E0E0E0;
}

.social-share-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: #FFFFFF;
}

.social-share-btn i {
    font-size: 1.1rem;
}

/* Botón Facebook */
.social-share-btn.facebook {
    background: linear-gradient(135deg, #1877F2, #0D5FDB);
}

.social-share-btn.facebook:hover {
    background: linear-gradient(135deg, #0D5FDB, #1877F2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}

/* Botón Twitter/X */
.social-share-btn.twitter {
    background: linear-gradient(135deg, #1DA1F2, #0D8BD9);
}

.social-share-btn.twitter:hover {
    background: linear-gradient(135deg, #0D8BD9, #1DA1F2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.4);
}

/* Botón Instagram */
.social-share-btn.instagram {
    background: linear-gradient(135deg, #E4405F, #C13584, #833AB4);
}

.social-share-btn.instagram:hover {
    background: linear-gradient(135deg, #C13584, #E4405F);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 64, 95, 0.4);
}

/* Botón WhatsApp */
.social-share-btn.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.social-share-btn.whatsapp:hover {
    background: linear-gradient(135deg, #128C7E, #25D366);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Botón Copiar enlace */
.social-share-btn.copy-link {
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    color: #FFFFFF;
}

.social-share-btn.copy-link:hover {
    background: linear-gradient(135deg, #B8860B, #D4AF37);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* Estado de carga */
.social-posts-loading {
    text-align: center;
    padding: 60px 20px;
    color: #4a5568;
}

.social-posts-loading p {
    color: #4a5568;
    font-weight: 500;
}

.social-posts-loading i {
    font-size: 3rem;
    color: #D4AF37;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estado vacío */
.social-posts-empty {
    text-align: center;
    padding: 60px 20px;
    color: #4a5568;
}

.social-posts-empty i {
    font-size: 4rem;
    color: #D4AF37;
    margin-bottom: 20px;
    opacity: 0.5;
}

.social-posts-empty p {
    font-size: 1.2rem;
    margin: 0;
    color: #4a5568;
    font-weight: 500;
}

/* Notificación de copiado */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #25D366;
    color: #FFFFFF;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    animation: slideInRight 0.3s ease;
}

.copy-notification.show {
    display: flex;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 767px) {
    .social-posts-container {
        padding: 30px 15px;
    }
    
    .social-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .social-post-actions {
        flex-direction: column;
    }
    
    .social-share-btn {
        width: 100%;
    }
    
    /* Cambiar color de descripción a negro en móviles y tablets para mejor legibilidad */
    .social-post-description {
        color: #000000 !important;
        font-weight: 500;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Cambiar color de descripción a negro en tablets para mejor legibilidad */
    .social-post-description {
        color: #000000 !important;
        font-weight: 500;
    }
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .social-posts-container {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .social-post-card {
        background: #2d2d2d;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .social-post-title {
        color: #D4AF37;
    }
    
    .social-post-description {
        color: #ccc;
    }
    
    .social-posts-header h2 {
        color: #D4AF37;
    }
    
    .social-posts-header p {
        color: #4a5568;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .social-post-card,
    .social-post-image,
    .social-share-btn {
        transition: none;
    }
    
    .social-post-card:hover {
        transform: none;
    }
}

/* Mejoras de accesibilidad */
.social-share-btn:focus {
    outline: 3px solid #D4AF37;
    outline-offset: 2px;
}

.social-post-card:focus-within {
    outline: 3px solid #D4AF37;
    outline-offset: 4px;
}

