/* ═══════════════════════════════════════════════════════
   CINEMATT — Combined stylesheet
   ═══════════════════════════════════════════════════════ */

/* ── Reset / Global ──────────────────────────────────── */

html {
    margin: 0;
    background-color: #000000;
    zoom: 1;
}

@media (min-width: 768px) {
    html { zoom: 1; }
}

@media (min-width: 768px) and (max-width: 1100px) and (orientation: portrait) {
    html { zoom: 1.05; }
}

html, body {
    height: 100%;
    margin: 0;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overscroll-behavior: none;
}

body {
    background-color: black;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
    overflow: auto;
    text-transform: uppercase;
}

body::-webkit-scrollbar { width: 0px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb {
    background-color: transparent;
    border: 0px solid transparent;
}

body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.disable-scroll { overflow: hidden; }

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

li {
    display: block;
    margin-bottom: 5px;
}

li:first-child { margin-top: 0px; margin-left: 0px; }
li:last-child { margin-bottom: 0px; }

/* ── Header ──────────────────────────────────────────── */

.header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background-color: #000000;
    padding: 5px;
    z-index: 1001;
    margin-bottom: -14px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
}

.logo-link { display: contents; }
.logo-link .logo { cursor: pointer; }

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 305px;
    height: auto;
    display: block;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
}

/* Apply offset ONLY on small screens (iPhone SE etc) */
@media (max-width: 414px) {
    .logo {
        left: calc(50% + 25px);
        width: 275px;
    }
}

/* Keep your smaller logo size rule */
@media (max-width: 374px) {
    .logo {
        width: 410px;
    }
}

@media (max-width: 430px) {
    body.nav-open .hamburger-menu { left: 1.5px; }
}

@media (max-width: 360px) {
    .logo {
        width: 220px;
    }
}

.hamburger-menu {
    margin-left: 2.5px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    left: 2px;
    flex-shrink: 0;
}

.hamburger-menu:hover,
.hamburger-menu.no-scale:hover {
    transform: scale(1);
}

.line1, .line2, .line3 {
    width: 40px;
    height: 4px;
    margin: 8px 0;
}

.line1 { background-color: #DB202C; }
.line2 { background-color: #ffffff; }
.line3 { background-color: #DB202C; }

/* ── Navigation ──────────────────────────────────────── */

.navigation {
    display: none;
    background-color: #000000;
    padding: 4px;
    height: auto;
    position: fixed;
    top: 69.5px !important;
    left: 9px !important;
    width: 205px;
    box-sizing: border-box;
    z-index: 9999 !important;
    opacity: 0;
    transition: opacity 0.1s ease;
    border-top: 0px;
    border-bottom: 0px solid #c40a0a;
    border-radius: 0;
}

.navigation.show {
    display: flex;
    flex-direction: column;
    opacity: 1;
    border: 2px solid rgba(71, 66, 66, 0.812);
    border-radius: 0;
    left: 9px !important;
    margin-left: 0 !important;
    gap: 1px;
    width: 240px;
    background: #000000;
    font-family: 'Nunito', sans-serif;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    max-height: calc(100vh - 75px);
    z-index: 9999 !important;
    will-change: transform;
}

.navigation ul li a,
.back-button a,
.search-box {
    background-color: transparent;
    width: 100%;
    height: 34px;
    line-height: normal;
    box-sizing: border-box;
    border: 2px solid rgba(71, 66, 66, 0.812);
    padding: 5px;
    margin-top: 1.5px;
    margin-bottom: 2px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-decoration: none;
    color: #DB202C;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    font-size: 13px;
    transition: color 0.3s ease;
    border-radius: 0;
    text-transform: uppercase;
}

.navigation li a,
.back-button a {
    border: 2px solid white;
    box-sizing: border-box;
    width: 100%;
    padding: 5px;
    margin: 0;
    border-radius: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-decoration: none;
    color: #DB202C;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    transition: color 0.3s ease;
}

.navigation li a.top-back-button {
    color: #ffffff !important;
}

.navigation li.active a {
    background-color: #000000;
    color: #ffffff;
    pointer-events: none;
}

.navigation ul li.active a:hover::before {
    content: '\00a0';
    display: inline-block;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 0);
}

.search-box {
    color: white;
    box-sizing: border-box !important;
    width: 100% !important;
}

.search-box::placeholder {
    color: #a9a9a9;
    font-size: 12.5px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Nunito', sans-serif;
    font-style: normal;
    text-align: left;
}

.search-box:focus {
    font-size: 13px;
    outline: none;
}

.navigation-open .image-container,
.nav-open .image-container { margin-left: 200px; }
.navigation-open .navigation,
.nav-open .navigation { width: 200px; }

#sort-title-toggle {
    text-align: left;
    padding-left: 5px;
    display: inline-block;
    color: #00A8E1;
    height: 34px;
    margin-top: 0px;
    margin-bottom: 0px;
    border: 2px solid white;
    box-sizing: border-box;
    width: 100%;
}

#sort-toggle {
    text-align: left;
    padding-left: 5px;
    display: inline-block;
    color: #00A8E1;
    height: 34px;
    margin-top: 1px;
    margin-bottom: 4px;
    border: 2px solid white;
    box-sizing: border-box;
    width: 100%;
}

.imdb-text {
    text-transform: none;
    color: #f3ce13;
}

/* ── Poster Grid ─────────────────────────────────────── */

.image-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(10.5% - 20px), 1fr));
    gap: 3px;
    padding: 4px;
    padding-left: 9px;
    padding-right: 9px;
    max-width: calc(100% - 10px);
    position: relative;
    margin-top: 66.5px;
    opacity: 1;
    transition: opacity 0.5s ease, margin-left 0.5s ease;
}

.image-container a {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 0px;
    padding: 0;
    position: relative;
    text-align: center;
    text-decoration: none;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.image-container .caption {
    color: #DB202C;
    font-size: 12px;
    font-family: 'Nunito', sans-serif;
    background-color: #000000;
    padding: 1px;
}

.caption {
    color: #DB202C;
    font-size: 10px;
    font-family: 'Nunito', sans-serif;
    background-color: #000000;
    padding: 2px;
}

.image-caption {
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
    position: absolute;
    bottom: 0;
    left: 0px;
}

@media (min-width: 1201px) {
    .caption { font-size: 12px; }
    .image-container .caption { font-size: 12px; }
}

/* ── Responsive grid breakpoints ─────────────────────── */

@media only screen and (max-width: 320px) and (orientation: portrait) {
    .image-container { grid-template-columns: repeat(2, 1fr); }
}
@media only screen and (min-width: 321px) and (max-width: 414px) and (orientation: portrait) {
    .image-container { grid-template-columns: repeat(3, 1fr); }
}
@media only screen and (min-width: 415px) and (max-width: 480px) and (orientation: portrait) {
    .image-container { grid-template-columns: repeat(3, 1fr); }
}
@media only screen and (min-width: 481px) and (max-width: 767px) and (orientation: portrait) {
    .image-container { grid-template-columns: repeat(6, 1fr); }
}
@media only screen and (max-width: 667px) and (orientation: landscape) {
    .image-container { grid-template-columns: repeat(6, 1fr); }
}
@media only screen and (min-width: 668px) and (max-width: 896px) and (orientation: landscape) {
    .image-container { grid-template-columns: repeat(6, 1fr); }
}
@media only screen and (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
    .image-container { grid-template-columns: repeat(7, 1fr); }
}
@media only screen and (min-width: 835px) and (max-width: 1024px) and (orientation: portrait) {
    .image-container { grid-template-columns: repeat(7, 1fr); }
}
@media only screen and (min-width: 1025px) and (max-width: 1366px) and (orientation: portrait) {
    .image-container { grid-template-columns: repeat(7, 1fr); }
}
@media only screen and (min-width: 897px) and (max-width: 1024px) and (orientation: landscape) {
    .image-container { grid-template-columns: repeat(7, 1fr); }
}
@media only screen and (min-width: 1025px) and (max-width: 1180px) and (orientation: landscape) {
    .image-container { grid-template-columns: repeat(7, 1fr); }
}
@media only screen and (min-width: 1181px) and (max-width: 1366px) and (orientation: landscape) {
    .image-container { grid-template-columns: repeat(7, 1fr); }
}
@media only screen and (min-width: 1024px) and (max-width: 1280px) {
    .image-container { grid-template-columns: repeat(8, 1fr); }
}
@media only screen and (min-width: 1281px) and (max-width: 1440px) {
    .image-container { grid-template-columns: repeat(9, 1fr); }
}
@media only screen and (min-width: 1441px) and (max-width: 1600px) {
    .image-container { grid-template-columns: repeat(10, 1fr); }
}
@media only screen and (min-width: 1601px) and (max-width: 1920px) {
    .image-container { grid-template-columns: repeat(11, 1fr); }
}
@media only screen and (min-width: 1921px) and (max-width: 2560px) {
    .image-container { grid-template-columns: repeat(12, 1fr); }
}
@media only screen and (min-width: 2561px) and (max-width: 3840px) {
    .image-container { grid-template-columns: repeat(16, 1fr); }
}
@media only screen and (min-width: 3841px) {
    .image-container { grid-template-columns: repeat(20, 1fr); }
}

@media (max-width: 680px) and (orientation: portrait) {
    .image-container {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 700px) and (orientation: landscape) {
    .image-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1024px) {
    .navigation-open .image-container,
    .nav-open .image-container { margin-left: 0; }
    .navigation-open .navigation,
    .nav-open .navigation { width: 200px; }
}


@media (max-width: 261px) {
    .caption { max-width: 100%; }
}

/* ── Overlay / Popup ─────────────────────────────────── */

.overlay {
    display: none;
    position: fixed;
    top: 65px;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: flex-start;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.overlay.overlay-visible {
    opacity: 1;
}

.overlay-wrapper {
    width: 100%;
    max-width: 620px;
    padding: 0 12px;
    box-sizing: border-box;
}

.overlay-content {
    background: #000000;
    padding: 14px 16px 12px;
    border-radius: 0;
    text-align: center;
    color: white;
    width: 100%;
    box-sizing: border-box;
    border: 2px solid rgba(71, 66, 66, 0.812);
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: hidden;
}

#movie-title {
    font-family: 'Nunito', sans-serif;
    font-weight: bolder;
    color: #DB202C;
    font-size: 20px;
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 10px;
}

#movie-description {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 10px;
    max-height: 120px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#movie-description::-webkit-scrollbar { display: none; }

#movie-imdb-rating {
    display: none;
    margin-top: 6px;
    margin-bottom: 6px;
    font-family: 'Nunito', sans-serif;
    color: #ffffff;
}

button {
    cursor: pointer;
    border-radius: 0;
    font-size: 13px;
    font-weight: bolder;
    padding: 8px;
    margin: 3px;
    text-transform: uppercase;
    font-family: 'Nunito', sans-serif;
    border: 2px solid rgba(71, 66, 66, 0.812);
    box-sizing: border-box;
    width: calc(33.33% - 10px);
}

.play-button {
    background-color: #DB202C;
    color: #ffffff;
    border: 2px solid rgba(71, 66, 66, 0.812);
}

.trailer-button {
    background-color: #1ce783;
    color: #000000;
    border: 2px solid rgba(71, 66, 66, 0.812);
}

#show-cast {
    background-color: #00A8E1;
    color: #000000;
    font-weight: bolder;
    font-family: 'Nunito', sans-serif;
    border: 2px solid rgba(71, 66, 66, 0.812);
    transition: none !important;
}

#show-rating {
    background-color: #f3ce13;
    color: #000000;
    font-weight: bolder;
    border: 2px solid rgba(71, 66, 66, 0.812);
}

#watchlist-btn {
    background-color: #ce569c;
    color: #000000;
    font-weight: bolder;
    border: 2px solid rgba(71, 66, 66, 0.812);
}

#close-overlay {
    background-color: #ffffff;
    color: #000000;
    font-weight: bolder;
    border: 2px solid rgba(71, 66, 66, 0.812);
}

.cm-btn-active {
    border-color: white !important;
}

#overlay-buttons {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.video-container {
    display: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.disabled-button {
    background-color: gray;
    color: white;
    pointer-events: none;
}

@media (max-width: 480px) {
    button {
        width: calc(33.33% - 10px);
        font-size: 10px;
        padding: 10px 2px;
    }
}

body.landscape-overlay-open .header,
body.landscape-overlay-open .navigation {
    display: none !important;
}

body.landscape-overlay-open .overlay-wrapper {
    padding: 0 60px;
    max-width: 620px;
}
body.landscape-overlay-open .overlay-content {
    padding: 12px 14px;
    height: auto;
    overflow: visible;
}
body.landscape-overlay-open #movie-title {
    font-size: 18px;
    margin-bottom: 8px;
}
body.landscape-overlay-open #movie-description {
    font-size: 12px;
    margin-bottom: 10px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
}
body.landscape-overlay-open #movie-imdb-rating {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 12px;
}
body.landscape-overlay-open button {
    font-size: 11px;
    padding: 11px 4px;
    margin: 3px;
}

@media (max-height: 500px) and (orientation: landscape) {
    .overlay {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .overlay-wrapper {
        padding: 0 8px;
    }
    .overlay-content {
        padding: 6px 10px;
        height: auto;
        overflow: visible;
    }
    #movie-title {
        font-size: 14px;
        margin-bottom: 4px;
    }
    #movie-description {
        font-size: 10px;
        margin-bottom: 6px;
        line-height: 1.3;
        flex: none;
        overflow: visible;
    }
    #movie-imdb-rating {
        margin-top: 4px;
        margin-bottom: 4px;
        font-size: 11px;
    }
    button {
        font-size: 9px;
        padding: 5px 2px;
        margin: 2px;
    }
    .video-container {
        max-height: 55vw;
    }
}

/* ── Subtitles ───────────────────────────────────────── */

::cue {
    background-color: rgba(0, 0, 0, 0.82);
    color: #ffffff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8em;
    line-height: 1.5;
}

/* ── Video Player ────────────────────────────────────── */

.video-wrapper {
    position: absolute;
    inset: 0;
    line-height: 0;
}

.video-wrapper video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.video-wrapper video:fullscreen,
.video-wrapper video:-webkit-full-screen {
    object-fit: contain;
}

.video-wrapper video::-webkit-media-controls-overlay-play-button {
    display: none;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.video-play-btn {
    width: 72px;
    height: 72px;
    background: rgba(219, 32, 44, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    transition: background 0.2s ease, transform 0.2s ease;
    letter-spacing: 2px;
}

.video-play-overlay:hover .video-play-btn {
    background: rgba(219, 32, 44, 1);
    transform: scale(1.1);
}


