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

body {
    font-family: Arial, sans-serif;
    background: #141414;
    color: white;
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 1000;
}

.logo {
    color: #e50914;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo svg {
    height: 40px;
    width: auto;
}

/* Update existing logo styles to handle SVG */
.logo path {
    transition: fill 0.4s ease;
}

.logo:hover path {
    fill: #ff0f1a;
}

.logo text {
    transition: fill 0.4s ease;
}

.logo:hover text {
    fill: #ff0f1a;
}

.nav-links {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    font-size: 1.1rem;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #e50914;
}

/* Dropdown menu styles */
.legal-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #1a1a1a;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1001;
    border-radius: 4px;
    border: 1px solid #333;
    padding: 8px 0;
    top: 100%;
    margin-top: 5px;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    margin: 0;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #333;
    color: #e50914;
}

.legal-dropdown:hover .dropdown-content {
    display: block;
}

.legal-dropdown > a::after {
    content: ' ▼';
    font-size: 0.8rem;
    margin-left: 5px;
}

.search-container {
    display: flex;
    align-items: center;
    margin: 0 20px;
}

#search-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 8px 12px;
    color: white;
    font-size: 1rem;
    width: 250px;
    transition: all 0.3s ease;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#search-input:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: #e50914;
    outline: none;
}

#search-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

#search-button:hover {
    transform: scale(1.1);
}

.hero {
    height: 80vh;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, transparent 100%),
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' fill='%23303030'/%3E%3C/svg%3E");
    background-position: center;
    background-size: cover;
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.hero-content {
    max-width: 600px;
    transition: opacity 0.5s ease;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.hero-buttons button {
    padding: 10px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
    cursor: pointer;
}

.play-btn {
    background: white;
    color: black;
}

.info-btn {
    background: rgba(109, 109, 110, 0.7);
    color: white;
}

.row {
    padding: 20px 50px;
}

.row h2 {
    margin-bottom: 20px;
}

.slider {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 20px 0;
}

.slider::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 auto;
    width: 250px;
    position: relative;
}

.thumbnail {
    width: 100%;
    height: 140px;
    background: #303030;
    border-radius: 4px;
    transition: transform 0.3s;
    background-size: cover;
    background-position: center;
}

.slide:hover .thumbnail {
    transform: scale(1.1);
}

.movie-title {
    position: absolute;
    bottom: -30px;
    left: 0;
    width: 100%;
    padding: 5px;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slide:hover .movie-title {
    opacity: 1;
}

.progress-bar {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: #404040;
}

.progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 75%;
    background: #e50914;
}

.movies-container {
    padding: 20px 50px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.movie-card {
    position: relative;
    transition: transform 0.3s;
    cursor: pointer;
}

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

.movie-card img {
    width: 100%;
    height: 375px;
    object-fit: cover;
    border-radius: 8px;
}

.movie-card .title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

.loading {
    text-align: center;
    padding: 20px;
    font-size: 1.2rem;
    color: #e50914;
    display: none; /* Keep initial display none */
    justify-content: center; /* Center content when visible */
    align-items: center;
    gap: 10px; /* Space between text and spinner */
}

/* Spinner for loading indicator */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #e50914; /* Red part of spinner */
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Base modal styles for both movie details and welcome popup */
.movie-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allows clicks to pass through when hidden */
}

.movie-details-modal.show {
    opacity: 1;
    pointer-events: all; /* Blocks clicks when visible */
}

.movie-details-modal.fade-out {
    opacity: 0;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #141414;
    border-radius: 8px;
    overflow: hidden;
    overflow-y: auto;
    transform: scale(0.95); /* Start slightly smaller for transition */
    transition: transform 0.3s ease;
}

.movie-details-modal.show .modal-content {
    transform: scale(1); /* Scale up when shown */
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.modal-body {
    position: relative;
    z-index: 2;
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 3; /* Ensure close button is above content */
}

.movie-meta {
    margin: 20px 0;
}

.movie-meta span {
    margin-right: 20px;
}

.rating {
    color: #46d369;
}

.overview {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
}

.modal-buttons .play-btn {
    background: white;
    color: black;
}

.modal-buttons .add-list-btn {
    background: rgba(109, 109, 110, 0.7);
    color: white;
}

.modal-buttons button:hover {
    opacity: 0.9;
}

.video-container {
    width: 100%;
    height: 500px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

/* Ad blocker notification styles */
.ad-blocked-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #e50914;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
}

.ad-blocked-notice.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hide common ad containers that might slip through */
[id*="google_ads"],
[class*="google_ads"],
.adsbygoogle,
[data-ad-client],
[data-ad-slot] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Specific styling for the welcome modal */
.welcome-modal .modal-content {
    background: #1a1a1a; /* Slightly different background for welcome */
    max-width: 500px; /* Smaller for a welcome message */
    padding: 20px; /* Add padding to modal-content for welcome popup */
}

.welcome-modal .modal-body {
    padding: 20px; /* Adjust padding for welcome modal body */
    text-align: center;
    justify-content: center;
}

.welcome-modal h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #e50914;
}

.welcome-modal p.overview {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: none; /* Remove max-width constraint */
}

.welcome-modal .modal-buttons {
    justify-content: center; /* Center the "Got It!" button */
}

.welcome-modal .welcome-got-it-btn {
    background: #e50914; /* Netflix red for the button */
    color: white;
    padding: 12px 40px;
}

.welcome-modal .welcome-got-it-btn:hover {
    background: #ff0f1a;
}

/* Hide the welcome modal by default */
.welcome-modal {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.welcome-modal.show {
    display: flex; /* Override display:none when .show is added */
}

/* Footer styles */
footer {
    background: #0d0d0d;
    color: #888;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    font-size: 0.9rem;
    border-top: 1px solid #222;
}

footer p {
    margin-bottom: 10px;
}

footer p:last-child {
    margin-bottom: 0;
}