/* Global Styles */
:root {
    --netflix-red: #e50914;
    --background: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-white: #ffffff;
    --text-gray: #b3b3b3;
    --font-primary: 'Outfit', 'Inter', sans-serif;
}

* {
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--text-white);
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--netflix-red);
}

/* Navbar */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 15px 40px;
    height: 70px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.nav__black {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(30px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
    padding: 10px 40px;
}

.nav__logo {
    color: var(--netflix-red);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -2px;
    text-transform: uppercase;
    cursor: pointer;
    text-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__logo:hover {
    transform: scale(1.08);
}

.nav__search {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 20px;
    border-radius: 30px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 20px;
    width: 200px;
}

.nav__search:focus-within {
    width: 400px;
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--netflix-red);
}

.nav__search input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    padding-left: 10px;
}

.nav__search-clear {
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    margin-right: 10px;
    display: none;
    /* Hidden by default */
    transition: color 0.3s ease;
}

.nav__search-clear:hover {
    color: white;
}

.nav__search-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

.nav__avatar {
    width: 35px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav__avatar:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Similar Movies Grid */
.modal__similar-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    /* Reduced from 180px */
    gap: 12px;
}

.similar-movie {
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    background-color: #222;
}

.similar-movie:hover {
    transform: scale(1.05);
}

.similar-movie img {
    width: 100%;
    height: 85px;
    /* Reduced from 120px */
    object-fit: cover;
    display: block;
}

/* Banner */
.banner {
    color: white;
    object-fit: contain;
    height: 90vh;
    background-size: cover;
    background-position: center center;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    animation: fadeIn 1.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.banner__contents {
    margin-left: 60px;
    padding-top: 100px;
    max-width: 600px;
    z-index: 2;
    animation: slideUp 1s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.banner__title {
    font-size: 4rem;
    font-weight: 800;
    padding-bottom: 0.5rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
}

.banner__description {
    font-size: 1.1rem;
    line-height: 1.4;
    padding-top: 1rem;
    height: auto;
    max-height: 15vh;
    color: var(--text-gray);
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
    margin-bottom: 2rem;
}

.banner__button {
    cursor: pointer;
    color: #fff;
    outline: none;
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 8px;
    padding: 0.8rem 2.5rem;
    margin-right: 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.banner__button:hover {
    color: #000;
    background-color: var(--text-white);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.banner__button:first-child {
    background-color: var(--text-white);
    color: #000;
}

.banner--fadeBottom {
    height: 15rem;
    background-image: linear-gradient(180deg,
            transparent,
            rgba(37, 37, 37, 0.7),
            var(--background));
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* Rows & Section Titles */
.section-title {
    margin-left: 40px;
    margin-top: 60px;
    margin-bottom: 0px;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.5px;
    position: relative;
    display: block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--netflix-red);
    border-radius: 2px;
}

/* Rows */
.row {
    color: white;
    margin: 40px 0 40px 40px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.row.visible {
    opacity: 1;
    transform: translateY(0);
}

.row h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: capitalize;
}

.row__posters {
    display: flex;
    overflow-y: hidden;
    overflow-x: scroll;
    padding: 20px 0;
    scrollbar-width: none;
}

.row__posters::-webkit-scrollbar {
    display: none;
}

.row__poster-wrapper {
    position: relative;
    margin-right: 20px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    border-radius: 12px;
    min-width: 400px;
    /* Increased */
}

.row__poster-wrapper:hover {
    transform: scale(1.08) translateY(-12px);
    z-index: 10;
}

.row__poster {
    object-fit: cover;
    width: 400px;
    /* Increased from 300 */
    height: 225px;
    /* Fixed aspect ratio for backdrops */
    border-radius: 12px;
    filter: brightness(0.85);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: filter 0.3s ease, box-shadow 0.3s ease;
}

.row__poster-wrapperLarge {
    min-width: 320px;
    /* Increased from 250 */
}

.row__poster-wrapperLarge .row__poster {
    width: 320px;
    /* Increased from 250 */
    height: 480px;
    /* Increased from 375 */
}

.row__poster-wrapper:hover .row__poster {
    filter: brightness(1.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.row__poster-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 15px 15px;
    /* Deeper padding for the name */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    opacity: 1;
    /* Always visible as per user request */
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    pointer-events: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 1);
}

.row__poster-wrapper:hover .row__poster-title {
    background: linear-gradient(to top, var(--netflix-red) 0%, rgba(229, 9, 20, 0.5) 20%, transparent 100%);
}

.row__poster-wrapperLarge {
    min-width: 250px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 0;
}

.modal.show {
    opacity: 1;
}

.modal__content {
    background-color: #111;
    position: relative;
    width: 95%;
    max-width: 1200px;
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(100px);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.show .modal__content {
    transform: translateY(0);
}

.modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 2010;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal__close:hover {
    background: var(--netflix-red);
    transform: scale(1.1) rotate(90deg);
}

.modal__video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
}

.modal__video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal__video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, #111 0%, transparent 100%);
    pointer-events: none;
}

.modal__details {
    padding: 40px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    background: #111;
}

.modal__main-info h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.1;
}

.modal__meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    color: #46d369;
    /* Netflix style rating color */
    font-weight: 700;
    font-size: 1.1rem;
}

.modal__overview {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-white);
    max-width: 100%;
}

.modal__sub-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.modal__section {
    margin-bottom: 40px;
}

.modal__extra-info {
    display: flex;
    flex-direction: column;
}

.modal__cast-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.modal__cast-container::-webkit-scrollbar {
    display: none;
}

.cast-card {
    position: relative;
    min-width: 100px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    background: #222;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.cast-card:hover {
    transform: scale(1.05);
    border-color: var(--netflix-red);
}

.cast-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cast-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 8px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.modal__similar-container {
    display: grid;
    grid-template-columns: repeat(4, 150px);
    /* Fixed width for uniform posters */
    gap: 12px;
    margin-top: 15px;
    justify-content: center;
    /* Center the grid within container */
}

.similar-movie {
    position: relative;
    width: 150px;
    /* Fixed width */
    height: 225px;
    /* 2:3 aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.similar-movie:hover {
    transform: scale(1.05);
    border-color: var(--netflix-red);
    z-index: 10;
}

.similar-movie img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.similar-movie-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px 5px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 30%, transparent 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
    text-align: center;
    line-height: 1.1;
    pointer-events: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-movie:hover .similar-movie-title {
    background: linear-gradient(to top, var(--netflix-red) 20%, rgba(229, 9, 20, 0.5) 60%, transparent 100%);
}

.modal__error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: var(--netflix-red);
    font-weight: 700;
    font-size: 1.5rem;
    display: none;
    text-align: center;
    padding: 30px 50px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--netflix-red);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(229, 9, 20, 0.3);
}

/* Animations Tools */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .modal__details {
        grid-template-columns: 1fr;
    }

    .modal__main-info h1 {
        font-size: 2.5rem;
    }
}