/* Android TV Leanback Application Styles - Fixed 1920x1080 Resolution */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #000;
    color: #e5e5e5;
    width: 1920px;
    height: 1080px;
    position: fixed;
    top: 0;
    left: 0;
    transform-origin: top left;
    /* Force layout for TV boxes */
    display: grid;
    grid-template-rows: 70px 1fr;
    grid-template-columns: 1fr;
    max-width: 1920px;
    max-height: 1080px;
}

/* Force exact 1920x1080 resolution */
body {
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Auto-scale for TV boxes and smaller screens */
@media screen and (max-width: 1920px) {
    html, body {
        transform: scale(calc(100vw / 1920));
        transform-origin: top left;
    }
}

@media screen and (max-height: 1080px) {
    html, body {
        transform: scale(calc(100vh / 1080));
        transform-origin: top left;
    }
}

/* Force scaling for TV boxes that don't respect viewport */
@media screen and (max-width: 1920px) and (max-height: 1080px) {
    html, body {
        transform: scale(min(calc(100vw / 1920), calc(100vh / 1080)));
        transform-origin: top left;
    }
}

/* Debug info for Android TV */
.debug-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    z-index: 9999;
    border: 2px solid #00ff00;
    text-align: center;
    min-width: 300px;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.8);
    z-index: -2;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, filter 0.5s ease;
}


.background.blur {
    filter: brightness(0.8) blur(10px);
}

#bg1 {
    z-index: -3;
}

#bg2 {
    z-index: -2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0.2) 0%, 
        rgba(0, 0, 0, 0.1) 50%, 
        rgba(0, 0, 0, 0.3) 100%);
    z-index: -1;
}

/* Top Header with Horizontal Menu - Exact from demo */
.top-header {
    display: flex;
    height: 70px;
    width: 1920px;
    align-items: center;
    justify-content: space-between;
    padding: 0 50px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: transparent;
}

.top-header h1 {
    font-size: 40px;
    color: lightgray;
    margin: 0;
    position: absolute;
    left: 50px;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    overflow: visible;
    max-width: 1600px;
}

.nav-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    font-weight: 600;
    padding: 12px 20px;
    white-space: nowrap;
    position: relative;
    transition: color 0.5s ease;
    background: transparent;
    z-index: 3;
}

/* Bookmark wrapper - groups icon and "Eu Privesc" */
.nav-bookmark-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Bookmark icon - always visible */
.nav-bookmark-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.4));
    opacity: 0.8;
    position: relative;
    z-index: 3;
}

/* Hidden category - fade animation */
.nav-link.hidden-category {
    display: inline-block;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    padding: 10px 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-width 0.4s ease, padding 0.4s ease;
    position: relative;
    z-index: 3;
}

.nav-link.hidden-category.revealed {
    opacity: 1;
    max-width: 120px;
    padding: 10px 20px;
}

/* Focused category */
.nav-link.focused {
    color: #00ffd2 !important;
}

/* Magic indicator - beautiful pill that slides smoothly */
.nav-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 48px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.08));
    border-radius: 22px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Fixed separator (always visible before TV) */
.nav-separator-fixed {
    display: inline-block;
    color: rgba(255, 255, 255, 0.3);
    font-size: 20px;
    margin: 0 10px;
}

/* Menu Styles - StreamHub Style */
#menu {
    position: fixed;
    left: -280px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    height: 70vh;
    max-height: 500px;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    transition: left 0.4s ease-in-out;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Menu Header */
.menu-header {
    padding: 30px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.menu-logo {
    position: fixed;
    left: -140px;
    top: calc(50% - 320px);
    transform: translateX(-50%);
    font-size: 32px;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, #ff0040, #00ffff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    z-index: 101;
    transition: left 0.4s ease-in-out;
    text-shadow: 0 0 20px rgba(255, 0, 64, 0.5);
    letter-spacing: 2px;
    font-family: 'Arial Black', sans-serif;
}

#menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: white;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

#menu li {
    margin: 8px 20px;
    font-size: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

#menu li:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(30, 144, 255, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

#menu li.focused:before {
    opacity: 1;
}

#menu li.focused {
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

#menu li:not(.focused) {
    color: rgba(255, 255, 255, 0.8);
}

#menu li:not(.focused):hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Menu Icons */
#menu li::before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

#menu li:nth-child(1)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

#menu li:nth-child(2)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z'/%3E%3C/svg%3E");
}

#menu li:nth-child(3)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5l-1 1v1h8v-1l-1-1h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H3V5h18v10z'/%3E%3C/svg%3E");
}

#menu li:nth-child(4)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

#menu li:nth-child(5)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.94-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z'/%3E%3C/svg%3E");
}

/* User Profile Section */
.user-profile {
    margin-top: auto;
    margin: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8a2be2, #1e90ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: bold;
    font-size: 14px;
    color: white;
    margin-bottom: 2px;
}

.user-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Carousel Styles - Exact from demo */
.carousel {
    height: 1030px;
    margin-top: 0px;
    width: 1920px;
    overflow: hidden;
    position: relative;
    /* Force positioning for TV boxes */
    top: 50px;
    left: 0;
    max-height: 1030px;
    max-width: 1920px;
}

.carousel .list .item {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0 0 0 0;
}

.carousel .list .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel .list .item .content {
    position: absolute;
    top: 108px;
    width: 1140px;
    max-width: 80%;
    left: 50%;
    transform: translateX(-50%);
    padding-right: 30%;
    box-sizing: border-box;
    color: #fff;
    text-shadow: 0 5px 10px #0004;
}

.content h1 {
    font-weight: bold;
    font-size: 65px;
    text-wrap: nowrap;
}

.details {
    display: flex;
    text-wrap: nowrap;
    margin-bottom: -20px;
}

.details p {
    border-right: 2px solid #ffffff;
    font-weight: bold;
    font-size: 25px;
    color: #ffcc00;
    padding: 0 10px;
}

.details p:last-child {
    border-right: none;
}

.content h4 {
    max-width: 400px;
    font-size: 17px;
    line-height: 25px;
    margin: 40px 0;
}

.buttons {
    display: flex;
}

.download-btn {
    width: 150px;
    padding: 12px 0;
    font-weight: bold;
    border: none;
    background-color: #efbf04;
    color: #000000;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.753);
    border-radius: 20px;
    margin-right: 10px;
    transition: 0.3s;
    cursor: pointer;
}

.trailer-btn {
    width: 150px;
    padding: 12px 0;
    border-color: white;
    border: none;
    border-radius: 20px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.753);
    transition: 0.3s;
    cursor: pointer;
}

.trailer-btn:hover, .download-btn:hover {
    opacity: 0.5;
    box-shadow: 5px 5px 25px rgba(0, 0, 0, 0.753);
}


/* Thumbnail Navigation */
.thumbnail {
    position: absolute;
    bottom: 50px;
    left: 50%;
    width: max-content;
    z-index: 100;
    display: flex;
    gap: 20px;
    background-color: rgba(59, 59, 59, 0.4);
    backdrop-filter: blur(10px);
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
    box-shadow: 0 0 25px #282828;
}

.thumbnail .item {
    width: 150px;
    height: 220px;
    flex-shrink: 0;
    position: relative;
}

.thumbnail .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50px;
    mix-blend-mode: lighten;
}

.thumbnail .item .thum-content {
    color: #fff;
    position: absolute;
    bottom: 10px;
    left: 40px;
    right: 10px;
}

.thumbnail .item .thum-content .title {
    font-weight: 500;
}

.thumbnail .item .thum-content .description {
    font-weight: 300;
}


/* Animation */
.carousel .list .item:nth-child(1) {
    z-index: 1;
}

/* Animation text in first item */
.carousel .list .item:nth-child(1) .content {
    filter: blur(20px);
    opacity: 0;
    animation: showContent .5s 1s linear 1 forwards;
}

@keyframes showContent {
    to {
        filter: blur(0px);
        opacity: 1;
    }
}

/* Create animation when next click */
.carousel.next .list .item:nth-child(1) img {
    width: 150px;
    height: 220px;
    position: absolute;
    bottom: 50px;
    left: 50%;
    border-radius: 100%;
    animation: showImage .5s linear 1 forwards;
}

@keyframes showImage {
    to {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.carousel.next .thumbnail {
    animation: effectNext .5s linear 1 forwards;
}

@keyframes effectNext {
    from {
        transform: translateX(150px);
    }
}


/* Prev click */
.carousel.prev .list .item:nth-child(2) {
    z-index: 200;
}

.carousel.prev .list .item:nth-child(2) img {
    animation: outFrame 0.5s linear 1 forwards;
    position: absolute;
    bottom: 0;
    left: 0;
}

@keyframes outFrame {
    to {
        width: 150px;
        height: 220px;
        bottom: 50px;
        left: 50%;
        border-radius: 50px;
    }
}

.carousel.next .arrows button,
.carousel.prev .arrows button {
    pointer-events: none;
}

.carousel.prev .list .item:nth-child(2) .content {
    animation: contentOut 1.5s linear 1 forwards !important;
}

@keyframes contentOut {
    to {
        filter: blur(20px);
        opacity: 0;
    }
}

/* Android TV Leanback Main Content */
#main-content {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100% - 70px);
    overflow: hidden;
    pointer-events: none;
    -webkit-mask-image: 
        linear-gradient(to bottom, 
            transparent 0%,
            transparent 40%,
            black 55%,
            black 90%,
            transparent 100%
        ),
        linear-gradient(to right, 
            transparent 0%,
            black 5%,
            black 95%,
            transparent 100%
        );
    -webkit-mask-composite: source-in;
    mask-image: 
        linear-gradient(to bottom, 
            transparent 0%,
            transparent 40%,
            black 55%,
            black 90%,
            transparent 100%
        ),
        linear-gradient(to right, 
            transparent 0%,
            black 5%,
            black 95%,
            transparent 100%
        );
    mask-composite: intersect;
}

#categories {
    position: absolute;
    top: 520px;
    left: 0;
    right: 0;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    pointer-events: auto;
}

/* Category Section - Leanback Style */
.category {
    margin-bottom: 50px;
    position: relative;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    padding-left: 130px;
    margin-left: 0;
    margin-bottom: 12px;
    color: #e5e5e5;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    display: block;
}

/* Row Container - Netflix Style */
.row {
    display: flex;
    gap: calc(6px * (100vw / 1920));
    padding-left: calc(60px * (100vw / 1920));
    padding-right: calc(60px * (100vw / 1920));
    overflow: hidden;
    position: relative;
    padding-bottom: calc(10px * (100vh / 1080));
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    justify-content: flex-start;
    width: 100%;
}

/* Card Styles - Android TV Leanback */
.card {
    flex: 0 0 calc(140px * (100vw / 1920));
    height: calc(210px * (100vh / 1080));
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    background: #141414;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    will-change: transform;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 50%, transparent 100%);
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.card-info h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 3px 0;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
}

/* Focused Card - Android TV Style */
.card.focused {
    transform: scale(1.15);
    z-index: 100;
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.95),
        0 8px 24px rgba(0, 0, 0, 0.8);
    border-radius: 6px;
}

.card.focused img {
    filter: brightness(1.12) contrast(1.05) saturate(1.05);
}

.card.focused .card-info {
    opacity: 1;
    transform: translateY(0);
}

/* Unfocused Cards in Focused Row */
.row.focused-row .card:not(.focused) {
    transform: scale(0.92);
    opacity: 1;
}

.row.focused-row .card:not(.focused) img {
    filter: brightness(0.55) saturate(0.75);
}

/* Unfocused Rows */
.category:not(.focused-category) {
    opacity: 1;
}

.category:not(.focused-category) .card {
    transform: scale(0.90);
    opacity: 1;
}

.category:not(.focused-category) .card img {
    filter: brightness(0.45) saturate(0.6);
}

/* Focused Category */
.category.focused-category {
    opacity: 1;
}

/* Card Hover Effect (for mouse) */
.card:hover {
    transform: scale(1.08);
}

.card:hover .card-info {
    opacity: 1;
    transform: translateY(0);
}

/* Movie Modal Styles - StreamHub Design */
.movie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
}

.movie-modal.active {
    display: flex !important;
    opacity: 1;
}

/* Side Cards (Previous/Next) - Exact same size as main modal */
.side-card {
    position: fixed;
    width: 70%;
    max-width: 1100px;
    height: 80vh;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 90;
    pointer-events: none;
    display: block;
}

.modal-content.fullscreen ~ .side-card {
    display: none;
}

/* Shifting animation for carousel navigation */
.movie-modal.shifting .modal-content,
.movie-modal.shifting .side-card {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s ease;
}

/* Parallax effect - backgrounds move slower */
.movie-modal.shifting .modal-background {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.movie-modal.active .side-card {
    opacity: 1;
    display: block !important;
}

.side-card-prev {
    left: calc(50% - 35% - 550px - 30px);
    z-index: 90;
}

.side-card-next {
    right: calc(50% - 35% - 550px - 30px);
    z-index: 90;
}

/* Side cards background styles */
.side-card .modal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
    filter: blur(5px) brightness(0.5);
}

.side-card .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
}

.side-card .modal-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    z-index: 3;
}

.side-card .modal-body {
    display: none;
}

.modal-content .modal-body > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content.animate-content .modal-body > * {
    opacity: 1;
    transform: translateY(0);
}

.modal-content.animate-content .modal-body > *:nth-child(1) {
    transition-delay: 0.4s;
}

.modal-content.animate-content .modal-body > *:nth-child(2) {
    transition-delay: 0.5s;
}

.modal-content.animate-content .modal-body > *:nth-child(3) {
    transition-delay: 0.6s;
}

.modal-content.animate-content .modal-body > *:nth-child(4) {
    transition-delay: 0.7s;
}

.modal-content.animate-content .modal-body > *:nth-child(5) {
    transition-delay: 0.8s;
}

.movie-modal.closing {
    opacity: 0;
    transition: opacity 0.4s ease 0.1s;
}

.movie-modal.closing .side-card {
    opacity: 0;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1344px; /* 70% of 1920px */
    max-width: 1344px;
    height: 864px; /* 80% of 1080px */
    z-index: 100;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width, height;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.modal-content.fullscreen {
    width: 1920px !important;
    max-width: 1920px !important;
    height: 1080px !important;
    border-radius: 0 !important;
    z-index: 200;
}

.modal-content.fullscreen .back-btn {
    display: none;
}

.modal-content.closing {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0.3) 70%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 2;
}

.modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding-top: 40px;
    z-index: 100;
}

.back-btn {
    background: rgba(42, 42, 42, 0.9);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    width: 48px;
    height: 48px;
    border-radius: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
}

.back-btn.show {
    pointer-events: auto;
    animation: fadeIn 0.6s ease-out forwards, bounceUp 1.5s ease-in-out 0.6s infinite;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes bounceUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

.back-btn:hover,
.back-btn:focus {
    background: rgba(62, 62, 62, 0.95);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.arrow-up {
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    z-index: 3;
    color: white;
}

.movie-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.movie-meta {
    font-size: 18px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.movie-synopsis {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.movie-actors {
    margin-bottom: 30px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.actors-label {
    font-weight: bold;
    margin-right: 10px;
}

.modal-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.play-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: black;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.play-icon {
    font-size: 18px;
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.add-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.add-icon {
    font-size: 18px;
    font-weight: bold;
}

/* Removed modal navigation buttons */

/* Flying Animation for Card Transitions */
.flying {
    position: fixed !important;
    z-index: 1000 !important;
    transition: all 0.6s ease-in-out;
    pointer-events: none;
}


