/* ============================================================
   base.css — ریست، متغیرها، فونت، تم پایه
   استودیو میرزایی | تم لوکس سینمایی
   ============================================================ */

/* فونت Vazirmatn از CDN گوگل فونت */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;300;400;500;600;700;800;900&display=swap');

/* ---------- ریست جهانی ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  direction: rtl;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

img,
video {
  max-width: 100%;
  display: block;
}

/* ---------- قانون امن آیکون‌های SVG ---------- */
/* جلوگیری از گسترش SVG بدون ابعاد به اندازه parent */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  /* ابعاد پیش‌فرض اگر هیچ قانونی مشخص نکرده باشد */
  width: 20px;
  height: 20px;
  max-width: 100%;
}

/* کلاس پایه آیکون — همه آیکون‌ها این کلاس رو دارند */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 2;
}
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

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

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- متغیرهای تم تیره (پیش‌فرض) ---------- */
:root,
[data-theme="dark"] {
  /* رنگ‌های پایه لوکس سینمایی */
  --color-bg: #0a0a0a;
  --color-bg-soft: #121212;
  --color-surface: #1a1a1a;
  --color-surface-2: #222222;
  --color-surface-3: #2a2a2a;
  --color-border: #333333;
  --color-border-soft: #262626;

  --color-text: #ffffff;
  --color-text-soft: #b5b5b5;
  --color-text-mute: #777777;

  --color-gold: #d4af37;
  --color-gold-light: #f4e5b1;
  --color-gold-dark: #b8941f;

  --color-primary: #d4af37;
  --color-primary-soft: rgba(212, 175, 55, 0.15);
  --color-secondary: #444444;

  --color-success: #2ecc71;
  --color-success-soft: rgba(46, 204, 113, 0.15);
  --color-danger: #e74c3c;
  --color-danger-soft: rgba(231, 76, 60, 0.15);
  --color-warning: #f39c12;
  --color-warning-soft: rgba(243, 156, 18, 0.15);
  --color-info: #3498db;
  --color-info-soft: rgba(52, 152, 219, 0.15);

  /* سایه‌ها */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.25);

  /* شعاع گردی */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* فاصله‌ها */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* انتقال */
  --transition: 0.3s ease;
  --transition-fast: 0.15s ease;
  --transition-slow: 0.5s ease;

  /* اندازه سایدبار */
  --sidebar-width: 264px;
  --topbar-height: 64px;
}

/* ---------- متغیرهای تم روشن ---------- */
[data-theme="light"] {
  --color-bg: #f5f5f5;
  --color-bg-soft: #eaeaea;
  --color-surface: #ffffff;
  --color-surface-2: #fafafa;
  --color-surface-3: #f0f0f0;
  --color-border: #e0e0e0;
  --color-border-soft: #eeeeee;

  --color-text: #1a1a1a;
  --color-text-soft: #555555;
  --color-text-mute: #999999;

  --color-gold: #b8941f;
  --color-gold-light: #d4af37;
  --color-gold-dark: #8a6f17;

  --color-primary: #b8941f;
  --color-primary-soft: rgba(184, 148, 31, 0.12);
  --color-secondary: #cccccc;

  --color-success: #27ae60;
  --color-danger: #c0392b;
  --color-warning: #e67e22;
  --color-info: #2980b9;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-gold: 0 4px 20px rgba(184, 148, 31, 0.2);
}

/* ---------- اسکرول‌بار ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-soft);
}
::-webkit-scrollbar-thumb {
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-soft);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-dark);
}

/* ---------- انتخاب متن ---------- */
::selection {
  background: var(--color-gold);
  color: #0a0a0a;
}

/* ---------- کلاس‌های کمکی ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-gold { color: var(--color-gold); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-mute { color: var(--color-text-mute); }
.text-soft { color: var(--color-text-soft); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: 0.85rem; }
.fs-lg { font-size: 1.15rem; }
.fs-xl { font-size: 1.5rem; }
.fs-2xl { font-size: 2rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.grid { display: grid; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* ---------- انیمیشن‌های پایه ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
  50% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.6); }
}

.fade-in { animation: fadeIn var(--transition) ease; }
.slide-up { animation: slideUp var(--transition) ease; }
.slide-down { animation: slideDown var(--transition) ease; }
.scale-in { animation: scaleIn var(--transition) ease; }
