@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #e50914;
    --primary-color-rgb: 229, 9, 20;
    --background-dark: #0a0a0a;
    --background-light: #1a1a1a;
    --text-color: #f0f0f0;
    --text-light: #b0b0b0;
    --card-background: #1c1c1c;
    --border-color: #333;
    --skeleton-color: #2a2a2a;
}

body.light-mode {
    --primary-color: #e50914;
    --background-dark: #f8f8f8;
    --background-light: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --card-background: #e8e8e8;
    --border-color: #ddd;
    --skeleton-color: #e0e0e0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(to bottom right, var(--background-dark), var(--background-light));
    color: var(--text-color);
    margin: 0;
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
}

main {
    flex: 1;
}


/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--background-light);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand a {
    color: var(--primary-color);
    font-size: 1.9rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav li {
    margin-left: 2rem;
}

.navbar-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    font-size: 1rem;
    position: relative;
}

.navbar-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.2s ease-in-out;
}

.navbar-nav a:hover::after {
    width: 100%;
}

.navbar-nav a:hover {
    color: var(--text-color);
}

.search-container {
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    background-color: var(--card-background);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#search-input {
    padding: 0.8rem 1.2rem;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    width: 220px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#search-input::placeholder {
    color: var(--text-light);
}

#search-button {
    padding: 0.8rem 1rem;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    border-radius: 0 25px 25px 0;
}



.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.8rem;
    cursor: pointer;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.mobile-nav-overlay.active {
    display: flex;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    text-align: center;
}

.mobile-nav-links li {
    margin-bottom: 2rem;
}

.mobile-nav-links a {
    color: var(--text-color);
    font-size: 2.5rem;
    text-decoration: none;
    font-weight: 600;
}

/* --- Theme Toggle --- */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    margin-left: 2rem;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.4s;
    border-radius: 24px;
}

.theme-switch label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.theme-switch input:checked + label {
    background-color: var(--primary-color);
}

.theme-switch input:checked + label:before {
    transform: translateX(24px);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1536440136628-849c177e76a1?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') no-repeat center center/cover;
    padding: 0 2rem;
}

.hero-content .search-container {
    margin-top: 2rem;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    background-color: var(--card-background);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#search-input {
    padding: 0.8rem 1.2rem;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#search-input::placeholder {
    color: var(--text-light);
}

#search-button {
    padding: 0.8rem 1rem;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    border-radius: 0 25px 25px 0;
}


.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-light);
}


/* --- Sections --- */
.movies-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.movies-section h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-color);
}

/* --- News Section --- */
.news-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.news-section h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-color);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background-color: var(--card-background);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-body {
    padding: 1rem;
}

.news-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-card-source {
    font-size: 0.9rem;
    color: var(--text-light);
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    justify-content: center;
}

.movie-card {
    background-color: var(--card-background);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    animation: fadeIn 0.5s ease-out;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.movie-card img {
    width: 100%;
    height: 300px; /* Consistent height for images */
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.movie-card-image-container {
    position: relative;
}

.movie-card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.movie-card-title {
    font-size: 1.1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    text-align: center;
}

.movie-card .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-size: 4rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 3;
}

.movie-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.movie-card-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.movie-card:hover .movie-card-image-container::after {
    opacity: 1;
}

/* --- Skeleton Loader --- */
.skeleton-card {
    background-color: var(--skeleton-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.skeleton-img {
    width: 100%;
    height: 300px; /* Adjusted for new card size */
    background-color: var(--border-color);
}

.skeleton-body {
    padding: 1rem;
}

.skeleton-title {
    width: 80%;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 4px;
    margin: 0 auto;
}

/* --- Season & Episode Selectors --- */
#season-episode-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

#season-episode-selector label {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
}

#season-episode-selector select {
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#season-episode-selector select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
}

/* --- Video Modal --- */
.video-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Slightly darker overlay */
    backdrop-filter: blur(8px); /* Slightly less blur */
    justify-content: center;
    align-items: center;
    animation: fadeInModal 0.3s ease-out;
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1100px; /* Increased max-width */
    background-color: var(--background-light); /* Lighter background for modal */
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); /* Stronger shadow */
    transform: translateY(-20px); /* Initial slight lift */
    animation: slideInModal 0.3s ease-out forwards;
    max-height: 90vh;
    overflow-y: auto;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-color);
    font-size: 2.8rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: var(--primary-color);
}

.source-buttons {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
}

.source-button {
    padding: 0.7rem 1.3rem;
    background-color: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.source-button:hover:not(.is-unavailable) {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.source-button.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.4);
}

.source-button.is-available {
    background-color: #28a745; /* A slightly darker green */
    border-color: #28a745;
    color: white;
}

.source-button.is-unavailable {
    background-color: #dc3545; /* A slightly darker red */
    border-color: #dc3545;
    color: white;
    opacity: 0.7;
    cursor: not-allowed;
}

.modal-content iframe {
    width: 100%;
    height: 100%; 
    border-radius: 10px;
    background-color: black; 
}

.video-player-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 10px;
}

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

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.play-overlay:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.play-overlay i {
    font-size: 5rem;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.play-overlay:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.video-details-container {
    display: flex;
    margin-top: 1.5rem;
    gap: 1.5rem;
}

#modal-movie-poster {
    width: 150px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.video-details {
    flex: 1;
}

.video-details h2 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.video-details p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-light);
}

.video-details p strong {
    color: var(--text-color);
}

#video-availability-status {
    text-align: center;
    color: var(--text-color);
    margin-top: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInModal {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--background-light);
    margin-top: 3rem;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* --- Load More Button --- */
.load-more-button {
    display: block;
    margin: 3rem auto 1rem auto;
    padding: 1rem 2.5rem;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.load-more-button:hover {
    background-color: #cc0712;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .navbar-nav {
        display: none;
    }

    .search-container {
        order: 1;
        width: 100%;
        margin-top: 1rem;
    }

    .search-input {
        width: 100%;
    }

    .theme-switch {
        margin-left: 0.8rem;
    }

    .notification-button,
    .developer-message-button {
        margin-left: 0.8rem;
    }

    .hamburger-menu {
        display: block;
    }

    .movies-section {
        padding: 1.5rem;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .movie-card img {
        height: 225px; /* Adjusted for smaller card size */
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .modal-content iframe {
        height: 300px;
    }

    .source-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-wrap: wrap;
    }

    .navbar-brand {
        width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }

    .theme-switch {
        margin: 0 auto;
    }

    .search-container {
        margin-top: 0.5rem;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .movie-card img {
        height: 180px;
    }

    .modal-content iframe {
        height: 250px;
    }
}

/* --- Notification Button --- */
.notification-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: color 0.2s ease;
}

.notification-button:hover {
    color: var(--primary-color);
}

.developer-message-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: color 0.2s ease;
}

.developer-message-button:hover {
    color: var(--primary-color);
}

/* --- Notification Modal --- */
.notification-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.85); /* Black w/ opacity */
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    animation: fadeInModal 0.3s ease-out;
}

.notification-modal .modal-content {
    background-color: var(--background-light);
    margin: auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 700px;
    position: relative;
    animation: slideInModal 0.3s ease-out forwards;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

.notification-modal .close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-color);
    font-size: 2.8rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.2s ease;
}

.notification-modal .close-button:hover {
    color: var(--primary-color);
}

.notification-modal .notification-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.notification-modal .notification-subtitle {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.notification-modal p {
    margin-bottom: 10px;
    color: var(--text-light);
}

.notification-modal ul {
    list-style: disc inside;
    margin-bottom: 10px;
    padding-left: 20px;
}

.notification-modal li {
    margin-bottom: 5px;
    color: var(--text-light);
}

.notification-modal strong {
    color: var(--text-color);
}

