/* =============================================
   NEWS.CSS - D4T Applications
   Ubicación: /assets/css/news.css
   Estilos para la sección de noticias/blog
   Cards modernas, filtros, newsletter
   ============================================= */

/* Sección Principal de Noticias */
#news {
    position: relative;
    padding: 100px 0;
    background: #0a0a0a;
    overflow: hidden;
}

/* Patrón geométrico de fondo */
#news::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(102, 126, 234, 0.03) 35px, rgba(102, 126, 234, 0.03) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(118, 75, 162, 0.03) 35px, rgba(118, 75, 162, 0.03) 70px);
    pointer-events: none;
}

/* Header de Noticias */
.news-header {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    z-index: 2;
}

.news-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.news-title span {
    position: relative;
    z-index: 2;
}

.news-title::before {
    content: 'BLOG';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6rem;
    font-weight: 800;
    color: rgba(102, 126, 234, 0.05);
    z-index: 1;
}

.news-subtitle {
    font-size: 1.3rem;
    color: #a8a8b3;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Filtros de Categorías */
.news-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
    flex-wrap: wrap;
    position: relative;
    z-index: 3;
}

.category-btn {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #a8a8b3;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn:hover {
    color: #ffffff;
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

.category-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

/* Contador de categoría */
.category-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Grid de Noticias */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
    position: relative;
    z-index: 2;
}

/* Card de Noticia */
.news-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.news-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 30px 60px rgba(102, 126, 234, 0.2),
        0 40px 80px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.3);
}

.news-card:hover::before {
    opacity: 1;
}

/* Imagen de la noticia */
.news-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.1) rotate(2deg);
}

/* Badge de categoría */
.news-category {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 20px;
    background: rgba(102, 126, 234, 0.9);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

/* Fecha de publicación */
.news-date {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    color: #ffffff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.news-date i {
    font-size: 1rem;
}

/* Contenido de la noticia */
.news-content {
    padding: 30px;
    position: relative;
    z-index: 2;
}

.news-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.news-card:hover .news-card-title {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-excerpt {
    color: #a8a8b3;
    line-height: 1.8;
    margin-bottom: 25px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta información */
.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.news-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(102, 126, 234, 0.5);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.read-time {
    color: #667eea;
    font-size: 0.85rem;
}

/* Botón leer más */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more i {
    transition: transform 0.3s ease;
}

.news-card:hover .read-more {
    color: #764ba2;
}

.news-card:hover .read-more i {
    transform: translateX(5px);
}

/* Noticia destacada */
.featured-news {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.featured-news .news-image {
    height: 400px;
}

.featured-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 25px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    color: #ffffff;
    border-radius: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.4);
    animation: pulseBadge 2s ease infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 60px;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.newsletter-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.newsletter-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ffffff;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.newsletter-title {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 700;
}

.newsletter-description {
    font-size: 1.2rem;
    color: #a8a8b3;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Formulario de Newsletter */
.newsletter-form {
    display: flex;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 18px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.newsletter-btn {
    padding: 18px 40px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.newsletter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.newsletter-btn:active {
    transform: translateY(-1px);
}

/* Tags de noticias */
.news-tags {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: #a8a8b3;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    color: #667eea;
    transform: translateY(-2px);
}

/* Paginación */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 60px;
}

.page-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a8a8b3;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    color: #667eea;
    transform: translateY(-3px);
}

.page-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn.disabled:hover {
    transform: none;
}

/* Loading skeleton para noticias */
.news-skeleton {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    animation: pulse 1.5s ease infinite;
}

.skeleton-image {
    height: 250px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
}

.skeleton-content {
    padding: 30px;
}

.skeleton-title {
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-text:last-child {
    width: 80%;
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .featured-news {
        grid-column: span 1;
    }
    
    .featured-news .news-image {
        height: 300px;
    }
}

@media (max-width: 768px) {
    #news {
        padding: 60px 0;
    }
    
    .news-title {
        font-size: 2.5rem;
    }
    
    .news-title::before {
        font-size: 4rem;
        top: -10px;
    }
    
    .news-filters {
        padding: 0 20px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    
    .newsletter-section {
        padding: 40px 20px;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .news-header {
        margin-bottom: 40px;
    }
    
    .news-title {
        font-size: 2rem;
    }
    
    .news-subtitle {
        font-size: 1.1rem;
    }
    
    .category-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .news-content {
        padding: 20px;
    }
    
    .news-card-title {
        font-size: 1.3rem;
    }
    
    .newsletter-title {
        font-size: 2rem;
    }
    
    .newsletter-description {
        font-size: 1rem;
    }
}