/* Trending Now Section */
.trending-now {
    padding: 4rem 0;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.trending-now .section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.trending-now .section-title {
    font-size: 2.25rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.trending-now .section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 3px;
}

.trending-now .section-subtitle {
    color: #6b7280;
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 0 auto 2.5rem;
    max-width: 1280px;
    width: 100%;
    padding: 0 1.5rem;
}

.trend-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
}

.trend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.trend-card.featured {
    position: relative;
    border: 2px solid #4f46e5;
}

.trend-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

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

.featured-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trend-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.trend-meta {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.trend-category {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
    margin-right: 0.75rem;
    transition: color 0.2s ease;
}

.trend-category:hover {
    color: #3730a3;
    text-decoration: underline;
}

.trend-date {
    font-size: 0.875rem;
    color: #9ca3af;
}

.trend-title {
    font-size: 1.25rem;
    color: #1f2937;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.trend-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.trend-title a:hover {
    color: #4f46e5;
}

.trend-excerpt {
    color: #4b5563;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
}

.trend-stats {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    position: relative;
    cursor: default;
}

.stat-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.stat-item .stat-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.stat-item:hover .stat-icon {
    background: #4f46e5;
    color: white;
}

.stat-item .stat-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.stat-item .trend-indicator {
    font-size: 0.75rem;
    margin-top: 0.15rem;
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.35rem;
    border-radius: 10px;
    font-weight: 600;
}

.stat-item.up .trend-indicator {
    color: #10b981;
    background: #d1fae5;
}

.stat-item.down .trend-indicator {
    color: #ef4444;
    background: #fee2e2;
}

.stat-item .trend-indicator::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 3px;
    vertical-align: middle;
}

.stat-item.up .trend-indicator::before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid #10b981;
}

.stat-item.down .trend-indicator::before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #ef4444;
}

.stat-item[data-tooltip] {
    position: relative;
}

.stat-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-item[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #1f2937;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.stat-item[data-tooltip]:hover::after,
.stat-item[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
}

.trending-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.view-all-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #4f46e5;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3), 0 2px 4px -1px rgba(79, 70, 229, 0.2);
}

.view-all-button:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.2);
}

.view-all-button:active {
    transform: translateY(0);
}

.view-all-button svg {
    transition: transform 0.2s ease;
}

.view-all-button:hover svg {
    transform: translateX(3px);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 0 1.5rem;
    }
    
    .trend-card {
        min-width: 0; /* Allow cards to shrink below min-content */
    }
}

@media (max-width: 1024px) {
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 768px;
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .trending-now {
        padding: 3rem 0;
    }
    
    .trending-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 0 1.25rem;
        gap: 1.5rem;
    }
    
    .trend-card {
        max-width: 100%;
        padding: 1.25rem;
    }
    
    .trend-stats {
        flex-wrap: wrap;
    }
    
    .stat-item {
        min-width: calc(50% - 0.5rem);
        margin-bottom: 0.5rem;
    }
    
    .trending-now .section-title {
        font-size: 1.875rem;
    }
    
    .trending-now .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

/* Ensure cards maintain consistent height in the grid */
.trend-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.trend-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.trend-stats {
    margin-top: auto;
    padding-top: 1rem;
}

/* Animation for the section */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trend-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.trend-card:nth-child(1) { animation-delay: 0.1s; }
.trend-card:nth-child(2) { animation-delay: 0.2s; }
.trend-card:nth-child(3) { animation-delay: 0.3s; }
