/* ============================================
   ROLLIT — TRAILERS
   css/trailers.57b79860.css
   Theater-style trailer modal + the hero "Trailers" button.
   ============================================ */

/* ---- Hero button (sits between description and the rating) ---- */
.hero-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.trailer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s;
}
.trailer-btn:hover {
  background: rgba(232, 201, 107, 0.12);
  border-color: var(--gold);
  transform: translateY(-1px);
}
.trailer-btn i { font-size: 15px; color: var(--gold); }

/* ---- Modal shell ---- */
.trailer-bg {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 9, 0.82);
  backdrop-filter: blur(6px);
}
.trailer-bg.open { display: flex; }

.trailer-modal {
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.trailer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.trailer-head-l {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.trailer-head-l i { color: var(--gold); font-size: 18px; }
.trailer-now-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trailer-close {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.trailer-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

/* ---- Body: player + side list ---- */
.trailer-body {
  display: flex;
  min-height: 0;
  flex: 1;
}
.trailer-stage {
  flex: 1 1 auto;
  min-width: 0;
  background: #000;
  display: flex;
  align-items: center;
}
.trailer-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.trailer-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.trailer-side {
  position: relative;
  flex: 0 0 320px;
  border-left: 1px solid var(--border);
  overflow: hidden;
  display: flex;
}
.trailer-list {
  width: 100%;
  overflow-y: auto;
  padding: 8px;
}

/* Loading / empty overlays (toggled via [data-state] on .trailer-bg) */
.trailer-loading,
.trailer-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
  background: var(--surface);
}
.trailer-empty i { font-size: 30px; color: var(--dim); }
.trailer-empty p { font-size: 13px; margin: 0; }

.trailer-bg[data-state="loading"] .trailer-loading { display: flex; }
.trailer-bg[data-state="loading"] .trailer-list,
.trailer-bg[data-state="empty"]   .trailer-list { visibility: hidden; }
.trailer-bg[data-state="empty"]   .trailer-empty { display: flex; }
.trailer-bg[data-state="empty"]   .trailer-stage { display: none; }

/* ---- List items ---- */
.trailer-item {
  width: 100%;
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.trailer-item:hover { background: rgba(255, 255, 255, 0.05); }
.trailer-item.active {
  background: rgba(232, 201, 107, 0.10);
  border-color: rgba(232, 201, 107, 0.35);
}
.trailer-thumb {
  position: relative;
  flex: 0 0 108px;
  width: 108px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}
.trailer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trailer-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  opacity: 0;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity .15s;
}
.trailer-item:hover .trailer-thumb-play,
.trailer-item.active .trailer-thumb-play { opacity: 1; }

.trailer-item-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.trailer-item-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trailer-item-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trailer-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}
.trailer-tag-main {
  background: rgba(232, 201, 107, 0.18);
  color: var(--gold);
}
.trailer-date { font-size: 10.5px; color: var(--dim); }

/* Lock background scroll while open */
body.trailer-lock { overflow: hidden; }

/* ---- Responsive: stack player on top, list below ---- */
@media (max-width: 760px) {
  .trailer-bg { padding: 0; }
  .trailer-modal { max-height: 100vh; height: 100%; border-radius: 0; border: none; }
  .trailer-body { flex-direction: column; }
  .trailer-side { flex: 1 1 auto; border-left: none; border-top: 1px solid var(--border); }
}
