/* CSS Variables & Global Settings (Streambert Theme) */
:root {
    --bg-color: #0a0a0a;
    --card-bg: #111111;
    --card-hover: #1a1a1a;
    --primary-color: #e50914; /* Streambert/Netflix Red */
    --primary-hover: #ff1a24;
    --primary-glow: 0 0 30px rgba(229, 9, 20, 0.4);
    --text-color: #f0f0f0;
    --text-muted: #909090;
    --border-color: #2a2a2a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
}
html {
    overflow-x: hidden;
    max-width: 100vw;
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    padding-bottom: 15px;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    font-size: 15px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar input {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 20px;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
    width: 200px;
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--primary-glow);
    width: 250px;
}

.search-bar button {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    max-height: 400px;
    overflow-y: auto;
    z-index: 2000;
    display: none;
}
.search-dropdown.active {
    display: block;
}
.search-dropdown::-webkit-scrollbar {
    width: 5px;
}
.search-dropdown::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 5px;
}
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}
.search-item:hover {
    background: var(--card-hover);
}
.search-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}
.search-item-info {
    flex: 1;
    overflow: hidden;
}
.search-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.search-item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-login {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: var(--primary-hover);
    box-shadow: var(--primary-glow);
}

/* Hero Section */
.hero {
    height: 80vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center top;
    position: relative;
    padding-bottom: 50px;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-tags {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
}

.tag-quality {
    background: var(--text-color);
    color: var(--bg-color);
    padding: 2px 6px;
    border-radius: 3px;
}

.tag-rating i {
    color: #f5c518;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-desc {
    font-size: 16px;
    color: #d1d5db;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn-play {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-play:hover {
    background: var(--primary-hover);
    box-shadow: var(--primary-glow);
    transform: translateY(-2px);
}

.btn-trailer {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border-color);
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-trailer:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--text-color);
}

/* Movie Grid */
.main-content {
    padding: 50px 0;
}

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

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.filters {
    display: flex;
    gap: 15px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--primary-glow);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

/* Streambert Card Style */
.movie-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.25s;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: var(--primary-glow);
}

.movie-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.movie-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,10,10,0.9) 0%, transparent 55%);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.play-icon {
    background: var(--primary-color);
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: var(--primary-glow);
}
.play-icon i {
    color: white;
    font-size: 20px;
    padding-left: 4px; /* Center the triangle visually */
    margin: 0;
}

.movie-badges {
    position: absolute;
    top: 10px;
    right: 10px;
}

.badge-quality {
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.meta-rating i {
    color: #f5c518;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 50px;
}

.btn-load-more {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-color);
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: var(--primary-color);
    box-shadow: var(--primary-glow);
}
/* Promo Slider */
.promo-section {
    margin: 40px auto;
}
.promo-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: var(--card-bg);
}
.promo-slider-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}
.promo-slide {
    min-width: 100%;
    cursor: pointer;
}
.promo-slide img {
    width: 100%;
    height: auto; /* Allow natural aspect ratio, prevents cropping */
    display: block;
}
.promo-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.promo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s;
}
.promo-dot.active {
    background: var(--primary-color);
    box-shadow: var(--primary-glow);
    transform: scale(1.2);
}

/* Skeleton Loading */
.skeleton-card {
    background: transparent;
    border: none;
    pointer-events: none;
}
.skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
    background: #1a1a1a;
    border-radius: 12px;
    margin-bottom: 10px;
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, #1a1a1a 8%, #2a2a2a 18%, #1a1a1a 33%);
    background-size: 800px 100%;
}
.skeleton-text {
    height: 14px;
    background: #1a1a1a;
    border-radius: 4px;
    margin-bottom: 8px;
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, #1a1a1a 8%, #2a2a2a 18%, #1a1a1a 33%);
    background-size: 800px 100%;
}
.skeleton-text.short {
    width: 60%;
}
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 50px;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Movie Detail Page Styles */
.detail-content {
    padding: 20px 0;
}

.movie-detail-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.detail-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    gap: 20px;
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
    align-items: center;
}

.detail-meta i {
    color: var(--primary-color);
}

.meta-rating i {
    color: #f5c518;
}

.detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.badge-genre {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.detail-overview {
    font-size: 16px;
    line-height: 1.8;
    color: #d1d5db;
    margin-bottom: 30px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}
.detail-actions > div {
    width: 100%;
}

/* Video Player Selection styling */
.server-selection {
    margin-bottom: 20px;
    background: var(--card-hover);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.server-selection label {
    font-weight: 600;
    margin-right: 15px;
}

.server-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s;
}

.server-btn:hover, .server-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--primary-glow);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    border: 1px solid var(--border-color);
    background: black;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.detail-info {
    min-width: 0; /* Prevents CSS Grid blowout when children are too wide */
}

/* Cast Section */
.cast-section {
    margin-bottom: 30px;
    max-width: 100%;
}
.cast-section h4 {
    font-size: 18px;
    margin-bottom: 15px;
}
.cast-list {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
}
.cast-list::-webkit-scrollbar {
    height: 6px;
}
.cast-list::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
}
.cast-item {
    text-align: center;
    width: 90px;
    flex-shrink: 0;
}
.cast-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid var(--border-color);
}
.cast-item p {
    font-size: 12px;
    line-height: 1.2;
}

/* Trailer Modal */
.trailer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.trailer-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    width: 80%;
    max-width: 900px;
    position: relative;
    background: #000;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(229, 9, 20, 0.3);
}
.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s;
}
.close-modal:hover {
    color: var(--primary-color);
}

.tv-select {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.tv-select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--primary-glow);
}

@media (max-width: 768px) {
    .logo a {
        font-size: 18px;
    }
    
    .search-bar input {
        width: 140px;
    }
    
    .search-bar input:focus {
        width: 160px;
    }
    
    .btn-login {
        padding: 6px 12px;
        font-size: 13px;
    }

    .movie-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-poster {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 2.5rem; /* Smaller hero title on mobile */
    }
    
    .hero-desc {
        font-size: 14px;
        -webkit-line-clamp: 3; /* Limit text lines on mobile */
    }
    
    .promo-section {
        margin: 20px auto;
        padding: 0 10px; /* Add breathing room on edges */
    }
    
    .nav-links {
        display: none; /* Can be expanded to hamburger menu later */
    }
    
    .filters {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* 2 columns on mobile */
        gap: 15px;
    }
}
