/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f4f4f4;
    transition: margin 0.3s ease;
}

a {
    color: #e50914;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.movie-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header & Navigation */
header {
    background: #000;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e50914;
    text-decoration: none;
    z-index: 1001;
}

.logo:hover {
    color: #ff1a1a;
    text-decoration: none;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
    background: #e50914;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
    background: #e50914;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
}

.nav-link:hover {
    background: rgba(229, 9, 20, 0.2);
    color: #e50914;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Prevent menu overflow */
body.menu-open {
    overflow: hidden;
}

/* Flash Messages */
.flash-message {
    padding: 1rem 1.5rem;
    margin: 1rem 20px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.4s ease;
    transition: opacity 0.3s ease;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flash-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.flash-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Search Form */
.search-form {
    margin: 2rem 0;
}

.search-form input {
    padding: 0.8rem;
    width: 60%;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-form button {
    padding: 0.8rem 2rem;
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-form button:hover {
    background: #c40812;
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    margin: 2rem 0;
}

.movie-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.movie-card a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.movie-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.movie-card:hover img {
    transform: scale(1.05);
}

.no-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
}

.movie-card h3 {
    padding: 1.25rem 1.25rem 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.movie-meta {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
}

/* Movie Detail */
.movie-detail {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.movie-header {
    display: flex;
    gap: 2rem;
}

.movie-poster img {
    width: 100%;
    max-width: 500px;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.movie-info h1 {
    margin-bottom: 1rem;
}

.movie-info p {
    margin: 0.5rem 0;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0.5rem 0.5rem 0.5rem 0;
}

.btn:hover {
    background: #c40812;
    text-decoration: none;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 500;
    position: relative;
}

.btn-download:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Download Menu */
.download-menu {
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
    position: relative;
    z-index: 100;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-menu h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.download-option {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, #f6f8fb 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.download-option:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.no-downloads {
    color: #999;
    font-style: italic;
    margin: 0;
    padding: 0.5rem 0;
}

.movie-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Rating */
.rating-stars {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
}

.rating-stars .star {
    display: inline-block;
    transition: color 0.2s;
}

.rating-stars .star.filled {
    color: #ffc107;
}

.rating-stars .star:hover,
.rating-stars .star:hover ~ .star {
    color: #ffc107;
}

/* Forms */
form {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

/* Home Page Sections */
.featured-section,
.recent-section,
.categories-section {
    margin: 3rem 0;
    padding: 2rem 0;
}

.featured-section h2,
.recent-section h2,
.categories-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

.featured-section h2::after,
.recent-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #e50914, #ff6b6b);
    border-radius: 2px;
}

.featured-section .movie-grid,
.recent-section .movie-grid {
    gap: 2rem;
}

/* Categories */
.category-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.category-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.category-tag:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    text-decoration: none;
}

.category-badge {
    background: #e50914;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Video Player */
.video-player-container {
    max-width: 1000px;
    margin: 2rem auto;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.video-container iframe {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
}

.video-js {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.watch-page {
    padding: 2rem 0;
}

.watch-page h1 {
    margin-bottom: 1.5rem;
    color: #333;
}

.movie-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .video-container iframe {
        height: 300px;
    }
    
    .watch-page h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .video-container iframe {
        height: 220px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Mobile Navigation */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
        flex-direction: column;
        gap: 0;
        padding: 5rem 0 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        transition: right 0.4s ease;
        overflow-y: auto;
        z-index: 1000;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem 2rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background: rgba(229, 9, 20, 0.3);
        transform: translateX(-5px);
        padding-left: 2.5rem;
    }
    
    /* Overlay */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: calc(100vw - 280px);
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: -1;
    }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .movie-card img {
        width: 100%;
        height: auto;
    }

    .movie-header {
        flex-direction: column;
    }
    
    .movie-poster img {
        max-width: 100%;
    }

    .search-form input {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }

    .search-form button {
        width: 100%;
        border-radius: 4px;
    }
    
    .featured-section,
    .recent-section,
    .categories-section {
        margin: 2rem 0;
        padding: 1rem 0;
    }
    
    .movie-actions {
        flex-direction: column;
    }
    
    .movie-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .download-menu {
        margin-top: 0.5rem;
    }
}

/* Mobile optimizations for smaller screens */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    /* Mobile Menu for Small Screens */
    .nav-links {
        width: 100%;
        right: -100%;
    }
    
    .nav-links.active::before {
        width: 0;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.9rem 1.5rem;
    }
    
    .featured-section h2,
    .recent-section h2,
    .categories-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .movie-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0;
    }
    
    .movie-card {
        max-width: 100%;
        border-radius: 10px;
    }
    
    .movie-card img {
        border-radius: 10px 10px 0 0;
    }
    
    .movie-card h3 {
        font-size: 1rem;
        padding: 1rem 1rem 0.5rem;
    }
    
    .category-list {
        gap: 0.75rem;
    }
    
    .category-tag {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Advertisement Styles */
.ad-container {
    margin: 10px auto;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
    transition: transform 0.2s ease;
}

.ad-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ad-container.ad-banner {
    max-width: 728px;
    min-height: 90px;
    margin: 20px auto;
    padding: 15px;
}

.ad-container.ad-text {
    max-width: 500px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #e50914;
}

.ad-container.ad-video {
    max-width: 640px;
    padding: 10px;
}

.ad-container.ad-video video {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Sidebar Ads */
.ads-sidebar {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 100;
    pointer-events: none;
}

.ads-sidebar .ad-container {
    margin: 10px 0;
    pointer-events: all;
    max-width: 160px;
    padding: 10px;
}

/* Popup Ads */
.ad-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.ad-popup {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.ad-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ad-close-button:hover {
    background: #f0f0f0;
    color: #e50914;
    transform: rotate(90deg);
}

.ad-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.3em;
}

.ad-content p {
    margin: 10px 0;
    color: #666;
    line-height: 1.5;
}

.ad-content a {
    display: inline-block;
    background: #e50914;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    margin-top: 15px;
    transition: all 0.2s ease;
}

.ad-content a:hover {
    background: #c40812;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Ad Disclaimer */
.ad-disclaimer {
    font-size: 10px;
    color: #999;
    margin-top: 5px;
    opacity: 0.7;
}

/* Responsive Ad Styles */
@media (max-width: 768px) {
    .ads-sidebar {
        display: none;
    }
    
    .ad-container.ad-banner {
        max-width: 320px;
        min-height: 50px;
        padding: 10px;
    }
    
    .ad-popup {
        margin: 20px;
        max-width: calc(100% - 40px);
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .ad-container {
        margin: 10px 5px;
    }
    
    .ad-container.ad-banner {
        max-width: 300px;
        padding: 8px;
    }
}
