* {
    box-sizing: border-box;
}

body {
    background-color: #131720;
    font-family: sans-serif;
}

h3 {
    color: white;
}

.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center; /* keeps logo + search bar vertically centered */
    background: linear-gradient(90deg, #151f30, #1c2740);
    padding: 0 20px;
    border-bottom: 2px solid #e50914;
    height: 70px; /* fixed navbar height */
    margin-bottom: 20px;
    overflow: hidden; /* ✅ Prevents logo overflow */
}

.topnav a {
    display: flex;
    align-items: center;
    padding: 0;
    text-decoration: none;
    height: auto; /* don't stretch the link */
}

.topnav img.logo {
    height: 70px; /* ✅ Fixed: matches navbar height */
    max-height: 70px; /* ✅ Prevents stretching */
    width: auto; /* ✅ Keeps proper aspect ratio */
    object-fit: contain; /* ✅ Ensures no distortion */
}

.topnav .search-container {
    display: flex;
    align-items: center;
}

form {
    background-color: #151f30;
    width: 300px;
    height: 43px;
    border-radius: 11px;
    display: flex;
    align-items: center;
}

input {
    all: unset;
    font: 15px system-ui;
    color: #fff;
    height: 100%;
    width: 100%;
    padding: 6px 9px;
}

/* ❌ Old column system disabled */
.column {
    display: none;
}

/* ✅ Grid layout for movies */
#section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.card {
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    background-color: #151f30;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.thumbnail {
    height: 350px;
    width: 100%;
    border-radius: 20px;
    object-fit: cover;
}

.container {
    text-align: center;
    margin: 20px;
    color: white;
}

iframe {
    border-radius: 10px;
    display: block;
    margin: 20px auto;
}

#movie-poster {
    width: 300px;
    border-radius: 15px;
    margin: 10px 0;
}

a {
    color: white;
    text-decoration: none;
    padding: 10px;
    padding-top: 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 20px;
}

#movie-overview {
    width: 60%;
    max-width: 600px;
    margin: 0 auto 20px;
    font-size: 18px;
    text-align: justify;
    line-height: 1.6;
    word-wrap: break-word;
}

.full_button {
    color: white;
    background-color: #151f30;
    padding: 10px 20px;
    border-radius: 5px;
    display: inline-block;
    font-size: 1.2rem;
}

.button-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.movie-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
    z-index: 2;
    background: transparent;
}

.movie-poster {
    width: 300px;
    border-radius: 10px;
}

.movie-info {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.movie-info h1 {
    margin: 0;
    font-size: 2rem;
}

.movie-info p {
    margin: 5px 0;
    line-height: 1.5;
}

/* ================== Responsive ================== */
@media (max-width: 1024px) {
    #section {
        grid-template-columns: repeat(2, 1fr);
    }

    .thumbnail {
        height: 300px;
    }
}

@media (max-width: 600px) {
    #section {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .thumbnail {
        height: 250px;
    }

    .card {
        padding: 10px;
    }
}

@media (max-width: 900px) {
    .movie-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .movie-poster {
        width: 80%;
        max-width: 250px;
        margin-bottom: 20px;
    }

    .movie-info {
        max-width: 100%;
        align-items: center;
    }

    .button-container {
        justify-content: center;
    }
}

@media (max-width: 500px) {
    .movie-poster {
        width: 100%;
        max-width: 200px;
    }

    .movie-info h1 {
        font-size: 1.5rem;
    }
}

#trailer-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #151f30;
    border-radius: 10px;
}

#trailer-section h2 {
    color: white;
    margin-bottom: 15px;
    text-align: center;
}

#movie-trailer iframe {
    width: 100%;
    max-width: 800px;
    height: 450px;
    border-radius: 10px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 10px;
}

.pagination button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background-color: #151f30;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.pagination button:hover {
    background-color: #1f2a40;
}

.pagination span {
    color: white;
    font-size: 1rem;
}

.filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar button {
    padding: 8px 12px;
    border-radius: 5px;
    border: none;
    font-size: 1rem;
    background-color: #151f30;
    color: white;
    cursor: pointer;
}

.filter-bar button {
    background-color: #e50914;
    font-weight: bold;
}

.filter-bar button:hover {
    background-color: #b00710;
}

.cast-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #151f30;
    border-radius: 10px;
    color: white;
}

.cast-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.cast-card {
    text-align: center;
    background-color: #1c2740;
    padding: 10px;
    border-radius: 10px;
}

.cast-card img {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
}

#watch-now {
    background-color: #e50914;
    border: none;
    font-size: 1.2rem;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#watch-now:hover {
    background-color: #b00710;
}

.movie-hero {
    position: relative;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 40px 20px;
    color: white;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.movie-hero .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(19, 23, 32, 0.85);
    z-index: 1;
    pointer-events: none;
}

.similar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.similar-card {
    width: 150px;
    cursor: pointer;
    text-align: center;
    color: white;
    transition: transform 0.2s ease;
}

.similar-card img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 5px;
}

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

.similar-scroll {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
}

.similar-scroll::-webkit-scrollbar {
    height: 8px;
}

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

.player-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.player-container {
    position: relative;
    width: 80%;
    max-width: 1000px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.player-container iframe {
    width: 100%;
    height: 550px;
    border: none;
    display: block;
}

.close-player {
    position: absolute;
    top: 10px;
    right: 10px;
    background: red;
    color: white;
    border: none;
    font-size: 1.2rem;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
}

.ad-mobile-banner {
    display: none;
    text-align: center;
    margin: 10px 0;
}

@media screen and (max-width: 768px) {
    .ad-mobile-banner {
        display: block;
    }
}

.desktop-banner {
    display: none;
    text-align: center;
    margin: 10px 0;
}

@media (min-width: 1024px) {
    .desktop-banner {
        display: block;
    }
}

/* Season & Episode container styling */
.button-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin; /* Firefox */
}
.button-container::-webkit-scrollbar {
    height: 8px;
}
.button-container::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

/* Card style */
.card-button {
    min-width: 120px;
    max-width: 150px;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    color: #fff;
    text-align: center;
    border: none;
    padding: 0;
    transition: transform 0.2s;
}
.card-button:hover {
    transform: scale(1.05);
}

/* Thumbnail inside card */
.card-button img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.card-button span {
    display: block;
    padding: 5px;
    font-size: 14px;
}

/* === Seasons & Episodes Cards (Netflix-style) === */
#season-buttons, #episode-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}

.season-card, .episode-card {
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #fff;
  text-align: center;
}

.season-card img, .episode-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

.season-card p, .episode-card p {
  padding: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: #ddd;
}

/* Hover effect */
.season-card:hover, .episode-card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

/* Make episode titles more compact */
.episode-card p {
  font-size: 13px;
  color: #bbb;
}

/* === Active Episode Highlight === */
.episode-card.active {
  border: 2px solid #e50914; /* Netflix red */
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.8);
  transform: scale(1.08);
}

.episode-card.active p {
  color: #fff;
  font-weight: bold;
}

/* Center section titles ABOVE content */
.cast-section h2,
.similar-scroll h2 {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

/* Ensure content stays below the title */
.cast-section,
.similar-scroll {
    display: block;
}

.movie-text-list {
    max-width: 900px;
    margin: 30px auto;
    text-align: left;
}

.movie-text-list ul {
    list-style: none;
    padding: 0;
}

.movie-text-list li {
    padding: 10px 0;
    border-bottom: 1px solid #1c2740;
}

.movie-text-list a {
    color: white;
    font-size: 1.1rem;
    text-decoration: none;
}

.movie-text-list a:hover {
    color: #e50914;
}

.az-pagination {
    text-align: center;
    margin: 20px 0;
}

.az-pagination a {
    margin: 4px;
    padding: 6px 10px;
    background: #151f30;
    border-radius: 4px;
    font-weight: bold;
}

.az-pagination a:hover {
    background: #e50914;
}

