/* ======================================
   RESET DASAR & GAYA UMUM
====================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
    overflow-y: hidden;
    width: 100vw;
    height: 100vh;
}

/* ======================================
   HALAMAN UTAMA - DAFTAR FILM
====================================== */
.feed-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 65px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    z-index: 10;
}

.feed-container::-webkit-scrollbar {
    display: none;
}

.movie-card {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.load-more-card {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.load-more-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 15px 35px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,255,255,0.2);
    transition: transform 0.2s;
}

.load-more-btn:active {
    transform: scale(0.95);
}

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

.top-title {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-align: center;
    width: 90%;
    text-shadow: 0 4px 12px rgba(0,0,0,0.9);
}

.play-btn-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    cursor: pointer;
}

.play-circle {
    width: 85px;
    height: 85px;
    background: rgba(255, 255, 255, 0.15);
    border: 2.5px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.main-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    margin-bottom: 70px;
}

.side-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 60px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.action-item span {
    font-size: 0.75rem;
    margin-top: 4px;
    color: #eee;
    text-align: center;
}

/* ======================================
   KOMPONEN UMUM - SEARCH
====================================== */
.search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 65px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 310;
    display: flex;
    align-items: center;
    padding: 0 20px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    border-bottom: 1px solid #222;
}

.search-container.show {
    transform: translateY(0);
}

.search-box {
    width: 100%;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #2c2c2e;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 14px;
}

.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding-left: 10px;
    font-size: 1rem;
    outline: none;
}

.search-results-layer {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    bottom: 65px;
    background: rgba(0,0,0,0.9);
    z-index: 299;
    display: none;
    overflow-y: auto;
}

.search-results-layer.active {
    display: block;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
}

.search-header h4 {
    margin: 0;
    color: #ffdd57;
    font-size: 16px;
}

.close-search {
    background: #2d2d2d;
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.search-item-row {
    display: flex;
    gap: 15px;
    padding: 12px 10px;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    border-radius: 6px;
}

.search-item-row:hover {
    background: rgba(255,255,255,0.05);
}

.search-item-thumb {
    width: 65px;
    height: 95px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: #222;
    flex-shrink: 0;
}

.search-item-info h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
}

.search-item-info p {
    margin: 3px 0;
    font-size: 13px;
    color: #cccccc;
}

/* ======================================
   NAVIGASI BAWAH
====================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 65px;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255,255,255,0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 300;
    padding-bottom: 0;
    margin-top: 0;
    transition: transform 0.3s;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #aaa;
    cursor: pointer;
    font-size: 0.75rem;
    width: 60px;
    transition: color 0.2s;
    gap: 4px;
}

.nav-item.active,
.nav-item:hover {
    color: #ffdd57;
}

.nav-item span {
    margin-top: 4px;
}

/* Khusus untuk tombol instalasi PWA - tidak bentrok dengan navigasi lain */
#installPwaBtn {
    display: none; /* Sembunyikan dulu sampai siap instalasi */
}

/* Sesuaikan warna ikon agar selaras dengan navigasi */
#installPwaBtn i {
    color: inherit !important;
}

/* ======================================
   PANEL INFO & FORM
====================================== */
.panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 350;
    display: none;
}

.panel-backdrop.active {
    display: block;
}

.info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 400px;
    background: #1a1a1a;
    border-radius: 12px;
    z-index: 360;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
}

.info-panel.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.panel-content {
    padding: 0;
}

.panel-content i {
    color: #fff;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #ffdd57;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.form-group textarea {
    resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 1px solid #ffdd57;
}

.submit-btn {
    background: #ffdd57;
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-top: 5px;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #ffeb99;
}

/* ======================================
   ✅ PANEL KOMENTAR
====================================== */
.comments-panel {
    position: fixed;
    bottom: 65px;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 250;
    transform: translateY(calc(100% - 40px));
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: calc(100vh - 65px);
}

.comments-panel.open {
    transform: translateY(0);
}

.comments-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comments-header h5,
.comments-header span {
    font-size: 14px;
    font-weight: 500;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comments-header .close-comments {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 0;
    pointer-events: none;
}

.comments-panel.open .close-comments {
    opacity: 1;
    pointer-events: auto;
}

.comments-header .close-comments:hover {
    background: rgba(255, 255, 255, 0.2);
}

.comments-section {
    width: 100%;
}

.comments-list-container {
    max-height: calc(100vh - 65px - 40px);
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comments-list-container::-webkit-scrollbar {
    width: 4px;
}

.comments-list-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.comments-list-container::-webkit-scrollbar-thumb {
    background: rgba(255,221,87,0.4);
    border-radius: 2px;
}

.comment-item {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px 15px;
    border-left: 2px solid #ffdd57;
}

.comment-author,
.comment-name {
    font-weight: 600;
    color: #ffdd57;
    font-size: 14px;
    margin-bottom: 6px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: #f0f0f0;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.comment-time,
.comment-date {
    font-size: 11px;
    color: #888;
    text-align: right;
    margin-top: 6px;
}

.empty-comments {
    text-align: center;
    padding: 30px;
    color: #888;
    font-style: italic;
}

/* ======================================
   HALAMAN WATCH.HTML
====================================== */
.watch-layout {
    position: relative;
    width: 100%;
    min-height: 100vh;
    height: calc(100vh - 65px);
    margin-bottom: 0;
    padding-bottom: 0;
}

.video-main-wrapper {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
    overflow: hidden;
}

.video-main-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
}

.watermark-logo {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 200;
    opacity: 0.7;
    pointer-events: none;
    transition: all 0.3s ease;
}

.watermark-logo img {
    width: 40px;
    height: auto;
    display: block;
    background-color: #ffffff;
    padding: 2px;
    border-radius: 4px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* ✅ SUBTITLE + KONTROL: IKUT NAIK TURUN SESUAI PANEL KOMENTAR */
.subtitle-layer {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 100%;
    z-index: 999999;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding: 10px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.comments-panel.open ~ .watch-layout .subtitle-layer {
    transform: translateY(-100%);
}

.subtitle-text {
    text-align: center;
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 500;
    color: #ffff00;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    margin-bottom: 12px;
    min-height: 28px;
    background: rgba(0, 0, 0, 0.75);
    padding: 5px 12px;
    border-radius: 4px;
    max-width: 90%;
    word-wrap: break-word;
    pointer-events: auto;
}

.subtitle-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.85);
    padding: 6px 14px;
    border-radius: 30px;
    box-shadow: 0 0 12px rgba(0,0,0,0.6);
    pointer-events: auto;
}

.ctrl-btn {
    background: #ffdd57;
    border: none;
    color: #000;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover {
    background: #fff280;
    transform: scale(1.08);
}

.time-digital {
    background: rgba(0,0,0,0.6);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-family: monospace;
    min-width: 90px;
    text-align: center;
    color: #ffdd57;
    font-weight: 600;
}

/* Penyesuaian Layar Penuh */
.video-main-wrapper:fullscreen,
.video-main-wrapper:-webkit-full-screen,
.video-main-wrapper:-moz-full-screen,
.video-main-wrapper:-ms-fullscreen {
    background: #000;
}

.video-main-wrapper:fullscreen .subtitle-layer,
.video-main-wrapper:-webkit-full-screen .subtitle-layer,
.video-main-wrapper:-moz-full-screen .subtitle-layer,
.video-main-wrapper:-ms-fullscreen .subtitle-layer {
    bottom: 8%;
    transform: translateY(0) !important;
    z-index: 999999;
}

.video-main-wrapper:fullscreen .watermark-logo,
.video-main-wrapper:-webkit-full-screen .watermark-logo,
.video-main-wrapper:-moz-full-screen .watermark-logo,
.video-main-wrapper:-ms-fullscreen .watermark-logo {
    top: 25px;
    right: 25px;
}

/* ======================================
   FITUR TAMBAHAN
====================================== */
/* --- OVERLAY UTAMA --- */
.desktop-notifier {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999999;
  padding: 20px;
  backdrop-filter: blur(8px);
}

/* --- KARTU SELEBARAN (BERBENTUK KERTAS FLYER BERSIH) --- */
.notifier-promo-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background-size: cover;
  background-position: center;
  border-radius: 12px; /* Membuat sudut kertas melengkung natural */
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7); /* Efek bayangan kertas */
  animation: scaleUpPromo 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUpPromo {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.promo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 40%, rgba(0, 0, 0, 0.6) 100%);
  z-index: 1;
}

.promo-content {
  position: relative;
  z-index: 2;
  padding: 35px 24px 25px 24px;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  text-align: center;
}

/* --- LOGO SITUS DI ATAS --- */
.promo-site-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 15px;
  filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.5));
}

/* --- ELEMEN TEKS --- */
.promo-badge {
  background: #ff4757;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 4px; /* Kotak flat style selebaran */
  letter-spacing: 2px;
  display: inline-block;
  margin-bottom: 12px;
}

.promo-title {
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.promo-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.promo-country {
  font-size: 12px;
  font-weight: 600;
  color: #ffeb3b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.promo-genres {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.promo-genres span {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.promo-sinopsis {
  font-size: 13px;
  color: #ddd;
  line-height: 1.5;
  margin: 0 0 25px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: justify;
}

/* --- TOMBOL --- */
.promo-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-watch-now {
  background: #ff4757; /* Flat red color */
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-watch-now:hover {
  background: #e03747;
}

.btn-close-promo {
  background: transparent;
  color: #bbb;
  border: none;
  padding: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-close-promo:hover {
  color: #fff;
}

/* --- FOOTER SELEBARAN --- */
.promo-footer-brand {
  margin-top: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #ffeb3b;
  letter-spacing: 1px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 12px;
  text-transform: uppercase;
}

@keyframes bounceDown {
    0% { transform: translateY(-150%); opacity: 0; }
    60% { transform: translateY(10%); opacity: 1; }
    80% { transform: translateY(-5%); }
    100% { transform: translateY(0); opacity: 1; }
}

.arrow-actions-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.inline-scroll-arrow {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-scroll-arrow:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1);
}

.inline-load-more {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    width: auto;
    text-align: center;
    pointer-events: auto;
}

.load-more-btn-inline {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 12px 26px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.load-more-btn-inline:hover {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.load-more-btn-inline:active {
    transform: scale(0.95);
}

.video-player-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 200;
    display: none;
}

.video-player-container.active {
    display: block;
}

.video-player-container iframe,
.video-player-container video {
    width: 100%;
    height: 100%;
    border: none;
}

.close-player {
    position: absolute;
    top: 30px;
    right: 20px;
    z-index: 210;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
