/* ===== RESET & BASE ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  --bg:#0d0d0f;
  --bg2:#161618;
  --bg3:#1e1e22;
  --card:#1c1c20;
  --border:#2a2a30;
  --accent:#e50914;
  --text:#f0f0f0;
  --text2:#a0a0b0;
  --text3:#606070;
  --radius:12px;
  --shadow:0 4px 24px rgba(0,0,0,.5);
  --nav-h:64px;
}

html{scroll-behavior:smooth;overflow-x:hidden}
body{background:var(--bg);color:var(--text);font-family:'Inter',sans-serif;min-height:100vh;overflow-x:hidden}

/* ===== NAVBAR ===== */
.navbar{
  position:sticky;top:0;z-index:500;
  background:rgba(13,13,15,.96);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}

.nav-container{
  max-width:1400px;margin:0 auto;
  display:grid;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;gap:1rem;
  height:var(--nav-h);padding:0 1.25rem;
}

.nav-brand{
  font-size:1.25rem;font-weight:700;
  color:var(--accent);text-decoration:none;
  white-space:nowrap;letter-spacing:-.5px;
}

/* Search — kolom tengah, terpusat */
.nav-search{
  display:flex;gap:.4rem;
  justify-content:center;
  min-width:0;
}
.nav-search input{
  width:360px;max-width:100%;
  background:var(--bg3);border:1px solid var(--border);
  color:var(--text);padding:.45rem .9rem;
  border-radius:8px;font-size:.88rem;outline:none;
  transition:border-color .2s;
}
.nav-search input:focus{border-color:var(--accent)}
.nav-search button{
  flex-shrink:0;
  background:var(--accent);color:#fff;border:none;
  padding:.45rem 1rem;border-radius:8px;
  cursor:pointer;font-weight:600;font-size:.88rem;
  white-space:nowrap;transition:background .2s;
}
.nav-search button:hover{background:#c00710}

/* ===== DESKTOP MENU ===== */
.nav-menu{
  list-style:none;display:flex;align-items:center;gap:.1rem;flex-shrink:0;
}

.nav-home-btn{
  display:flex;align-items:center;
  color:var(--text2);text-decoration:none;
  padding:.4rem .7rem;border-radius:8px;
  font-size:.85rem;font-weight:500;white-space:nowrap;
  transition:all .2s;
}
.nav-home-btn:hover{background:var(--bg3);color:var(--text)}

.has-dropdown{position:relative}

.dropdown-toggle{
  display:flex;align-items:center;gap:.3rem;
  background:none;border:none;color:var(--text2);
  cursor:pointer;padding:.4rem .7rem;border-radius:8px;
  font-size:.85rem;font-weight:500;white-space:nowrap;
  transition:all .2s;
}
.dropdown-toggle:hover,.has-dropdown.open .dropdown-toggle{
  background:var(--bg3);color:var(--text);
}
.arrow{font-size:.6rem;transition:transform .25s;display:inline-block}
.has-dropdown.open .arrow{transform:rotate(180deg)}

/* Dropdown panel */
.dropdown{
  position:absolute;top:calc(100% + 6px);left:0;
  background:var(--bg2);border:1px solid var(--border);
  border-radius:10px;min-width:170px;
  max-height:360px;overflow-y:auto;
  box-shadow:0 12px 40px rgba(0,0,0,.6);
  z-index:600;list-style:none;padding:.35rem 0;
  opacity:0;visibility:hidden;
  transform:translateY(-8px);
  transition:opacity .2s,transform .2s,visibility .2s;
}
.has-dropdown.open .dropdown{
  opacity:1;visibility:visible;transform:translateY(0);
}
/* Wide dropdown: 2-column grid */
.dropdown-wide{
  min-width:300px;
  display:grid;grid-template-columns:1fr 1fr;
  padding:.5rem;gap:.2rem;
}
.dropdown-wide li{display:contents}

.dropdown li button,.dropdown li a,
.dd-item{
  display:block;width:100%;
  padding:.5rem .9rem;
  color:var(--text2);background:none;border:none;
  text-decoration:none;font-size:.84rem;
  text-align:left;cursor:pointer;
  border-radius:6px;transition:all .15s;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.dd-item:hover,.dropdown li button:hover,.dropdown li a:hover{
  background:var(--bg3);color:var(--text);
}
/* items inside dropdown-wide need padding tweak */
.dropdown-wide .dd-item{padding:.45rem .7rem;font-size:.82rem}

/* ===== BURGER ===== */
.burger{
  display:none;flex-direction:column;justify-content:center;gap:5px;
  background:none;border:none;cursor:pointer;
  padding:8px;border-radius:8px;flex-shrink:0;
  transition:background .2s;
}
.burger:hover{background:var(--bg3)}
.burger span{
  display:block;width:22px;height:2px;
  background:var(--text);border-radius:2px;
  transition:all .3s;
}
.burger.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.burger.open span:nth-child(2){opacity:0}
.burger.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ===== MOBILE MENU ===== */
.mobile-menu{
  display:none;
  background:var(--bg2);
  border-top:1px solid var(--border);
  max-height:calc(100vh - var(--nav-h));
  overflow-y:auto;
}
.mobile-menu.open{display:block}

.m-home-btn{
  display:block;padding:.8rem 1rem;
  color:var(--text);text-decoration:none;
  font-size:.95rem;font-weight:600;
  border-bottom:1px solid var(--border);
}
.m-home-btn:hover{background:var(--bg3);color:var(--accent)}

.m-search{
  display:flex;gap:.4rem;
  padding:.75rem 1rem .5rem;
}
.m-search input{
  flex:1;background:var(--bg3);border:1px solid var(--border);
  color:var(--text);padding:.45rem .85rem;
  border-radius:8px;font-size:.88rem;outline:none;
}
.m-search input:focus{border-color:var(--accent)}
.m-search button{
  background:var(--accent);color:#fff;border:none;
  padding:.45rem .9rem;border-radius:8px;
  cursor:pointer;font-weight:600;font-size:.88rem;
}

.m-section{border-bottom:1px solid var(--border)}
.m-section:last-child{border-bottom:none}

.m-toggle{
  width:100%;background:none;border:none;
  color:var(--text);cursor:pointer;
  display:flex;align-items:center;justify-content:space-between;
  padding:.75rem 1rem;font-size:.95rem;font-weight:600;
  transition:background .2s;
}
.m-toggle:hover{background:var(--bg3)}
.m-toggle.open .arrow{transform:rotate(180deg)}

.m-items{
  display:none;
  flex-wrap:wrap;gap:.35rem;
  padding:.35rem 1rem .75rem;
}
.m-items.open{display:flex}
.m-items button,.m-items a{
  background:var(--bg3);border:1px solid var(--border);
  color:var(--text2);text-decoration:none;
  padding:.4rem .75rem;border-radius:8px;
  font-size:.82rem;cursor:pointer;
  transition:all .2s;text-align:left;
}
.m-items button:hover,.m-items a:hover,
.m-items button.active,.m-items a.active{
  background:var(--accent);border-color:var(--accent);color:#fff;
}

/* ===== HERO CAROUSEL ===== */
.hero-carousel{
  position:relative;overflow:hidden;height:460px;
}
.carousel-slides{position:relative;height:100%;width:100%}
.carousel-slide{
  position:absolute;inset:0;
  background-size:cover;background-position:center 20%;
  opacity:0;transition:opacity .7s ease;
  display:flex;align-items:flex-end;
}
.carousel-slide.active{opacity:1}
.carousel-overlay{
  position:absolute;inset:0;
  background:linear-gradient(to top,var(--bg) 0%,rgba(13,13,15,.25) 100%);
}
.carousel-slide .hero-content{position:relative;z-index:2}

.carousel-btn{
  position:absolute;top:50%;transform:translateY(-50%);
  z-index:10;background:rgba(0,0,0,.5);border:none;color:#fff;
  font-size:1.2rem;width:42px;height:42px;border-radius:50%;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:background .2s;flex-shrink:0;
}
.carousel-btn:hover{background:var(--accent)}
.carousel-prev{left:1rem}
.carousel-next{right:1rem}

.carousel-dots{
  position:absolute;bottom:1rem;left:50%;transform:translateX(-50%);
  display:flex;gap:.2rem;z-index:10;
}
.carousel-dot{
  width:40px;height:40px;background:none;border:none;
  cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  padding:0;transition:all .25s;
}
.carousel-dot::before{
  content:"";display:block;width:8px;height:8px;border-radius:4px;
  background:rgba(255,255,255,.35);transition:all .25s;
}
.carousel-dot.active::before{
  width:24px;background:var(--accent);
}

.hero-content{
  max-width:1400px;width:100%;margin:0 auto;
  padding:2rem 1.25rem;
}
.hero-badge{
  display:inline-block;background:var(--accent);color:#fff;
  font-size:.72rem;font-weight:700;padding:3px 10px;
  border-radius:4px;margin-bottom:.5rem;
  letter-spacing:1px;text-transform:uppercase;
}
.hero-title{font-size:2rem;font-weight:700;line-height:1.2;margin-bottom:.4rem;text-shadow:0 2px 8px rgba(0,0,0,.8)}
.hero-meta{color:var(--text2);font-size:.88rem;margin-bottom:.75rem}
.hero-overview{
  max-width:580px;color:var(--text2);font-size:.92rem;
  line-height:1.6;margin-bottom:1.1rem;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.hero-btn{
  display:inline-block;text-decoration:none;
  background:var(--accent);color:#fff;border:none;
  padding:.65rem 1.6rem;border-radius:8px;
  font-size:.92rem;font-weight:600;cursor:pointer;
  transition:background .2s;
}
.hero-btn:hover{background:#c00710}

/* ===== CONTAINER ===== */
.container{max-width:1400px;margin:0 auto;padding:1.5rem 1.25rem 3rem;overflow-x:hidden}

/* ===== HOME SECTIONS ===== */
.home-section{margin-bottom:2.5rem}
.home-section-header{
  display:flex;align-items:center;
  justify-content:space-between;
  margin-bottom:1rem;
}
.home-section-header h2{
  font-size:1.2rem;font-weight:700;
  color:var(--text);margin:0;
}
.see-all-btn{
  background:none;border:1px solid var(--border);
  color:var(--text2);padding:.3rem .85rem;
  border-radius:6px;font-size:.82rem;
  cursor:pointer;white-space:nowrap;
  transition:all .2s;flex-shrink:0;
}
.see-all-btn:hover{border-color:var(--accent);color:var(--accent)}

/* Home section rows: horizontal scroll */
.home-section .movie-grid{
  display:flex;
  overflow-x:auto;
  overflow-y:visible;
  scroll-snap-type:x mandatory;
  gap:1rem;
  padding-bottom:.5rem;
  scrollbar-width:none;
  -ms-overflow-style:none;
  cursor:grab;
  width:100%;
  max-width:100%;
}
.home-section .movie-grid::-webkit-scrollbar{display:none}
.home-section .movie-grid.dragging{cursor:grabbing;user-select:none}
.home-section .movie-grid .movie-card{
  flex:0 0 155px;
  scroll-snap-align:start;
}

/* ===== BREADCRUMB ===== */
.breadcrumb{
  display:flex;align-items:center;gap:.75rem;
  margin-bottom:1rem;flex-wrap:wrap;
}
.breadcrumb button{
  background:var(--bg3);border:1px solid var(--border);
  color:var(--text);padding:.35rem .9rem;
  border-radius:8px;cursor:pointer;font-size:.88rem;
  transition:background .2s;flex-shrink:0;
}
.breadcrumb button:hover{background:var(--border)}

/* ===== SECTION TITLE ===== */
.section-title{font-size:1.35rem;font-weight:700;margin-bottom:1.1rem;color:var(--text)}

/* ===== MOVIE GRID ===== */
.movie-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(155px,1fr));
  gap:1.1rem;
}
.movie-card{
  background:var(--card);border-radius:var(--radius);
  overflow:hidden;cursor:pointer;
  transition:transform .2s,box-shadow .2s;
  border:1px solid var(--border);
}
.movie-card:hover{transform:translateY(-5px);box-shadow:var(--shadow);border-color:var(--accent)}
.movie-poster{width:100%;aspect-ratio:2/3;object-fit:cover;display:block;background:var(--bg3)}
.movie-poster-placeholder{
  width:100%;aspect-ratio:2/3;display:flex;
  align-items:center;justify-content:center;
  background:var(--bg3);color:var(--text3);font-size:2.5rem;
}
.movie-info{padding:.65rem}
.movie-title{
  font-size:.84rem;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  margin-bottom:.25rem;
}
.movie-meta{
  display:flex;align-items:center;
  justify-content:space-between;
  font-size:.75rem;color:var(--text2);
}
.rating{display:flex;align-items:center;gap:3px;color:#fbbf24;font-weight:600}

/* ===== LOADER ===== */
.loader{display:flex;justify-content:center;padding:3rem 0}
.spinner{
  width:40px;height:40px;
  border:4px solid var(--border);border-top-color:var(--accent);
  border-radius:50%;animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ===== LOAD MORE ===== */
.load-more-wrapper{text-align:center;margin-top:2rem}
.load-more-wrapper button{
  background:var(--bg3);border:1px solid var(--border);
  color:var(--text);padding:.65rem 2.5rem;
  border-radius:8px;font-size:.92rem;font-weight:600;
  cursor:pointer;transition:all .2s;
}
.load-more-wrapper button:hover{background:var(--accent);border-color:var(--accent)}

/* ===== CHIP ===== */
.chip{
  background:var(--bg3);border:1px solid var(--border);
  color:var(--text2);padding:2px 10px;
  border-radius:20px;font-size:.78rem;
}

/* ===== FOOTER ===== */
.footer{
  margin-top:4rem;
  border-top:1px solid var(--border);
  padding:3rem 1rem 1.5rem;
  text-align:center;
  color:var(--text2);font-size:.82rem;
}
.footer-inner{
  max-width:680px;margin:0 auto;
  display:flex;flex-direction:column;gap:1.2rem;
}
.footer-logo img{height:32px;object-fit:contain}
.footer-desc{
  color:var(--text2);font-size:.85rem;line-height:1.7;
}
.footer-disclaimer{
  font-size:.76rem;line-height:1.65;color:var(--text2);
  padding:.7rem 1rem;
  border:1px solid var(--border);border-radius:8px;
  background:var(--bg2);text-align:left;
}
.footer-links{
  display:flex;justify-content:center;gap:1.5rem;
  font-size:.8rem;
}
.footer-bottom{
  padding-top:.9rem;
  border-top:1px solid var(--border);
  font-size:.78rem;color:var(--text2);
}
.footer a{color:var(--text2);text-decoration:underline;transition:color .2s}
.footer a:hover{color:var(--accent)}

/* ===== FAQ ===== */
.faq-section{margin-top:2.5rem}
.faq-list{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.faq-item{border-bottom:1px solid var(--border)}
.faq-item:last-child{border-bottom:none}
.faq-question{
  width:100%;background:var(--bg2);border:none;
  color:var(--text);padding:.9rem 1.1rem;
  font-size:.9rem;font-weight:600;text-align:left;
  cursor:pointer;display:flex;justify-content:space-between;
  align-items:center;gap:1rem;transition:background .2s;
}
.faq-question:hover{background:var(--bg3)}
.faq-question[aria-expanded="true"]{color:var(--accent)}
.faq-question[aria-expanded="true"] .faq-icon{transform:rotate(45deg)}
.faq-icon{flex-shrink:0;font-size:1.2rem;transition:transform .2s}
.faq-answer{background:var(--bg);padding:.85rem 1.1rem;color:var(--text2);font-size:.88rem;line-height:1.7}

/* ===== UTILS ===== */
.hidden{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.hide-hero-initially #heroSection{display:none!important}

/* ===== SKELETON ANIMATIONS ===== */
@keyframes skeleton-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 0.35; }
  100% { opacity: 0.6; }
}
.skeleton-text, .skeleton-card {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--text3)}

/* ===== RESPONSIVE ===== */
@media (max-width:1024px){
  .nav-search{max-width:300px}
}

@media (max-width:860px){
  .nav-menu{display:none}
  .burger{display:flex;margin-left:auto}
  .nav-container{
    grid-template-columns:auto 1fr auto;
    justify-items:start;
  }
  .nav-search{justify-content:flex-end}
  .nav-search input{width:100%}
}

@media (max-width:600px){
  .nav-search{display:none}
  .nav-container{
    grid-template-columns:auto auto;
    justify-content:space-between;
  }
  .hero-carousel{height:300px}
  .hero-title{font-size:1.35rem}
  .hero-overview{display:none}
  .carousel-btn{width:34px;height:34px;font-size:1rem}
  .movie-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:.75rem}
  .home-section .movie-grid .movie-card{flex:0 0 130px}
  .container{padding:1rem .9rem 2.5rem}
}

@media (max-width:400px){
  .movie-grid{grid-template-columns:repeat(2,1fr)}
}
