/* ═══════════════════════════════════════════════
   Book Mentor — Base / Global Styles
   ═══════════════════════════════════════════════ */

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

/* ── Typography & Body ── */
body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Site logo — sizes controlled by variables.css BRAND CONFIG ── */
.site-logo {
  display: block;
  width: auto;
  max-width: 100%;
  flex-shrink: 0;
  object-fit: contain;
}
/* navbar: public site top bar */
.navbar-logo .site-logo {
  height: var(--logo-height-nav);
  max-width: 160px;
}
/* sidebar: dashboard left panel — height is the visible logo, NOT including wrapper padding */
.sidebar-logo .site-logo {
  height: var(--logo-height-nav);
  max-width: 150px;
}
/* auth brand panel (desktop) */
.brand-logo .site-logo {
  height: var(--logo-height-auth);
  max-width: 200px;
}
/* auth mobile top */
.mobile-logo .site-logo {
  height: var(--logo-height-mobile);
  max-width: 140px;
}
/* footer */
.site-footer__brand .site-logo {
  height: var(--logo-height-footer);
  max-width: 120px;
  opacity: .85;
}

/* ── Layout ── */
.container    { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 700px;  margin: 0 auto; padding: 0 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 22px; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; min-height: 40px;
  transition: all .18s; text-decoration: none; white-space: nowrap;
}
.btn:hover        { text-decoration: none; transform: translateY(-1px); }
.btn-primary      { background: var(--primary); color: #fff; }
.btn-primary:hover{ background: var(--primary-dark); box-shadow: var(--shadow-brand); color: #fff; }
.btn-ghost        { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover  { color: var(--text); border-color: var(--border-strong); }
.btn-white        { background: #fff; color: var(--text); }
.btn-white:hover  { background: #f1f5f9; color: var(--text); }
.btn-danger       { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm           { padding: 7px 16px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg           { padding: 14px 32px; font-size: 16px; border-radius: 12px; }
.btn-block        { width: 100%; }
.btn-full         { width: 100%; justify-content: center; }

/* ── Loading state ── */
.btn[data-loading="true"],
.btn:disabled     { opacity: .65; cursor: not-allowed; pointer-events: none; }
.btn-loading      { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ''; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin: auto;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards ── */
.card { background: var(--surface); border-radius: var(--r); border: 1px solid var(--border); box-shadow: var(--shadow); }

/* ── Forms ── */
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }
.form-control {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: 10px;
  background: #fff; transition: border-color .18s, box-shadow .18s;
  direction: rtl; font-size: 15px;
}
.form-control:focus       { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.form-control.is-invalid  { border-color: var(--danger); }
.form-label                { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; color: var(--text); }
.form-hint                 { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.form-group                { margin-bottom: 20px; }
.invalid-feedback          { font-size: 12px; color: var(--danger); margin-top: 4px; }
.text-danger               { color: var(--danger); }
.form-check                { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.form-check input          { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--primary); }

/* ── Badges ── */
.badge        { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green  { background: var(--success-bg);  color: var(--success); }
.badge-amber  { background: var(--warning-bg);  color: var(--warning); }
.badge-red    { background: var(--danger-bg);   color: var(--danger);  }
.badge-purple { background: var(--primary-light); color: var(--primary-dark); }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-gray   { background: #f1f5f9; color: var(--muted); }

/* ── Alerts ── */
.alert         { padding: 13px 16px; border-radius: 10px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.alert-success { background: var(--success-bg);  border: 1px solid var(--success-border); color: #15803d; }
.alert-error   { background: var(--danger-bg);   border: 1px solid var(--danger-border);  color: var(--danger); }
.alert-info    { background: var(--info-bg);     border: 1px solid var(--info-border);    color: var(--info-text); }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }

/* ── Page header (generic) ── */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-title {
  font-size: 20px; font-weight: 800; color: var(--text); margin: 0;
}

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Navbar ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.navbar-logo {
  font-weight: 800; font-size: 20px; color: var(--primary);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.navbar-logo:hover { text-decoration: none; color: var(--primary-dark); }
.navbar-actions    { display: flex; align-items: center; gap: 8px; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0; margin-top: 80px;
  text-align: center; color: var(--muted); font-size: 13px;
}
.site-footer__brand {
  font-weight: 700; color: var(--primary);
  margin-bottom: 8px; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.footer-links {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; margin-top: 12px; flex-wrap: wrap;
}
.footer-links a { color: var(--muted); font-size: 13px; transition: color .15s; }
.footer-links a:hover { color: var(--primary); text-decoration: none; }

/* ── Avatar component ── */
.avatar {
  border-radius: 50%; object-fit: cover;
  display: block; flex-shrink: 0;
}
.avatar--sm  { width: 36px;  height: 36px;  font-size: 16px; }
.avatar--md  { width: 64px;  height: 64px;  font-size: 28px; }
.avatar--lg  { width: 96px;  height: 96px;  font-size: 42px; }
.avatar--placeholder {
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  border: 3px solid var(--primary-light);
}

/* ── Empty state ── */
.empty-state          { text-align: center; padding: 48px 20px; }
.empty-state__icon    { font-size: 52px; margin-bottom: 16px; line-height: 1; }
.empty-state__title   { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state__sub     { font-size: 14px; color: var(--muted); max-width: 380px; margin: 0 auto 20px; line-height: 1.7; }

/* ── Meta chip (page duration / price) ── */
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  background: var(--bg); border: 1px solid var(--border);
}
.meta-chip--accent { color: var(--chip-color, var(--primary)); }
.meta-chip--free   { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }

/* ── Responsive helpers ── */
@media (max-width: 768px) {
  .container, .container-sm { padding: 0 16px; }
  .btn-lg { padding: 13px 24px; font-size: 15px; }
  .hide-mobile { display: none !important; }
  /* Touch target minimum */
  .btn, .nav-item, .filter-tab { min-height: 44px; }
  /* Table overflow on mobile */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}
