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

/* ==========================================================
   متغیرهای تم — الهام‌گرفته از رنگ‌بندی سایت اصلی سرور (نارنجی/تیره)
   ========================================================== */
:root,
html[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-soft: #161616;
  --card: #1a1a1a;
  --card-glass: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f2f2f2;
  --muted: #a7a7a7;
  --accent: #ee731a;
  --accent-hover: #c75c0f;
  --accent-soft: rgba(238, 115, 26, 0.14);
  --success: #37b362;
  --danger: #e05263;
  --radius: 14px;
  --header-bg: rgba(14, 14, 14, 0.75);
}

html[data-theme="light"] {
  --bg: #f6f6f8;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-glass: rgba(0, 0, 0, 0.03);
  --border: #e7e7ea;
  --text: #17181c;
  --muted: #6b7280;
  --accent: #ee731a;
  --accent-hover: #c75c0f;
  --accent-soft: rgba(238, 115, 26, 0.10);
  --success: #1f9d55;
  --danger: #d1364a;
  --radius: 14px;
  --header-bg: rgba(255, 255, 255, 0.85);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  transition: background-color .25s ease, color .25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ------- هدر ------- */
.site-header {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; flex-wrap: wrap; gap: 14px; }

.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 1.8rem; }
.logo-text {
  font-family: 'Sacramento', 'Playfair Display', cursive, 'Vazirmatn';
  font-size: 2.4rem;
  line-height: 1;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 1px;
  direction: ltr;
  display: inline-block;
}
.logo-text-accent { color: var(--accent); }

.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a { margin-inline-start: 12px; color: var(--text); font-weight: 500; }
.main-nav a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  margin-inline-start: 16px;
  background: var(--card-glass);
  border: 1px solid var(--border);
  border-radius: 30px;
  width: 44px; height: 26px;
  position: relative;
  cursor: pointer;
  display: inline-flex; align-items: center;
  padding: 0 5px;
}
.theme-toggle .icon-sun, .theme-toggle .icon-moon { font-size: 0.85rem; line-height: 1; }
html[data-theme="dark"] .theme-toggle .icon-sun { opacity: .35; }
html[data-theme="light"] .theme-toggle .icon-moon { opacity: .35; }

main.container { padding-top: 28px; padding-bottom: 60px; min-height: 70vh; }

h1, h2, h3 { font-weight: 700; }

/* ------- کارت‌ها (استایل شیشه‌ای مشابه سایت اصلی) ------- */
.card {
  background: linear-gradient(180deg, var(--card-glass), transparent), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.post-card img.post-image { width: 100%; border-radius: var(--radius); margin: 12px 0; max-height: 420px; object-fit: cover; }
.post-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 8px; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); margin: 12px 0; }
.video-embed iframe, .video-embed video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.reactions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.reaction-btn {
  background: var(--card-glass); border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 14px; cursor: pointer; font-size: 0.95rem; color: var(--text);
  transition: 0.15s;
}
.reaction-btn:hover { border-color: var(--accent); }
.reaction-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

.btn {
  display: inline-block; background: var(--accent); color: #fff !important;
  border: none; padding: 10px 22px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none;
  transition: background-color .15s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff !important; }
.btn-secondary { background: var(--card-glass); color: var(--text) !important; border: 1px solid var(--border); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

form.form-box { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
label { font-weight: 600; margin-bottom: 4px; display: block; }
input[type=text], input[type=password], input[type=datetime-local], textarea, select, input[type=file] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-family: inherit; font-size: 0.95rem;
}
textarea { min-height: 140px; resize: vertical; }
small.hint { color: var(--muted); font-size: 0.82rem; }

table { width: 100%; border-collapse: collapse; margin-top: 14px; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: right; }
th { color: var(--muted); font-weight: 600; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-open { background: rgba(55,179,98,0.15); color: var(--success); }
.badge-closed { background: rgba(224,82,99,0.15); color: var(--danger); }
.badge-upcoming { background: var(--accent-soft); color: var(--accent); }
.badge-role { background: var(--accent-soft); color: var(--accent); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.alert-success { background: rgba(55,179,98,0.12); color: var(--success); border: 1px solid rgba(55,179,98,0.3); }
.alert-error { background: rgba(224,82,99,0.12); color: var(--danger); border: 1px solid rgba(224,82,99,0.3); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.admin-tile { background: linear-gradient(180deg, var(--card-glass), transparent), var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.admin-tile h3 { margin-top: 0; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); padding: 20px 0; text-align: center; font-size: 0.85rem; }

.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------- ریسپانسیو موبایل ------- */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .main-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .main-nav a { margin-inline-start: 0; margin-inline-end: 12px; font-size: 0.9rem; }
  .logo-text { font-size: 1.8rem; }
  main.container { padding-top: 16px; }
  .card { padding: 14px; }
  .admin-grid { grid-template-columns: 1fr; }
  table { font-size: 0.85rem; }
  th, td { padding: 8px 6px; }
  form.form-box { max-width: 100% !important; }
  .post-card img.post-image { max-height: 260px; }
  h1 { font-size: 1.4rem; }
}
