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

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-secondary:#f5f5f7;
  --bg-card:     #ffffff;
  --text:        #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary:  #aeaeb2;
  --border:      #d2d2d7;
  --accent:      #0071e3;
  --accent-hover:#0077ed;
  --nav-bg:      rgba(255,255,255,0.85);
  --shadow:      0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.12);
  --radius:      14px;
  --radius-sm:   8px;
  --transition:  0.3s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg:          #000000;
  --bg-secondary:#1c1c1e;
  --bg-card:     #1c1c1e;
  --text:        #f5f5f7;
  --text-secondary: #98989d;
  --text-tertiary:  #636366;
  --border:      #38383a;
  --accent:      #2997ff;
  --accent-hover:#409cff;
  --nav-bg:      rgba(0,0,0,0.85);
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.5);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; }

/* ─── Navigation ────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex; align-items: center;
  transition: background var(--transition);
}

.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 600; color: var(--text);
}
.nav-logo img { height: 28px; width: auto; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}
.nav-links a {
  padding: 6px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover { background: var(--bg-secondary); color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 12px; }

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background var(--transition), transform var(--transition);
}
.theme-toggle:hover { background: var(--border); transform: scale(1.1); }

/* Mobile Menu */
.nav-mobile-btn {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--text);
}
.nav-drawer {
  display: none; position: fixed; top: 56px; left: 0; right: 0;
  background: var(--nav-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); z-index: 999;
  padding: 16px 24px;
}
.nav-drawer.open { display: block; }
.nav-drawer ul { list-style: none; }
.nav-drawer ul li { border-bottom: 1px solid var(--border); }
.nav-drawer ul li a { display: block; padding: 14px 0; font-size: 16px; color: var(--text); }

/* ─── Hero / Slider ─────────────────────────────────────── */
.hero {
  position: relative; width: 100%; min-height: 100vh;
  overflow: hidden; display: flex; align-items: center;
}

.hero-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.8s ease;
}
.hero-slide.active { opacity: 1; }

.hero-media {
  position: absolute; inset: 0; object-fit: cover;
  width: 100%; height: 100%;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
}

.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 0 24px;
  max-width: 800px;
  animation: fadeUp 0.8s ease forwards;
}

.hero-title {
  font-size: clamp(36px, 6vw, 80px);
  font-weight: 700; line-height: 1.1;
  color: #ffffff; letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 22px);
  color: rgba(255,255,255,0.85);
  margin-bottom: 36px; font-weight: 400;
}

.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #ffffff; padding: 14px 32px;
  border-radius: 980px; font-size: 16px; font-weight: 500;
  backdrop-filter: blur(10px);
  transition: background var(--transition), transform var(--transition);
}
.hero-btn:hover { background: rgba(255,255,255,0.35); transform: scale(1.02); color: #ffffff; }

.hero-dots {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 3;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5); cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  border: none;
}
.hero-dot.active { background: #ffffff; transform: scale(1.3); }

/* Static hero (no slider) */
.hero-static {
  position: relative; width: 100%; min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* ─── Layout ────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.pt-nav { padding-top: 56px; }

.section-header { text-align: center; margin-bottom: 56px; }
.section-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700; letter-spacing: -0.02em; color: var(--text);
}
.section-subtitle { font-size: 18px; color: var(--text-secondary); margin-top: 12px; }

/* ─── Cards ─────────────────────────────────────────────── */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: var(--bg-secondary);
}
.card-thumb-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--text-tertiary);
}

.card-body { padding: 20px; }
.card-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-tertiary);
  margin-bottom: 10px;
}
.card-badge {
  display: inline-block; padding: 3px 10px; border-radius: 980px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.card-title {
  font-size: 18px; font-weight: 600; color: var(--text);
  margin-bottom: 10px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-excerpt {
  font-size: 14px; color: var(--text-secondary); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag-chip {
  display: inline-block; padding: 4px 10px; border-radius: 980px;
  font-size: 12px; background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.tag-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 980px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  border: none; transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: scale(1.02); }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: #ff3b30; color: #fff; }
.btn-danger:hover { background: #d63429; }

/* ─── Post Content ──────────────────────────────────────── */
.post-content {
  max-width: 720px; margin: 0 auto;
  font-size: 18px; line-height: 1.75; color: var(--text);
}
.post-content h1, .post-content h2, .post-content h3 {
  font-weight: 700; letter-spacing: -0.02em; margin: 2em 0 0.75em; color: var(--text);
}
.post-content h2 { font-size: 28px; }
.post-content h3 { font-size: 22px; }
.post-content p { margin-bottom: 1.5em; }
.post-content img { border-radius: var(--radius); margin: 2em 0; width: 100%; }
.post-content code {
  background: var(--bg-secondary); padding: 2px 8px;
  border-radius: 6px; font-size: 0.85em; font-family: 'SF Mono', 'Fira Code', monospace;
}
.post-content pre {
  background: var(--bg-secondary); padding: 24px;
  border-radius: var(--radius); overflow-x: auto; margin: 2em 0;
}
.post-content pre code { background: none; padding: 0; }
.post-content blockquote {
  border-left: 4px solid var(--accent); padding: 16px 24px;
  margin: 2em 0; color: var(--text-secondary);
  background: var(--bg-secondary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 14px; font-weight: 500;
  color: var(--text); margin-bottom: 8px;
}
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}
textarea.form-control { resize: vertical; min-height: 120px; }

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px; margin-bottom: 48px;
}
.footer-col-title {
  font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 16px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.footer-col p, .footer-col a {
  font-size: 13px; color: var(--text-secondary);
  line-height: 2; display: block;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-copy { font-size: 13px; color: var(--text-tertiary); }

/* ─── Alert / Flash ─────────────────────────────────────── */
.alert {
  padding: 14px 20px; border-radius: var(--radius-sm);
  margin-bottom: 20px; font-size: 14px; font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
[data-theme="dark"] .alert-success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .alert-error   { background: #7f1d1d; color: #fca5a5; }

/* ─── Pagination ────────────────────────────────────────── */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 48px; }
.page-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 14px; cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Admin Layout ──────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 260px; min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 200;
  padding: 0 0 32px;
  transition: transform var(--transition);
}

.admin-sidebar-logo {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.admin-sidebar-logo img { height: 32px; }

.admin-nav { padding: 16px 12px; }
.admin-nav-label {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  padding: 0 12px; margin: 20px 0 8px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
  background: var(--bg); color: var(--accent);
}
.admin-nav a .icon { font-size: 16px; width: 20px; text-align: center; }
.admin-nav .badge {
  margin-left: auto; background: #ff3b30; color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 980px;
}

.admin-main {
  margin-left: 260px; flex: 1;
  min-height: 100vh; background: var(--bg);
}

.admin-topbar {
  height: 60px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.admin-topbar-title { font-size: 18px; font-weight: 600; color: var(--text); }
.admin-topbar-right { display: flex; align-items: center; gap: 16px; }

.admin-content { padding: 32px; overflow-x: hidden; }

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.green  { background: #d1fae5; }
.stat-icon.red    { background: #fee2e2; }
[data-theme="dark"] .stat-icon.blue   { background: #1e3a5f; }
[data-theme="dark"] .stat-icon.purple { background: #2e1065; }
[data-theme="dark"] .stat-icon.green  { background: #064e3b; }
[data-theme="dark"] .stat-icon.red    { background: #7f1d1d; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-weight: 600; color: var(--text-secondary); background: var(--bg-secondary); }
tr:hover td { background: var(--bg-secondary); }

/* ─── Login Page ────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; padding: 48px 40px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.login-logo p  { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ─── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-up   { animation: fadeUp 0.6s ease forwards; }
.fade-in   { animation: fadeIn 0.4s ease forwards; }

/* Stagger */
.stagger > * { opacity: 0; animation: fadeUp 0.6s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* ─── Utilities ─────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-btn { display: block; }
  .admin-sidebar { transform: translateX(-260px); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 20px 16px; }
  .section { padding: 48px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; margin: 16px; }
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ─── RTL / Farsi ───────────────────────────────────────── */
[dir="rtl"] {
  font-family: 'Vazirmatn', -apple-system, sans-serif;
}

[dir="rtl"] body {
  font-family: 'Vazirmatn', -apple-system, sans-serif;
  letter-spacing: 0;
}

/* Nav RTL */
[dir="rtl"] .nav-inner { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .nav-right { flex-direction: row-reverse; }
[dir="rtl"] .nav-logo  { flex-direction: row-reverse; }

/* Mobile drawer RTL */
[dir="rtl"] .nav-drawer ul li a { padding-right: 0; padding-left: 0; }

/* Cards RTL */
[dir="rtl"] .card-meta  { flex-direction: row-reverse; }
[dir="rtl"] .card-tags  { flex-direction: row-reverse; }
[dir="rtl"] .card-title { text-align: right; }
[dir="rtl"] .card-excerpt { text-align: right; }
[dir="rtl"] .card-body  { text-align: right; }

/* Hero RTL */
[dir="rtl"] .hero-content { text-align: right; }
[dir="rtl"] .hero-title   { text-align: right; }
[dir="rtl"] .hero-subtitle { text-align: right; }

/* Section headers RTL */
[dir="rtl"] .section-header { text-align: right; }
[dir="rtl"] .section-title  { text-align: right; }
[dir="rtl"] .section-subtitle { text-align: right; }

/* Post content RTL */
[dir="rtl"] .post-content { text-align: right; }
[dir="rtl"] .post-content blockquote {
  border-left: none;
  border-right: 4px solid var(--accent);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Forms RTL */
[dir="rtl"] .form-label   { text-align: right; }
[dir="rtl"] .form-control { text-align: right; direction: rtl; }
[dir="rtl"] select.form-control { text-align: right; }

/* Footer RTL */
[dir="rtl"] .footer-bottom { flex-direction: row-reverse; }
[dir="rtl"] .footer-col    { text-align: right; }
[dir="rtl"] .footer-col-title { text-align: right; }

/* Admin sidebar RTL */
[dir="rtl"] .admin-sidebar {
  left: auto !important;
  right: 0 !important;
  border-right: none !important;
  border-left: 1px solid var(--border) !important;
}
[dir="rtl"] .admin-sidebar.open { transform: translateX(0) !important; }
[dir="rtl"] .admin-main {
  margin-left: 0 !important;
  margin-right: 260px !important;
}
[dir="rtl"] .admin-nav a   { flex-direction: row; text-align: right; }
[dir="rtl"] .admin-nav a .icon { margin: 0; }
[dir="rtl"] .admin-nav .badge  { margin-left: 0; margin-right: auto; }
[dir="rtl"] .admin-topbar  { flex-direction: row-reverse; }
[dir="rtl"] .admin-topbar-right { flex-direction: row-reverse; }
[dir="rtl"] .admin-sidebar-logo { flex-direction: row-reverse; }

/* Tables RTL */
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }

/* Stat cards RTL */
[dir="rtl"] .stat-card { flex-direction: row-reverse; text-align: right; }

/* Pagination RTL */
[dir="rtl"] .pagination { flex-direction: row-reverse; }

/* Alert RTL */
[dir="rtl"] .alert { text-align: right; }

/* Login RTL */
[dir="rtl"] .login-logo { text-align: center; }

/* Buttons RTL */
[dir="rtl"] .btn { flex-direction: row-reverse; }

/* Language switcher */
.lang-switcher {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 980px; padding: 3px;
}
.lang-btn {
  padding: 4px 12px; border-radius: 980px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none; display: inline-block;
}
.lang-btn.active {
  background: var(--accent); color: #ffffff;
}
.lang-btn:hover:not(.active) { color: var(--text); background: var(--border); }

/* RTL mobile */
@media (max-width: 768px) {
  [dir="rtl"] .admin-sidebar { right: 0 !important; left: auto !important; transform: translateX(260px) !important; }
  [dir="rtl"] .admin-sidebar.open { transform: translateX(0) !important; }
  [dir="rtl"] .admin-main { margin-right: 0 !important; }
}

/* ─── SELLERLIST REDESIGN v1 ────────────────────────────────── */

/* hide the old floating .nav completely */
.nav, .nav-drawer { display:none !important; }
.pt-nav { padding-top:0 !important; }

/* ── Two-row sticky header ── */
.sh {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}
.sh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
}
.sh-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.035em;
  text-decoration: none;
}
.sh-logo img { height: 32px; width: auto; vertical-align: middle; }
.sh-controls { display:flex; align-items:center; gap:10px; }

/* Theme toggle */
.sh-theme-btn {
  width:36px; height:36px; border-radius:50%;
  border:1px solid var(--border);
  background:var(--bg-primary);
  cursor:pointer; font-size:15px;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-primary);
  transition:background .2s;
}
.sh-theme-btn:hover { background:var(--bg-secondary); }

/* Lang switcher */
.lang-switcher { display:flex; align-items:center; gap:4px; }
.lang-switcher .lang-btn {
  padding:5px 12px;
  font-size:12px; font-weight:700;
  color:var(--text-secondary);
  border:1px solid var(--border);
  border-radius:20px;
  transition:all .15s;
  text-decoration:none;
}
.lang-switcher .lang-btn:hover,
.lang-switcher .lang-btn.active {
  color:var(--text-primary);
  background:var(--bg-secondary);
  border-color:var(--text-primary);
}

/* Nav row */
.sh-nav {
  display:flex; align-items:center;
  height:50px; padding:0 40px;
}
.sh-links {
  display:flex; align-items:center;
  gap:0; list-style:none; flex:1;
}
.sh-links a {
  display:block; padding:6px 20px;
  font-size:14px; font-weight:500;
  color:var(--text-secondary);
  white-space:nowrap;
  transition:color .15s;
}
.sh-links a:hover { color:var(--text-primary); }

/* Mobile burger */
.sh-mobile-btn {
  display:none;
  background:none; border:none; cursor:pointer;
  color:var(--text-primary); padding:4px;
}

/* Mobile drawer */
.sh-drawer {
  display:none;
  position:fixed; top:0; left:0; right:0; bottom:0;
  z-index:1100;
}
.sh-drawer-overlay {
  position:absolute; inset:0;
  background:rgba(0,0,0,0.45);
}
.sh-drawer-panel {
  position:absolute; top:0; right:0;
  width:280px; height:100%;
  background:var(--bg-primary);
  padding:24px 20px;
  overflow-y:auto;
  box-shadow:-4px 0 24px rgba(0,0,0,0.15);
}
[dir="rtl"] .sh-drawer-panel { right:auto; left:0; box-shadow:4px 0 24px rgba(0,0,0,0.15); }
.sh-drawer-close {
  display:flex; justify-content:flex-end; margin-bottom:20px;
}
.sh-drawer-close button {
  background:none; border:none; font-size:22px;
  cursor:pointer; color:var(--text-secondary);
}
.sh-drawer ul { list-style:none; }
.sh-drawer ul li {
  border-bottom:1px solid var(--border);
}
.sh-drawer ul li:last-child { border-bottom:none; }
.sh-drawer ul li a {
  display:block; padding:14px 4px;
  font-size:16px; font-weight:500;
  color:var(--text-primary);
}
.sh-drawer.open { display:block; }

/* ── Hero ── */
.sl-hero {
  margin: 16px 24px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sl-hero-bg {
  position:absolute; inset:0;
  background:linear-gradient(135deg,#080c14 0%,#0d1730 50%,#110a25 100%);
}
.sl-hero-bg::after {
  content:"";
  position:absolute; inset:0;
  background:
    radial-gradient(ellipse 65% 80% at 15% 55%, rgba(99,60,220,.22) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 30%, rgba(0,180,255,.14) 0%, transparent 55%),
    radial-gradient(ellipse 40% 50% at 50% 100%, rgba(16,185,129,.07) 0%, transparent 50%);
}
.sl-hero-img {
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover; opacity:.25;
}
.sl-hero-inner {
  position:relative; z-index:1;
  text-align:center;
  padding:64px 24px;
  width:100%; max-width:680px;
}
.sl-hero-title {
  font-size:clamp(28px,4.5vw,54px);
  font-weight:800;
  color:#fff;
  letter-spacing:-0.03em;
  line-height:1.1;
  margin:0 0 32px;
}
.sl-search {
  display:flex; align-items:center;
  background:#fff;
  border-radius:50px;
  padding:6px 6px 6px 20px;
  max-width:560px;
  margin:0 auto 24px;
  box-shadow:0 8px 32px rgba(0,0,0,.28);
}
[dir="rtl"] .sl-search { padding:6px 20px 6px 6px; flex-direction:row-reverse; }
.sl-search input {
  flex:1; min-width:0;
  border:none; outline:none;
  font-size:15px; background:transparent; color:#111;
  font-family:inherit;
}
.sl-search input::placeholder { color:#aaa; }
.sl-search-btn {
  width:42px; height:42px; border-radius:50%;
  background:#0891b2;
  border:none; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  transition:background .2s, transform .15s;
}
.sl-search-btn:hover { background:#0e7490; transform:scale(1.05); }
.sl-chips {
  display:flex; flex-wrap:wrap; gap:10px; justify-content:center;
}
.sl-chip {
  padding:8px 20px;
  background:rgba(255,255,255,.13);
  border:1px solid rgba(255,255,255,.28);
  border-radius:50px;
  color:rgba(255,255,255,.9);
  font-size:14px; font-weight:500;
  backdrop-filter:blur(10px);
  transition:all .2s;
  text-decoration:none;
}
.sl-chip:hover {
  background:rgba(255,255,255,.26);
  color:#fff;
  border-color:rgba(255,255,255,.55);
}

/* ── Content sections ── */
.sl-section { padding:40px 0; }
.sl-sec-hdr {
  display:flex; align-items:center;
  justify-content:space-between;
  margin-bottom:20px;
}
.sl-sec-title {
  font-size:20px; font-weight:700;
  color:var(--text-primary);
}
.sl-sec-arrows { display:flex; gap:8px; }
.sl-arr-btn {
  width:36px; height:36px; border-radius:50%;
  border:1px solid var(--border);
  background:var(--bg-primary);
  cursor:pointer; font-size:14px;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-primary);
  transition:all .15s;
  user-select:none;
}
.sl-arr-btn:hover { background:var(--bg-secondary); }

/* ── Horizontal scroll row ── */
.sl-row {
  display:flex; gap:14px;
  overflow-x:auto; scroll-behavior:smooth;
  scrollbar-width:none; padding-bottom:4px;
}
.sl-row::-webkit-scrollbar { display:none; }

.sl-card {
  flex:0 0 calc(20% - 12px);
  min-width:190px;
  border-radius:14px; overflow:hidden;
  text-decoration:none; color:inherit;
  display:block;
  transition:transform .22s;
}
.sl-card:hover { transform:translateY(-4px); }
.sl-card-img {
  aspect-ratio:3/4; overflow:hidden;
  position:relative;
  background:var(--bg-secondary);
  border-radius:14px;
}
.sl-card-img img {
  width:100%; height:100%;
  object-fit:cover;
  transition:transform .3s;
}
.sl-card:hover .sl-card-img img { transform:scale(1.05); }
.sl-card-placeholder {
  width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  font-size:38px;
}
.sl-play-overlay {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none;
}
.sl-play-btn {
  width:44px; height:44px; border-radius:50%;
  background:rgba(0,0,0,.55);
  display:flex; align-items:center; justify-content:center;
}
.sl-card-info { padding:10px 2px 2px; }
.sl-card-title {
  font-size:13px; font-weight:600;
  color:var(--text-primary);
  line-height:1.4;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.sl-card-ago { font-size:11px; color:var(--text-tertiary); margin-top:3px; }

/* ── "View all" link in section header ── */
.sl-sec-view {
  font-size:13px; font-weight:600;
  color:var(--text-secondary);
  text-decoration:none;
  padding:6px 14px;
  border:1px solid var(--border);
  border-radius:20px;
  transition:all .15s;
}
.sl-sec-view:hover { color:var(--text-primary); border-color:var(--text-secondary); }

/* RTL overrides */
[dir="rtl"] .sh-top  { flex-direction:row-reverse; }
[dir="rtl"] .sh-nav  { flex-direction:row-reverse; }
[dir="rtl"] .sh-links { flex-direction:row-reverse; }
[dir="rtl"] .sh-controls { flex-direction:row-reverse; }
[dir="rtl"] .sl-sec-hdr  { flex-direction:row-reverse; }
[dir="rtl"] .sl-chips    { flex-direction:row-reverse; }

/* Mobile */
@media (max-width:768px) {
  .sh-top { padding:0 16px; height:56px; }
  .sh-nav { padding:0 16px; height:46px; }
  .sh-links { display:none; }
  .sh-mobile-btn { display:flex; }
  .sl-hero { margin:8px 12px; border-radius:16px; min-height:280px; }
  .sl-hero-inner { padding:40px 16px; }
  .sl-card { flex:0 0 calc(50% - 7px); min-width:150px; }
}
@media (min-width:769px) and (max-width:1100px) {
  .sl-card { flex:0 0 calc(25% - 11px); }
}

/* ─── END SELLERLIST REDESIGN v1 ─────────────────────────────── */

/* video 80% width on post pages */
.post-video-wrap {
  max-width: 80% !important;
  margin: 0 auto 48px !important;
  border-radius: var(--radius) !important;
  overflow: hidden !important;
  position: relative !important;
  padding-bottom: 45% !important;
  height: 0 !important;
}
.post-video-wrap iframe {
  position:absolute; top:0; left:0;
  width:100%; height:100%; border:none;
}

/* ─── NAV POPUP FIX v1 ────────────────────────────────── */

/* Make the two-row .sh header into a single floating pill */
.sh {
  position: fixed !important;
  top: 12px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: 85% !important;
  max-width: 1200px !important;
  height: 60px !important;
  border-radius: 18px !important;
  border-bottom: none !important;
  z-index: 1000 !important;

  /* Light mode → dark pill */
  background: #1d1d1f !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Dark mode → light pill */
[data-theme="dark"] .sh {
  background: #f5f5f7 !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28) !important;
}

/* Collapse into single row: hide second row, put links in top row */
.sh-top {
  height: 60px !important;
  border-bottom: none !important;
  padding: 0 20px !important;
}

.sh-nav {
  display: none !important;
}

/* Show nav links inside top row (override the hidden-on-mobile rule) */
@media (min-width: 769px) {
  .sh-top { display: flex !important; }
  .sh-nav-inline {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    list-style: none !important;
    flex: 1 !important;
    justify-content: center !important;
  }
  .sh-nav-inline a {
    display: block !important;
    padding: 7px 14px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgba(245,245,247,0.82) !important;
    transition: background .2s, color .2s !important;
    white-space: nowrap !important;
  }
  .sh-nav-inline a:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
  }
  [data-theme="dark"] .sh-nav-inline a       { color: rgba(29,29,31,0.75) !important; }
  [data-theme="dark"] .sh-nav-inline a:hover { background: rgba(0,0,0,0.08) !important; color: #000 !important; }
}

/* Logo in dark pill */
.sh-logo {
  color: #f5f5f7 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}
.sh-logo:hover { color: #fff !important; }
[data-theme="dark"] .sh-logo       { color: #1d1d1f !important; }
[data-theme="dark"] .sh-logo:hover { color: #000 !important; }

/* Theme toggle in dark pill */
.sh-theme-btn {
  background: rgba(255,255,255,0.12) !important;
  border: none !important;
  color: #f5f5f7 !important;
}
.sh-theme-btn:hover { background: rgba(255,255,255,0.22) !important; }
[data-theme="dark"] .sh-theme-btn       { background: rgba(0,0,0,0.08) !important; color: #1d1d1f !important; }
[data-theme="dark"] .sh-theme-btn:hover { background: rgba(0,0,0,0.16) !important; }

/* Lang switcher in dark pill */
.lang-switcher .lang-btn {
  color: rgba(245,245,247,0.65) !important;
  border-color: rgba(255,255,255,0.2) !important;
  background: transparent !important;
}
.lang-switcher .lang-btn:hover,
.lang-switcher .lang-btn.active {
  background: rgba(255,255,255,0.18) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.4) !important;
}
[data-theme="dark"] .lang-switcher .lang-btn       { color: rgba(29,29,31,0.6) !important; border-color: rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .lang-switcher .lang-btn.active { background: rgba(0,0,0,0.12) !important; color: #000 !important; }

/* Mobile hamburger (dark pill) */
.sh-mobile-btn { color: rgba(245,245,247,0.85) !important; }
[data-theme="dark"] .sh-mobile-btn { color: rgba(29,29,31,0.85) !important; }

/* Body offset for floating nav */
main { padding-top: 84px !important; }

/* ── RTL SCROLL FIX ── */
/* In RTL, flex rows lay out right→left. Align start to flex-start (right in RTL). */
[dir="rtl"] .sl-row { justify-content: flex-start; }

/* Mobile */
@media (max-width: 768px) {
  .sh { width: 92% !important; top: 8px !important; height: 54px !important; }
  .sh-top { height: 54px !important; }
  main { padding-top: 72px !important; }
}

/* ─── END NAV POPUP FIX v1 ─────────────────────────────── */

/* sl-hero-video-fix */
.sl-hero-inner {
  max-width: 100% !important;
  padding: 48px 40px !important;
}
.sl-hero-title { margin-bottom: 24px !important; }




/* TUTORIALS GRID v2 */
.tut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  justify-items: start;
}
[dir="rtl"] .tut-grid { justify-items: end; }

.tut-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}
.tut-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.tut-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
}
.tut-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tut-card-body {
  padding: 12px 14px;
}
.tut-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tut-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}
