@import url('https://fonts.googleapis.com/css2?family=Lalezar&family=Bebas+Neue&family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #0e0d0c;
  --surface: #17140f;
  --surface-2: #1f1a13;
  --text: #ede7dd;
  --text-dim: #a89e8c;
  --gold: #c9a24b;
  --gold-dim: #8a713a;
  --gold-hover: #dcb35f;
  --on-accent: #14110d;
  --crimson: #8a2f3b;
  --success-text: #8fd4a2;
  --danger-text: #e3919c;
  --line: #35302a;
  --radius: 3px;
  --container: 1180px;
  color-scheme: dark;
}

/* حالت روشن - خودکار بر اساس تنظیمات سیستم کاربر */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5efe2;
    --surface: #eae1cd;
    --surface-2: #ded2b6;
    --text: #241f18;
    --text-dim: #6f6455;
    --gold: #8a5c15;
    --gold-dim: #b9944f;
    --gold-hover: #6f4710;
    --on-accent: #fbf6ec;
    --crimson: #8a2f3b;
    --success-text: #2f6142;
    --danger-text: #a23347;
    --line: #d9cdb4;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 400;
  line-height: 1.85;
}

h1, h2, h3, .display {
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--text);
  margin: 0;
}

html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3, html[lang="en"] .display {
  font-family: 'Bebas Neue', 'Vazirmatn', sans-serif;
  letter-spacing: 1px;
}

a { color: inherit; text-decoration: none; }

.meta {
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- سپروکت هول / نوار پرفراژ فیلم (عنصر امضا) ---------- */
.sprocket-strip {
  height: 22px;
  background:
    repeating-linear-gradient(
      to left,
      var(--bg) 0 10px,
      var(--surface) 10px 12px
    );
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sprocket-strip::before,
.sprocket-strip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0; left: 0;
  height: 10px;
  transform: translateY(-50%);
  background-image: radial-gradient(circle, var(--bg) 3.2px, transparent 3.3px);
  background-size: 22px 10px;
  background-position: 6px center;
}
.sprocket-strip::before { top: 4px; }
.sprocket-strip::after { top: 18px; }

/* ---------- هدر ---------- */
.site-header {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header .brand {
  font-family: 'Lalezar', sans-serif;
  font-size: 1.7rem;
  color: var(--gold);
}
.site-header nav { display: flex; gap: 28px; align-items: center; }
.site-header nav a {
  font-size: 0.95rem;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
  transition: color .2s, border-color .2s;
}
.site-header nav a:hover,
.site-header nav a.active { color: var(--gold); border-color: var(--gold); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 20px;
}
.lang-switch a { color: var(--text-dim); padding: 0; }
.lang-switch a.active { color: var(--gold); }
.lang-switch a:hover { color: var(--gold); }
.lang-switch .lang-sep { color: var(--line); }

/* ---------- هیرو ---------- */
.hero {
  padding: 90px 0 70px;
  text-align: center;
}
.hero .eyebrow {
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 300;
  letter-spacing: 3px;
  color: var(--gold-dim);
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.15;
}
.hero p.tagline {
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 620px;
  margin: 22px auto 0;
}
.hero .stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 44px;
}
.hero .stats .num {
  font-family: 'Lalezar', sans-serif;
  font-size: 2.2rem;
  color: var(--gold);
  display: block;
}

/* ---------- بخش‌ها ---------- */
section.block { padding: 64px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 34px;
}
.section-head h2 { font-size: 1.9rem; }
.section-head a.more { color: var(--gold); font-size: 0.9rem; }

/* ---------- گرید فیلم‌ها ---------- */
.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px;
}
.film-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.film-card:hover { transform: translateY(-4px); border-color: var(--gold-dim); }
.film-card .poster {
  aspect-ratio: 2/3;
  background: var(--surface-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-family: 'Lalezar', sans-serif;
  font-size: 1.1rem;
}
.film-card .body { padding: 16px 18px 20px; }
.film-card h3 { font-size: 1.25rem; margin-bottom: 6px; }
.film-card .meta { display: block; margin-bottom: 10px; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 100px;
  padding: 3px 10px;
  margin-top: 6px;
  margin-inline-end: 6px;
}

/* ---------- جزئیات فیلم ---------- */
.film-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 46px;
  padding: 56px 0;
  align-items: start;
}
.film-hero .poster {
  aspect-ratio: 2/3;
  background: var(--surface) center/cover no-repeat;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.film-hero h1 { font-size: 2.6rem; margin-bottom: 10px; }
.film-hero .meta-row { display: flex; gap: 18px; margin-bottom: 22px; }
.film-hero .synopsis { color: var(--text-dim); font-size: 1.05rem; max-width: 640px; }
.trailer-link {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 22px;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 100px;
  font-size: 0.9rem;
}
.trailer-link:hover { background: var(--gold); color: var(--on-accent); }

/* ---------- ریل جشنواره‌ها (تایم‌لاین فیلم‌استریپ) ---------- */
.reel {
  position: relative;
  padding: 30px 0;
  overflow-x: auto;
  display: flex;
  gap: 0;
}
.reel::-webkit-scrollbar { height: 6px; }
.reel::-webkit-scrollbar-thumb { background: var(--line); }
.frame {
  flex: 0 0 240px;
  border-inline-end: 2px dashed var(--line);
  padding: 0 24px;
  position: relative;
}
.frame:first-child { padding-inline-start: 0; }
.frame .year {
  font-family: 'Lalezar', sans-serif;
  color: var(--gold);
  font-size: 1.6rem;
  display: block;
  margin-bottom: 8px;
}
.frame h3 { font-size: 1.1rem; margin-bottom: 6px; }
.frame .film-ref { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 10px; }

/* ---------- تماس ---------- */
.social-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 34px 0 42px;
}
.social-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-dim);
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.social-icon svg { width: 21px; height: 21px; }
.social-icon:hover {
  color: var(--on-accent);
  background: var(--gold);
  border-color: var(--gold);
  transform: translateY(-3px);
}

.minimal-contact {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 34px;
}
.minimal-contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.92rem;
  letter-spacing: 0.2px;
}
.minimal-contact a svg { width: 15px; height: 15px; opacity: 0.75; }
.minimal-contact a:hover { color: var(--gold); }
.minimal-contact a:hover svg { opacity: 1; }

/* ---------- فوتر ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- flash messages ---------- */
.flash-wrap { max-width: var(--container); margin: 18px auto 0; padding: 0 28px; }
.flash {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 0.92rem;
  border: 1px solid var(--line);
}
.flash-success { border-color: #3c6e4a; color: var(--success-text); }
.flash-danger  { border-color: var(--crimson); color: var(--danger-text); }
.flash-warning { border-color: var(--gold-dim); color: var(--gold); }
.flash-info    { border-color: var(--line); color: var(--text-dim); }

/* ---------- پنل ادمین ---------- */
.admin-body { background: var(--surface); min-height: 100vh; }
.admin-shell { max-width: 960px; margin: 0 auto; padding: 40px 24px 80px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 34px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.admin-header .brand { font-family: 'Lalezar', sans-serif; color: var(--gold); font-size: 1.4rem; }
.btn-logout { color: var(--text-dim); font-size: 0.85rem; }

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px; width: 100%; max-width: 380px;
}
.login-card h1 { font-family: 'Lalezar', sans-serif; color: var(--gold); font-size: 1.6rem; margin-bottom: 28px; text-align: center; }

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 0.88rem; color: var(--text-dim); }
.field small.hint { display: block; margin-top: 5px; color: var(--text-dim); font-size: 0.78rem; }
.field .errors { color: var(--danger-text); font-size: 0.8rem; margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=email],
input[type=file], textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.95rem;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); }
.checkbox-field { display: flex; align-items: center; gap: 10px; }
.checkbox-field input { width: auto; }

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--on-accent);
  border: none;
  padding: 11px 26px;
  border-radius: 100px;
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.btn:hover { background: var(--gold-hover); }
.btn-outline {
  background: transparent; color: var(--text-dim); border: 1px solid var(--line);
  padding: 10px 20px; border-radius: 100px; font-size: 0.85rem; cursor: pointer;
}
.btn-danger { color: var(--danger-text); border-color: var(--crimson); }

.admin-table { width: 100%; border-collapse: collapse; margin-bottom: 50px; }
.admin-table th {
  text-align: right; font-size: 0.78rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.admin-table .row-actions { display: flex; gap: 10px; }
.admin-table .row-actions a, .admin-table .row-actions button {
  font-size: 0.8rem; color: var(--text-dim); background: none; border: none; cursor: pointer;
}
.admin-table .row-actions a:hover, .admin-table .row-actions button:hover { color: var(--gold); }

.empty-state {
  padding: 40px; text-align: center; color: var(--text-dim);
  border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 40px;
}

@media (max-width: 720px) {
  .site-header { flex-direction: column; gap: 14px; }
  .site-header nav { gap: 18px; flex-wrap: wrap; justify-content: center; }
  .film-hero { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film-card { transition: none; }
}
