/* Panels */
.panel{
  margin-top:18px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(31,41,55,.75);
  background:linear-gradient(180deg,#0f1528,#0b1020);
}

/* MODAL */
.modal-overlay{
  position:fixed;inset:0;background:rgba(4,7,18,.85);backdrop-filter:blur(14px);
  display:none;align-items:center;justify-content:center;z-index:1000
}
.modal-overlay.open{display:flex}
.modal{
  width:1000px;max-width:calc(100vw - 32px);background:linear-gradient(180deg,#121a2e,#0b1020);
  border-radius:28px;overflow:hidden;position:relative;border:1px solid rgba(31,41,55,.75)
}
.modal-close{
  position:absolute;top:20px;right:20px;background:#020617;border:1px solid var(--border);
  color:var(--text);border-radius:50%;width:42px;height:42px;font-size:20px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.modal-close:hover{background:#0f1528}
.modal-hero{position:relative;padding:32px;background:radial-gradient(600px 300px at 30% 0%, #1a2442, transparent);overflow:hidden}
.modal-backdrop{position:absolute;inset:0;background-size:cover;background-position:center;filter:blur(24px) saturate(1.2);transform:scale(1.1);opacity:.35}
.modal-backdrop::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg, rgba(11,16,32,.45), rgba(11,16,32,.92))}
.modal-hero-content{position:relative;z-index:2;display:grid;grid-template-columns:280px 1fr;gap:28px;align-items:start}
.modal-poster img{width:100%;border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.6)}
.modal-title{margin:0 0 12px;font-size:30px;font-weight:700}
.modal-meta{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:14px}
.modal-overview{max-width:720px;font-size:15px;line-height:1.7;color:var(--muted);margin:0 0 14px}
.modal-actions{display:flex;flex-wrap:wrap;gap:10px;margin:10px 0 8px}
.modal-actions a.btn{min-width:220px}
.modal-topics{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 0}
.topic{
  display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;
  background:#0b1020;border:1px solid var(--border);color:var(--text);font-size:12px
}
.topic.muted{color:var(--muted)}
.modal-inline{display:flex;gap:10px;align-items:center;margin-top:10px;flex-wrap:wrap}
.modal-inline .select-sm{max-width:240px}

.modal-ratings{
  margin-top:12px;background:rgba(2,6,23,.55);border:1px solid rgba(31,41,55,.65);
  border-radius:18px;padding:14px
}
.rating-row{display:grid;grid-template-columns:140px 1fr 32px;gap:14px;align-items:center;margin-bottom:12px}
.rating-label{color:var(--muted);font-size:13px}
.rating-val{color:var(--text);font-size:13px;text-align:right}
.modal-ratings input[type="range"]{width:100%}
.rating-total{
  margin-top:12px;padding-top:12px;border-top:1px solid rgba(31,41,55,.65);
  display:grid;grid-template-columns:1fr auto;gap:8px 10px;align-items:end
}
.rating-total-label{color:var(--muted);font-size:12px}
.rating-total-val{font-size:22px;font-weight:700}
.rating-total-sub{grid-column:1/-1;color:var(--muted);font-size:12px}
.modal-footer{padding:12px 18px;border-top:1px solid rgba(31,41,55,.65);color:var(--muted);font-size:12px}




/* ===== MODAL LAYOUT PATCH (FINAL) ===== */

.modal-hero-content{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:28px;
  align-items:stretch;
}

.modal-left{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.modal-left-controls{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.modal-status{
  height:44px;
  border-radius:14px;
}

.modal-platforms{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.platform-btn{
  width:48px;
  height:48px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,23,42,0.55);
  border:1px solid rgba(255,255,255,0.08);
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.platform-btn:hover{
  transform:translateY(-2px);
  border-color:rgba(255,255,255,0.22);
  box-shadow:0 0 0 3px rgba(239,68,68,0.10);
}

.platform-btn img{
  max-width:28px;
  max-height:28px;
  display:block;
}

.platform-btn svg{
  width:28px;
  height:28px;
  display:block;
}

.modal-head{
  display:flex;
  flex-direction:column;
  min-height:0;
}

.modal-overview{
  margin-bottom:10px;
}

.modal-topics{
  margin-bottom:14px;
}

.modal-ratings{
  margin-top:auto;
}

.rating-total{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  padding-top:10px;
}

.rating-total-label{
  opacity:.75;
}

.modal-collections-full{
  padding:16px 28px 0;
}

.modal-collections-full .fi{
  width:100%;
}

.modal-close{
  z-index:5;
  position:absolute;
  top:18px;
  right:18px;
}

.modal{
  position:relative;
}


/* ===== SHOWLY MODAL UI PATCH (STABLE) ===== */

.modal-hero-content{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:28px;
  align-items:stretch;
}

.modal-left{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.modal-left-controls{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.modal-status-icons{
  display:flex;
  flex-wrap:nowrap;
  gap:10px;
}


.status-ico-btn{
  flex:1 0 0;
  min-width:78px;
  height:64px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  color:rgba(226,232,240,.92);
  cursor:pointer;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  gap:6px;
  padding:8px 6px;

  transition:background .12s ease, box-shadow .12s ease, border-color .12s ease, color .12s ease;
}


.status-ico-btn .ico{
  width:26px;
  height:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:.95;
}
.status-ico-btn .ico svg{
  width:26px;
  height:26px;
  display:block;
  fill:currentColor;
}


.status-ico-btn .txt{
  font-size:11px;
  line-height:1.05;
  font-weight:700;
  text-align:center;
  padding:0 2px;

  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}


.status-ico-btn:hover{
  background:rgba(2,6,23,.55);
  border-color:rgba(255,255,255,.16);
}

.status-ico-btn.active{
  color:#fff;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.06) inset,
    0 10px 24px rgba(0,0,0,.25);
}


.status-ico-btn.tone-c.active{background:rgba(14,165,233,.18);border-color:rgba(14,165,233,.30)}
.status-ico-btn.tone-y.active{background:rgba(234,179,8,.16);border-color:rgba(234,179,8,.28)}
.status-ico-btn.tone-g.active{background:rgba(34,197,94,.14);border-color:rgba(34,197,94,.26)}
.status-ico-btn.tone-r.active{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.24)}


/* stronger "glow" like reference */
.status-ico-btn.tone-c.active{ color: rgb(56,189,248); box-shadow: 0 0 0 3px rgba(255,255,255,.06) inset, 0 0 18px rgba(14,165,233,.35); }
.status-ico-btn.tone-y.active{ color: rgb(250,204,21); box-shadow: 0 0 0 3px rgba(255,255,255,.06) inset, 0 0 18px rgba(234,179,8,.35); }
.status-ico-btn.tone-g.active{ color: rgb(74,222,128); box-shadow: 0 0 0 3px rgba(255,255,255,.06) inset, 0 0 18px rgba(34,197,94,.35); }
.status-ico-btn.tone-r.active{ color: rgb(248,113,113); box-shadow: 0 0 0 3px rgba(255,255,255,.06) inset, 0 0 18px rgba(239,68,68,.35); }

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

.modal-collections-btn{
  flex:1;
  height:48px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 14px;
  transition:background .12s ease,border-color .12s ease,box-shadow .12s ease;
}

.modal-collections-btn:hover{background:rgba(2,6,23,.55);border-color:rgba(255,255,255,.16)}

.modal-fav-btn{
  width:48px;height:48px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  color:rgba(226,232,240,.92);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  transition:background .12s ease,border-color .12s ease,box-shadow .12s ease,color .12s ease;
}

.modal-fav-btn:hover{background:rgba(2,6,23,.55);border-color:rgba(255,255,255,.16)}
.modal-fav-btn.active{color:#fff;background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.24)}

.modal-watch-services{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.watch-service{
  min-width:84px;
  height:34px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  color:rgba(226,232,240,.92);
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  cursor:pointer;
  transition:background .12s ease,border-color .12s ease;
}

.watch-service:hover{background:rgba(2,6,23,.55);border-color:rgba(255,255,255,.16)}

.modal-status-select{display:none}

.modal-head{
  display:flex;
  flex-direction:column;
  min-height:0;
}

.modal-head-top{display:flex;flex-direction:column;gap:10px}

.modal-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  padding-bottom:10px;
  border-bottom:1px solid rgba(31,41,55,.65);
}

.modal-tab{
  height:36px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  color:rgba(226,232,240,.80);
  font-size:13px;
  cursor:pointer;
  transition:background .12s ease,border-color .12s ease,color .12s ease;
}

.modal-tab:hover{background:rgba(2,6,23,.55);border-color:rgba(255,255,255,.16);color:rgba(226,232,240,.92)}
.modal-tab.active{background:rgba(14,165,233,.14);border-color:rgba(14,165,233,.26);color:#fff}

.modal-tabpanes{
  margin-top:12px;
  min-height:0;
  flex:1;
  overflow:auto;
  padding-right:2px;
}

.modal-pane{display:none}
.modal-pane.active{display:block}

.pane-title{font-size:18px;font-weight:800;margin:4px 0 12px}
.pane-subtitle{font-size:14px;font-weight:700;margin:16px 0 10px;color:var(--muted)}

.modal-info{
  margin:10px 0 12px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid rgba(31,41,55,.65);
  background:rgba(2,6,23,.45);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 18px;
}

.info-row{display:flex;justify-content:space-between;gap:12px;min-width:0}
.info-k{color:var(--muted);font-size:12px;white-space:nowrap}
.info-v{color:var(--text);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}

.modal-genres{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 0;
}

.genre-tag{
  display:inline-flex;
  align-items:center;
  height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(250,204,21,.14);
  border:1px solid rgba(250,204,21,.26);
  color:#fde68a;
  font-size:12px;
  font-weight:700;
}

.modal-ratings{
  margin-top:16px;
  background:rgba(2,6,23,.55);
  border:1px solid rgba(31,41,55,.65);
  border-radius:18px;
  padding:14px;
}

.cast-row,.crew-row{
  display:flex;
  gap:12px;
  flex-wrap:nowrap;
  overflow:auto;
  padding-bottom:6px;
}

.person-card{width:120px;flex:0 0 auto}
.person-ava{
  width:120px;height:160px;border-radius:16px;overflow:hidden;
  background:rgba(2,6,23,.35);
  border:1px solid rgba(255,255,255,.08);
  display:flex;align-items:center;justify-content:center;
}
.person-ava img{width:100%;height:100%;object-fit:cover;display:block}
.person-ph{width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.08)}
.person-name{margin-top:8px;font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.person-sub{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.trailer-box{max-width:720px}
.trailer-thumb{
  width:100%;
  border:1px solid rgba(255,255,255,.10);
  padding:0;
  border-radius:18px;
  overflow:hidden;
  cursor:pointer;
  position:relative;
  background:rgba(2,6,23,.35);
}
.trailer-thumb img{width:100%;display:block}
.trailer-thumb .play{
  position:absolute;
  inset:auto auto 14px 14px;
  width:56px;height:56px;border-radius:16px;
  display:flex;align-items:center;justify-content:center;
  font-size:18px;
  background:rgba(2,6,23,.70);
  border:1px solid rgba(255,255,255,.14);
  color:#fff;
}

.trailer-iframe{position:relative;width:100%;padding-top:56.25%;border-radius:18px;overflow:hidden;border:1px solid rgba(255,255,255,.10);background:rgba(2,6,23,.35)}
.trailer-iframe iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

.photo-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}

.photo-item{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  border-radius:16px;
  overflow:hidden;
  cursor:pointer;
  padding:0;
}

.photo-item img{width:100%;height:120px;object-fit:cover;display:block}

.links-section{margin-top:14px}
.links-h{font-size:13px;font-weight:800;margin:10px 0 10px}

.hscroll{
  display:flex;
  gap:12px;
  overflow:auto;
  padding-bottom:6px;
  flex-wrap:nowrap;
}

.mini-card{width:130px;flex:0 0 auto;cursor:pointer}
.mini-poster{
  width:130px;height:190px;border-radius:16px;overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  display:flex;align-items:center;justify-content:center;
}
.mini-poster img{width:100%;height:100%;object-fit:cover;display:block}
.mini-ph{width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.08)}
.mini-title{margin-top:8px;font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.modal-collections-full{display:none}
.modal-collections-full.open{display:block}

.modal-lightbox{
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.92);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:10;
  padding:18px;
}

.modal-lightbox.open{display:flex}
.lightbox-img{max-width:100%;max-height:100%;border-radius:18px;border:1px solid rgba(255,255,255,.10);background:rgba(2,6,23,.35)}
.lightbox-close{
  position:absolute;
  top:16px;
  right:16px;
  width:42px;height:42px;border-radius:50%;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.55);
  color:var(--text);
  cursor:pointer;
}
.lightbox-close:hover{background:rgba(2,6,23,.75)}

@media (max-width: 880px){
  .modal-hero-content{grid-template-columns:1fr}
  .photo-grid{grid-template-columns:repeat(2,1fr)}
  .modal-info{grid-template-columns:1fr}
  .modal-tabpanes{max-height:52vh}
}



/* ===== STATUS FLAT STYLE ===== */
.modal-status-icons{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}

.status-flat-btn{
  height:48px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.04);
  color:rgba(226,232,240,.88);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:13px;
  font-weight:600;
  transition:background .12s ease,border-color .12s ease,color .12s ease;
}

.status-flat-btn:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(255,255,255,.14);
}

.status-flat-btn.active{
  background:rgba(14,165,233,.12);
  border-color:rgba(14,165,233,.24);
  color:#fff;
}

.status-flat-btn.tone-g.active{background:rgba(34,197,94,.12);border-color:rgba(34,197,94,.22)}
.status-flat-btn.tone-y.active{background:rgba(234,179,8,.12);border-color:rgba(234,179,8,.22)}
.status-flat-btn.tone-r.active{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.22)}

/* ===== GENRES NEUTRAL STYLE ===== */
.modal-genres{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0 0;
}

.genre-tag{
  height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:rgba(226,232,240,.85);
  font-size:12px;
  font-weight:600;
  display:flex;
  align-items:center;
}



/* ===== FINAL UI FIXES ===== */

.status-flat-btn{
  justify-content:flex-start;
  padding:0 14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  gap:10px;
}

.status-flat-btn .ico{
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.status-flat-btn .ico svg{
  width:22px;
  height:22px;
  fill:currentColor;
  opacity:.92;
}

.status-flat-btn.active .ico svg{opacity:1}

.watch-service-logo{
  width:100%;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color:rgba(226,232,240,.92);
  transition:background .12s ease,border-color .12s ease;
}

.watch-service-logo:hover{
  background:rgba(2,6,23,.55);
  border-color:rgba(255,255,255,.16);
}

.watch-service-logo .logo{
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.watch-service-logo .logo svg{
  width:22px;
  height:22px;
  fill:currentColor;
}

.modal-watch-services{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
}

@media (max-width: 520px){
  .modal-watch-services{grid-template-columns:repeat(2,1fr)}
}

.cast-row,.crew-row{
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-gutter:stable;
}

.cast-row::-webkit-scrollbar,.crew-row::-webkit-scrollbar{height:8px}
.cast-row::-webkit-scrollbar-thumb,.crew-row::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:999px}
.cast-row::-webkit-scrollbar-track,.crew-row::-webkit-scrollbar-track{background:rgba(255,255,255,.04);border-radius:999px}


/* ===== COLLECTIONS DROPDOWN (LIKE REFERENCE) ===== */
.modal-left-actions{ position:relative; }

.collections-menu{
  position:absolute;
  left:0;
  top:calc(100% + 10px);
  width:280px;
  max-width:min(90vw, 320px);
  background:rgba(15,23,42,.95);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  box-shadow:0 20px 40px rgba(0,0,0,.45);
  padding:8px 0;
  display:none;
  z-index:80;
  backdrop-filter: blur(10px);
}

.collections-menu.open{ display:block; }

.collections-menu-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  font-size:14px;
  cursor:pointer;
  user-select:none;
}

.collections-menu-item:hover{ background:rgba(255,255,255,.06); }

.collections-menu-item input{ width:16px; height:16px; }

.collections-menu-sep{
  height:1px;
  margin:6px 0;
  background:rgba(255,255,255,.08);
}

.collections-menu-new{
  color:rgba(226,232,240,.92);
  font-weight:700;
}
