/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    position: relative;
}

/* Custom animations and rich styling */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-bg {
    background: linear-gradient(-45deg, #1e1b4b, #312e81, #581c87, #7c2d12);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

.glass-effect {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.poster-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(51, 65, 85, 0.9));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    height: 320px;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    flex-shrink: 0;
}

.poster-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border-color: rgba(168, 85, 247, 0.5);
}

.poster-image {
    height: 215px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    background: linear-gradient(135deg, #374151, #4b5563);
}

.poster-card:hover .poster-image {
    transform: scale(1.05);
}

.overlay {
    transition: all 0.4s ease;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(219, 39, 119, 0.9));
}

.ott-button {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    white-space: nowrap;
}

.ott-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.section-title {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.header-glow {
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 4px;
}

/* Swiper container constraints */
.swiper-container {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.swiper-wrapper {
    align-items: stretch;
}

.swiper-slide {
    height: auto;
    width: 220px !important;
    flex-shrink: 0;
}

/* Prevent any element from causing horizontal scroll */
* {
    box-sizing: border-box;
}

main {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Movie title styling */
.movie-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Language badge */
.language-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

/* Placeholder for missing images */
.image-placeholder {
    background: linear-gradient(135deg, #374151, #4b5563);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.75rem;
    text-align: center;
}

/* Navigation arrow styling */
.swiper-button-prev,
.swiper-button-next,
[class*="swiper-button-prev-"],
[class*="swiper-button-next-"] {
    opacity: 0;
    transition: all 0.3s ease;
    transform: translateY(-50%);
}

.swiper-container:hover .swiper-button-prev,
.swiper-container:hover .swiper-button-next,
[class*="swiper-container-"]:hover [class*="swiper-button-prev-"],
[class*="swiper-container-"]:hover [class*="swiper-button-next-"] {
    opacity: 1;
}

[class*="swiper-button-prev-"]:hover,
[class*="swiper-button-next-"]:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: translateY(-50%) scale(1.1);
}

/* Ensure proper container for navigation */
section {
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .poster-card {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
        height: 280px;
    }
    
    .poster-image {
        height: 160px;
    }
    
    /* Hide arrows on mobile for better touch experience */
    [class*="swiper-button-prev-"],
    [class*="swiper-button-next-"] {
        display: none;
    }
}