/* Trending Section */
.trending-container {
    position: relative;
    margin: 30px auto;
    width: 90%;
    max-width: 1000px;
    padding: 20px 0;
}

.trending-container h2 {
    font-size: 1.8rem;
    color: #d3d3d3;
    margin-bottom: 20px;
    font-weight: 700;
    text-align: center;
}

/* Trending Grid Layout */
.results-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 items per row for larger screens */
    gap: 16px;
    padding: 20px 0;
}

/* Media Card Styling */
.trending-item {
    background: linear-gradient(145deg, #1a1a2e, #232342);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.6), 0 3px 5px rgba(100, 0, 150, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
}

.trending-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8), 0 4px 8px rgba(100, 0, 150, 0.3);
}

.trending-poster-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: #000; /* Fallback color while loading */
}

/* High-quality image styling */
.trending-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
    image-rendering: auto; /* Ensures smooth rendering in most browsers */
}

/* Scale effect applied to the container instead of image */
.trending-item:hover .trending-poster-container {
    transform: scale(1.02); /* Apply slight zoom on hover */
}

/* Exclamation Icon Styling */
.third-party-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    color: #a99cc1;
    background-color: rgba(50, 20, 60, 0.9);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(120, 0, 140, 0.3);
}

.third-party-icon:hover {
    background-color: #bb86fc;
    transform: scale(1.1);
}

/* Overlay for Hover Effect */
.trending-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 0, 50, 0.85);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.trending-item:hover .trending-overlay {
    opacity: 1;
}

/* Overlay Content Styling */
.overlay-content {
    color: #e0e0e0;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(20, 20, 30, 0.9);
    max-width: 90%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.overlay-content h3 {
    font-size: 1rem;
    margin: 0;
    margin-bottom: 5px;
    color: #bb86fc;
}

.overlay-content p {
    font-size: 0.8rem;
    margin: 0;
    color: #b3b3b3;
}

/* Additional Info Styling */
.rating, .overview, .popularity {
    font-size: 0.75rem;
    color: #a1a1a1;
}

/* Scroll Buttons */
.scroll-button {
    position: absolute;
    top: calc(50% - 20px);
    background-color: rgba(50, 20, 60, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-button:hover {
    background-color: rgba(80, 40, 90, 0.8);
}

/* No Results Placeholder */
.results-container .no-result {
    color: #8888aa;
    text-align: center;
    font-size: 1rem;
    padding: 20px;
    font-style: italic;
    grid-column: span 5;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .results-container {
        grid-template-columns: repeat(3, 1fr); /* 3 items per row on tablets */
    }
}

@media (max-width: 480px) {
    .results-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .third-party-icon {
        font-size: 1rem;
        padding: 5px;
        top: 8px;
        right: 8px;
    }

    .overlay-content h3 {
        font-size: 0.9rem;
    }

    .overlay-content p {
        font-size: 0.7rem;
    }
}
