/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Hero Overlay Header - Mobile Only */
.hero-overlay-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    pointer-events: none;
}

.hero-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

.hero-logo .logo {
    height: 32px;
    width: auto;
}

.hero-profile {
    margin-left: auto;
    pointer-events: auto;
}

.profile-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    display: block;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

/* Hero Section - Full Viewport Carousel (Mobile Only) */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

/* Mobile: Reduced height to show first movies */
@media (max-width: 768px) {
    .hero {
        height: 85vh;
        height: 85dvh; /* Reduced to show first movies below */
    }
}

.hero-carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    background: #000;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hero-carousel-container::-webkit-scrollbar {
    display: none;
}

.hero-carousel-wrapper {
    display: flex;
    width: 300%;
    height: 100%;
    will-change: scroll-position;
}

.hero-slide {
    flex: 0 0 33.333333%;
    width: 33.333333%;
    min-width: 33.333333%;
    height: 100%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    scroll-snap-align: start;
}

.hero-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #000;
}

.hero-gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 40%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.hero-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 3rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.hero-pagination {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.2rem;
    justify-content: center;
    align-items: center;
    z-index: 30;
}

/* Hide pagination on desktop */
@media (min-width: 769px) {
    .hero-pagination {
        display: none;
    }
}

.pagination-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.pagination-dot.active {
    background: #F60051;
    width: 6px;
    height: 6px;
    border-radius: 4px;
}

/* Desktop Hero Section (Original) */
.hero-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

.hero-scroll-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    z-index: 2;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    will-change: scroll-position;
}

.hero-scroll-container:active {
    cursor: grabbing;
}

.hero-scroll-container::-webkit-scrollbar {
    display: none;
}

.hero-scroll-wrapper {
    display: flex;
    gap: 2rem;
    padding: 2rem 4rem;
    height: 100%;
    align-items: center;
    justify-content: flex-start;
    width: max-content;
    flex-shrink: 0;
}

.hero-poster-card {
    flex: 0 0 auto;
    width: 300px;
    height: auto;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
    position: relative;
    scroll-snap-align: center;
}

.hero-poster-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.hero-poster {
    position: relative;
    width: 100%;
    padding-top: 150%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s ease;
}

.hero-poster-card:hover .hero-poster {
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.2);
}

.hero-poster-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-poster-title {
    padding: 1rem 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    line-height: 1.3;
}

/* Desktop: Hide mobile hero overlay, show old navbar and desktop hero */
@media (min-width: 769px) {
    .hero-overlay-header {
        display: none;
    }
    
    .hero {
        height: 70vh;
    }
    
    .hero-carousel-container {
        display: none;
    }
    
    .hero-bg-video,
    .hero-scroll-container {
        display: block;
    }
    
    .navbar {
        display: block;
    }
}

/* Mobile: Hide desktop navbar and desktop hero */
@media (max-width: 768px) {
    .navbar {
        display: none;
    }
    
    .hero-bg-video,
    .hero-scroll-container {
        display: none;
    }
    
    .hero-carousel-container {
        display: block;
    }
}

/* Desktop Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-logo .logo-container {
    position: relative;
    display: inline-block;
}

.nav-logo .logo {
    height: 40px;
    width: auto;
    position: relative;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active:hover {
    color: #ffd700;
}

.nav-link.active {
    color: #fff;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #fff;
    color: #000;
}

.btn-primary:hover {
    background-color: #e5e5e5;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}


/* Main Content */
.main-content {
    padding: 4rem 0;
    background-color: #000;
}

.content-section {
    margin-bottom: 4rem;
    padding: 0 4rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #fff;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.movie-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.movie-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.movie-poster {
    position: relative;
    width: 100%;
    padding-top: 150%; /* 2:3 aspect ratio fallback for older devices */
    overflow: hidden;
}

.movie-poster-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster-img {
    transform: scale(1.05);
}

.placeholder-poster {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #333;
}

.movie-caption {
    padding: 0.75rem 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e5e5e5;
    text-align: center;
    line-height: 1.3;
}

/* Footer */
.footer {
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
    display: block;
}

.footer-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-container,
    .content-section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem 1.5rem;
    }
    
    .content-section {
        padding: 0 1.5rem;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .movie-poster {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .movie-poster {
        height: 150px;
        min-height: 150px;
        max-height: 150px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.movie-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Hover Effects */
.movie-card:hover .placeholder-poster {
    border-color: #e50914;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.3);
}

/* Focus States for Accessibility */
.btn:focus {
    outline: 2px solid #e50914;
    outline-offset: 2px;
}

.nav-link:focus,
.profile-btn:focus {
    outline: none;
}

/* TV Show Overlay Styles */
.show-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.show-overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.overlay-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 1000px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.show-overlay.active .overlay-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.overlay-poster {
    flex: 0 0 350px;
    position: relative;
}

.overlay-poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 0 0 12px;
}

.overlay-details {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.overlay-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.2;
}

.overlay-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.overlay-year,
.overlay-rating,
.overlay-duration {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
}

.overlay-rating {
    background: #e50914;
}

.overlay-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e5e5e5;
    margin-bottom: 1.5rem;
}

.overlay-genres {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.overlay-genres-text {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #fff;
    display: inline-block;
}

.overlay-production-logo {
    display: inline-block;
    height: auto;
}

.production-logo-img {
    height: 1.2rem;
    width: auto;
    display: block;
    object-fit: contain;
}

.overlay-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.overlay-play-btn,
.overlay-add-btn {
    flex: 1;
    min-width: 150px;
}

/* Suggested Shows */
.suggested-shows {
    margin-top: 2rem;
    border-top: 1px solid #333;
    padding-top: 2rem;
}

.suggested-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
}

.suggested-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 600px;
}

.suggested-card {
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.suggested-card:hover {
    transform: scale(1.05);
}

.suggested-poster {
    width: 100%;
    aspect-ratio: 2/3; /* Portrait orientation - 2:3 aspect ratio */
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

.suggested-caption {
    padding: 0.4rem 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #e5e5e5;
    text-align: center;
    line-height: 1.2;
}

/* Responsive Overlay */
@media (max-width: 768px) {
    .overlay-content {
        flex-direction: column;
        width: 95%;
        max-height: 90vh;
    }
    
    .overlay-poster {
        flex: 0 0 250px;
    }
    
    .overlay-poster-image {
        border-radius: 12px 12px 0 0;
    }
    
    .overlay-details {
        padding: 1.5rem;
    }
    
    .overlay-title {
        font-size: 2rem;
    }
    
    .overlay-actions {
        flex-direction: column;
    }
    
    .overlay-play-btn,
    .overlay-add-btn {
        flex: none;
        width: 100%;
    }
    
    .suggested-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .overlay-details {
        padding: 1rem;
    }
    
    .overlay-title {
        font-size: 1.5rem;
    }
    
    .overlay-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .suggested-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}
