/* Trending Now Section - Horizontal Scroll Version */
.trending-section {
    margin: 24px auto;
    padding: 0 20px;
    max-width: 1400px;
    width: 100%;
    overflow: hidden; /* Hide overflow from container */
    box-sizing: border-box;
}

.trending-header-wrapper {
    margin-bottom: 12px;
    padding: 0;
}

.trending-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trending-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-scroll-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}

.scroll-dot.active {
    background: #E53935;
    width: 20px;
    border-radius: 4px;
}

.trending-icon {
    font-size: 22px;
    animation: flame 1.5s ease-in-out infinite;
}

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

.trending-subtitle {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.trending-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding-bottom: 8px; /* Space for shadow */
}

/* Hide scrollbar but keep functionality */
.trending-grid::-webkit-scrollbar {
    display: none;
}

.trending-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    flex: 0 0 auto; /* Don't grow or shrink */
    width: 160px; /* Fixed width for horizontal scroll */
    scroll-snap-align: start; /* Snap to start when scrolling */
}

.trending-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.trending-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.trending-rank {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(255,107,107,0.4);
}

.trending-topic {
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 8px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 10px;
}

.trending-image {
    width: 100%;
    height: 85px;
    overflow: hidden;
}

.trending-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trending-content {
    padding: 8px 10px;
}

.trending-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    color: #666;
}

.trending-source {
    font-weight: 500;
}

.trending-score {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 9px;
    color: #ff6b6b;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .trending-section {
        margin: 16px 0;
        padding: 0;
        max-width: 100vw;
        width: 100%;
    }

    .trending-header {
        padding: 0 12px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .trending-title {
        flex: 1 1 100%;
    }

    .trending-scroll-dots {
        gap: 5px;
        order: 3;
        margin-top: -4px;
    }

    .scroll-dot {
        width: 6px;
        height: 6px;
    }

    .scroll-dot.active {
        width: 16px;
    }

    .trending-grid {
        gap: 10px;
        padding: 0 12px;
        margin: 0;
    }

    .trending-card {
        border-radius: 6px;
        width: 140px; /* Slightly smaller on mobile */
    }

    .trending-image {
        height: 85px;
    }

    .trending-content {
        padding: 8px;
    }

    .trending-card-title {
        font-size: 11px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 4px;
    }

    .trending-meta {
        font-size: 9px;
    }

    .trending-rank {
        font-size: 8px;
        padding: 2px 5px;
    }

    .trending-topic {
        font-size: 8px;
        padding: 2px 5px;
    }

    .trending-title {
        font-size: 18px;
    }

    .trending-subtitle {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .trending-card {
        width: 130px; /* Even smaller on very small screens */
    }

    .trending-image {
        height: 80px;
    }
}
