/* سينمانا — تصميم سينما داكن (S06): أسود + ذهبي، عربي RTL. */
:root {
  --void: #050506;
  --surface: #101013;
  --elevated: #17171b;
  --ink: #f3f1ea;
  --fog: #9b9689;
  --muted: #6f6a5d;
  --hairline: rgba(255, 255, 255, 0.09);
  --gold: #e2ab45;
  --gold-dark: #a97417;
  --on-gold: #1c1204;
  --teal: #57cdbf;
  --red: #e0655f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
  line-height: 1.6;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, #0d0d10, var(--void));
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--on-gold);
  font-size: 20px;
}
.brand h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.tagline { margin: 0; color: var(--fog); font-size: 13px; }

.status-lines { font-size: 12px; color: var(--fog); max-width: 560px; }
.status-line { padding: 1px 0; }

main { max-width: 1180px; margin: 0 auto; padding: 16px 20px 40px; }

.stale-badge {
  background: #2a2103;
  border: 1px solid var(--gold-dark);
  color: var(--gold);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}

.tabs { display: flex; gap: 8px; margin: 4px 0 14px; }
.tab {
  background: var(--surface);
  color: var(--fog);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.tab.active { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }

.search-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.search-row input, .player-controls select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}
#search-input { flex: 1 1 260px; }
#year-input { width: 90px; }
#stars-input { width: 120px; }

.btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--gold); }
.btn.gold { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  background: var(--void);
  color: var(--fog);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.chip.active { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--gold); outline: none; }
.poster { aspect-ratio: 2 / 3; background: var(--elevated); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.card-body { padding: 10px 12px; }
.card-body h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.4; }
.meta { color: var(--fog); font-size: 12px; margin: 0; }

.loading, .empty { text-align: center; color: var(--fog); padding: 24px 0; }
.more-wrap { text-align: center; margin-top: 20px; }

.player-section {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}
.player-section h2 { margin: 0 0 12px; font-size: 17px; }
#video { width: 100%; max-height: 62vh; background: #000; border-radius: 10px; }
.player-error {
  background: #2a0d0b;
  border: 1px solid var(--red);
  color: #f6c9c6;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 14px;
}
.player-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; }
.player-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fog); }

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 14px 16px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; color: var(--gold); }
.mini-item {
  display: block; width: 100%; text-align: right;
  background: none; border: none; color: var(--ink);
  font-family: inherit; font-size: 13px;
  padding: 5px 0; cursor: pointer;
  border-bottom: 1px solid var(--hairline);
}
.mini-item:last-child { border-bottom: none; }
button.mini-item:hover { color: var(--gold); }

.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid; place-items: center;
  padding: 16px; z-index: 50;
}
.modal.hidden, .hidden { display: none !important; }
.modal-card {
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  max-width: 860px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  padding: 22px; position: relative;
}
.modal-close {
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 50%;
  width: 34px; height: 34px; font-size: 18px; cursor: pointer;
}
.details-head { display: flex; gap: 18px; flex-wrap: wrap; }
.details-poster { width: 150px; border-radius: 12px; object-fit: cover; }
.details-head h2 { margin: 0 0 6px; font-size: 21px; }
.desc { color: var(--fog); font-size: 14px; max-width: 60ch; }
.details-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.api-note { color: var(--gold); font-size: 13px; }
.ep-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ep-btn {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.ep-btn:hover { border-color: var(--gold); }

footer {
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 18px 20px 28px;
}
footer p { margin: 4px 0; }

.toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--elevated);
  border: 1px solid var(--gold);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .brand h1 { font-size: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .details-poster { width: 110px; }
}
