/* ============================================================
   GLOBAL RESET + MOBILE OPTIMIZATION
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: "Inter", Arial, sans-serif;
}

body {
    background: #000 url('../Images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    overflow-x: hidden;
    color: #fff;
}

/* Hide scrollbars globally */
body::-webkit-scrollbar,
.movie-grid::-webkit-scrollbar {
    display: none;
}

/* Prevent weird bounce on iOS */
html, body {
    overscroll-behavior: none;
}


/* ============================================================
   TOPBAR (Logo Left + Search Right) — FIXED FOR YOUR HTML
   ============================================================ */
.topbar {
    width: 100%;
    height: 60px;
    background: rgba(10, 10, 10, 0.88);
    display: flex;
    align-items: center;
    justify-content: space-between; /* logo left / search right */
    padding: 0 18px;
    position: fixed;
    top: 0;
    z-index: 200;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

/* LOGO — CENTER VERTICALLY */
.topbar .logo {
    display: flex;
    align-items: center;
}

.topbar .logo img {
    width: 50px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* SEARCH ICON — RIGHT SIDE */
.topbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    cursor: pointer;
}



/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding: 15px;
    padding-top: 80px; /* space for topbar */
    padding-bottom: 120px; /* space for floating nav */
    margin-top: 75px; /* leaves space for search topbar */
}


/* ============================================================
   CATEGORY SECTIONS
   ============================================================ */
.category {
    margin-bottom: 28px;
}

.category h2 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #fff;
    text-shadow: 0 0 6px #000;
}


/* ============================================================
   CAROUSEL (NO BUTTONS ON MOBILE!)
   ============================================================ */
.carousel-container {
    width: 100%;
}

.movie-grid {
    display: flex;
    gap: 14px;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 6px;
}


/* ============================================================
   MOVIE CARD
   ============================================================ */
.movie-card {
    width: 130px;
    flex: 0 0 130px;
    cursor: pointer;
    transition: transform .15s ease;
}

.movie-card:active {
    transform: scale(.94);
}

.movie-card img {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 8px rgba(0,0,0,.7);
}

.movie-card h3,
.movie-card h3 a {
    color: white !important;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    display: block;
    text-align: center;
}

.movie-card h3 a:hover {
    opacity: 0.8;
}


/* ============================================================
   BOTTOM FLOATING NAV (3 ICONS)
   ============================================================ */
.bottom-nav {
    width: 100%;
    height: 70px;
    background: rgba(15, 15, 15, 0.9);
    position: fixed;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: 12px;
    z-index: 300;
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* nav icons */
.bottom-nav img {
    width: 34px;
    height: 34px;
    opacity: 0.9;
    transition: 0.2s ease;
}

.bottom-nav img:active {
    transform: scale(.9);
    opacity: 1;
}

.bottom-nav .center-icon {
    width: 60px;
    height: 60px;
    margin-top: -25px;
    border-radius: 50%;
}


/* ============================================================
   RANDOMIZER PAGE
   ============================================================ */
.randomizer-wrapper {
    padding: 100px 20px 40px;
    color: white;
    text-align: center;
}

#refresh {
    padding: 12px 30px;
    background: #222;
    border-radius: 12px;
    border: 2px solid #444;
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
}

.random-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.random-card {
    background: rgba(0,0,0,0.6);
    border-radius: 12px;
    overflow: hidden;
    padding-bottom: 10px;
}

.random-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.random-card h3 {
    font-size: 16px;
    margin-top: 6px;
}


/* ============================================================
   WATCHLIST FLOAT BUTTON (MOVIE/SHOW PAGE)
   ============================================================ */
.watchlist-btn {
    position: fixed;
    bottom: 100px;
    right: 16px;
    padding: 12px 18px;
    background: #6E65E8;
    border-radius: 40px;
    display: flex;
    align-items: center;
    z-index: 350;
    box-shadow: 0 0 12px rgba(110,101,232,.8);
}


/* ============================================================
   EPISODE SELECTORS
   ============================================================ */
#seasonSelect,
#episodeSelect {
    width: 90%;
    padding: 12px;
    background: #1a1a1a;
    color: white;
    border-radius: 10px;
    margin: 8px auto;
    font-size: 16px;
}

.ep-controls {
    text-align: center;
    margin-top: 12px;
}


/* ============================================================
   SEARCH PAGE INPUT
   ============================================================ */
.search-input {
    width: 94%;
    margin: 90px auto 20px;
    padding: 14px;
    border-radius: 12px;
    background: #222;
    border: 1px solid #333;
    color: #fff;
    font-size: 18px;
}


/* ============================================================
   RESPONSIVE FIXES FOR IPHONE
   ============================================================ */

@media (max-width: 430px) {
    .movie-card {
        width: 120px;
        flex: 0 0 120px;
    }
    .movie-card img {
        height: 185px;
    }
}

@media (max-width: 380px) {
    .movie-card {
        width: 110px;
        flex: 0 0 110px;
    }
    .movie-card img {
        height: 170px;
    }
}


.search-topbar {
    width: 100%;
    background: #111;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0;
    z-index: 150;
    box-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.back-btn {
    width: 28px;
    height: 28px;
    object-fit: contain;
    cursor: pointer;
    filter: invert(1);
}

#mobileSearchInput {
    flex: 1;
    padding: 12px 16px;
    font-size: 17px;
    border-radius: 10px;
    border: none;
    background: #222;
    color: white;
}

/* ============================
   RANDOMIZER PAGE STYLES
   ============================ */
.randomizer {
    padding-bottom: 80px;
    text-align: center;
}

/* Randomize Button */
.randomize-btn {
    margin: 20px auto;
    padding: 14px 26px;
    font-size: 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff0066, #ff4d4d);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 4px 18px rgba(255, 0, 80, 0.4);
}

.randomize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 0, 80, 0.55);
}

.randomize-btn:active {
    transform: scale(0.97);
}

/* Spin animation for button click */
.randomize-btn.spin {
    animation: spinBtn 0.45s ease;
}

@keyframes spinBtn {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}

/* 3 per row same as search */
.randomizer .movie-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 10px 0;
}
/* ==========================================
   WATCHLIST PAGE (Mobile)
   ========================================== */

.watchlist-page {
    padding-bottom: 80px;
    text-align: center;
}

.watchlist-title {
    color: white;
    text-align: center;
    font-size: 26px;
    margin-bottom: 20px;
}

/* Empty state */
.empty-watchlist {
    color: #bbb;
    text-align: center;
    width: 100%;
    font-size: 18px;
    margin-top: 40px;
}

/* Card layout (same as search/randomizer) */
.movie-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* Watchlist card */
.watch-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 10px;
    width: 160px;
    text-align: center;
    transition: 0.25s ease;
}

.watch-card:hover {
    transform: translateY(-5px) scale(1.03);
}

/* Poster */
.watch-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: 0.25s ease;
}

.watch-img:hover {
    transform: scale(1.05);
}

/* Title */
.watch-title {
    color: white;
    font-size: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    height: 38px;
    overflow: hidden;
}

/* Remove button */
.remove-btn {
    background: #ff4455;
    border: none;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: 0.25s ease;
}

.remove-btn:hover {
    background: #ff6677;
    transform: scale(1.05);
}
/* ==========================================
   REMOVE CONFIRMATION MODAL
========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1f1f1f;
    padding: 25px;
    width: 85%;
    max-width: 340px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    animation: popup 0.25s ease;
}

@keyframes popup {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.modal-text {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
}

/* Buttons */
.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 14px 0;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.modal-btn.cancel {
    background: #444;
    color: #fff;
}

.modal-btn.cancel:hover {
    background: #555;
}

.modal-btn.confirm {
    background: #ff4444;
    color: #fff;
}

.modal-btn.confirm:hover {
    background: #ff6666;
}
/* =========================
   MOVIE PAGE MOBILE
   ========================= */

.moviepage .player-wrap {
    padding: 14px 16px 8px;
}

.movie-iframe {
    width: 100%;
    height: 40vh; /* shorter and more horizontal on phones */
    border-radius: 12px;
    border: none;
    background: #000;
}

.carousel-nav {
    display: none;
}

/* Server buttons */
.servers {
    display:flex;
    gap: 10px;
    justify-content:center;
    padding: 10px 16px;
    margin-top: 8px;
}

.server-btn {
    padding: 10px 14px;
    border-radius: 10px;
    background: #222;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.04);
    font-size: 15px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s;
}

.server-btn.server-active {
    background: #6E65E8;
    box-shadow: 0 8px 20px rgba(110,101,232,0.14);
    transform: translateY(-2px);
}

/* Title/meta */
.movie-meta {
    padding: 10px 16px;
    text-align: left;
}

.moviepage-title {
    color: #fff;
    font-size: 20px;
    margin-bottom: 6px;
    line-height: 1.15;
}

.moviepage-sub {
    color: #bbb;
    font-size: 13px;
}

/* Watchlist action button */
.watchlist-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 14px auto;
    padding: 12px 18px;
    border-radius: 14px;
    background: linear-gradient(90deg,#222,#2a2a2a);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
    width: calc(100% - 40px);
    max-width: 420px;
    justify-content: center;
}

/* when in watchlist */
.watchlist-action.in-watchlist {
    background: linear-gradient(90deg,#3a1f1f,#6e2a2a);
    box-shadow: 0 8px 22px rgba(110,30,30,0.18);
}

/* icon size */
.watchlist-action .w-icon svg { width: 20px; height: 20px; }

/* Watch More carousel */
.watch-more { padding: 12px 0 80px; } /* leave room for bottom nav */

.carousel-container {
    position: relative;
    display:flex;
    align-items:center;
    gap: 8px;
    padding: 8px 12px;
}

.carousel-track {
    display:flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* hide native scrollbar */
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-card {
    width: 140px;
    flex: 0 0 140px;
    background: rgba(0,0,0,0.25);
    border-radius: 10px;
    padding-bottom: 8px;
    text-align: center;
}

.carousel-card img {
    width:100%;
    height:200px;
    object-fit:cover;
    border-top-left-radius:10px;
    border-top-right-radius:10px;
}

.carousel-card h3 {
    font-size: 13px;
    color: white;
    padding: 8px 6px;
    line-height: 1.2;
}

/* nav arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 20px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor: pointer;
}

.carousel-nav.left { left: 6px; }
.carousel-nav.right { right: 6px; }

/* Toast (notification) - appears above bottom-nav center */
.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    bottom: 72px; /* sits just above bottom-nav */
    background: rgba(255,255,255,0.96);
    color: #111;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

/* visible state - moves up ~15px and visible */
.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-15px);
}

/* hidden state */
.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
}

/* responsive tweaks */
@media (min-width: 700px) {
    .movie-iframe { height: 60vh; }
    .carousel-card { width: 160px; flex: 0 0 160px; }
}
/* =========================
   CUSTOM EPISODE/SEASON BUTTONS FOR MOBILE
========================= */
.ep-btn-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
}

.ep-btn {
    padding: 12px 18px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 12px;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    flex: 1 0 28%; /* roughly 3 per row */
    text-align: center;
    transition: 0.2s ease;
}

.ep-btn.active {
    background: #6E65E8;
    border-color: #6E65E8;
}

.ep-btn:hover {
    background: #333;
}
/* =========================
   MOBILE-FRIENDLY DROPDOWN FOR SERIES PAGE
========================= */

/* Bigger select boxes for touch devices */
#seasonSelect, #episodeSelect {
    width: 90%;
    padding: 16px 12px;       /* more tappable area */
    font-size: 18px;           /* bigger text */
    border-radius: 14px;
    margin: 12px auto;
    background: #1a1a1a;
    color: white;
    border: 2px solid #555;
    appearance: none;          /* remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    text-align: center;
}

/* Add a custom arrow using background image */
#seasonSelect::-ms-expand,
#episodeSelect::-ms-expand {
    display: none;
}

#seasonSelect {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="white"><polygon points="0,0 12,0 6,6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

#episodeSelect {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="white"><polygon points="0,0 12,0 6,6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

/* Optional: active/focus styles */
#seasonSelect:focus, #episodeSelect:focus {
    border-color: #6E65E8;
    outline: none;
}

/* =========================
   WATCH MORE CAROUSEL: touch scrolling
========================= */
#watchMoreTrack {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */
    padding: 6px 0;
}

/* Home page horizontal carousel */
.carousel-grid {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 14px;
    scroll-behavior: smooth;https://image.tmdb.org/t/p/w500/d8Ryb8AunYAuycVKDp5HpdWPKgC.jpg
    -webkit-overflow-scrolling: touch;
    padding-left: 0 !important;
    margin-left: 0 !important;
    scroll-padding-left: 0;
}

.carousel-grid::-webkit-scrollbar {
    display: none;
}

/* Wrapped grid for search/randomizer/watchlist */
.movie-grid.wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px;
}
.carousel-container {
    overflow: hidden;
}

.carousel-grid .movie-card {
    flex: 0 0 auto !important;
}

