/* =========================================
   د. محمد الدوسري — Academic Site
   ========================================= */

:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #21262d;
  --border:    #30363d;
  --gold:      #c9a227;
  --gold-dark: #a07c10;
  --text:      #e6edf3;
  --text-muted:#7d8590;
  --green:     #3fb950;
  --red:       #f85149;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAVBAR ── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem; height: 64px;
}
.logo { text-decoration: none; }
.logo-ar {
  font-family: 'Amiri', serif;
  font-size: 1.3rem; color: var(--gold);
  font-weight: 700;
}
.nav-links {
  list-style: none;
  display: flex; align-items: center; gap: .25rem;
}
.nav-links a {
  text-decoration: none; color: var(--text-muted);
  padding: .4rem .8rem; border-radius: 6px;
  font-size: .9rem; transition: all .15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: var(--bg3);
}
.btn-nav {
  background: var(--gold) !important;
  color: #000 !important; font-weight: 600;
}
.btn-nav:hover { background: var(--gold-dark) !important; }

/* ── MAIN ── */
main { flex: 1; }

/* ── HERO ── */
.hero {
  text-align: center; padding: 5rem 1.5rem 3rem;
}
.hero h1 {
  font-family: 'Amiri', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--gold); margin-bottom: .75rem;
}
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto 2rem; }

/* ── SECTIONS GRID ── */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 1000px; margin: 0 auto; padding: 0 1.5rem 4rem;
}
.section-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none; color: var(--text);
  transition: all .2s;
  display: flex; flex-direction: column; gap: .5rem;
}
.section-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.section-card .icon { font-size: 2.5rem; margin-bottom: .5rem; }
.section-card h3 { font-size: 1.2rem; color: var(--gold); }
.section-card p  { font-size: .875rem; color: var(--text-muted); }
.section-card .lock { font-size: .75rem; color: var(--text-muted); margin-top: .5rem; }

/* ── CONTAINER ── */
.container {
  max-width: 860px; margin: 0 auto; padding: 3rem 1.5rem;
}
.container-sm {
  max-width: 480px; margin: 4rem auto; padding: 0 1.5rem;
}

/* ── CARD ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

/* ── PAGE HEADER ── */
.page-title {
  font-family: 'Amiri', serif;
  font-size: 1.8rem; color: var(--gold);
  margin-bottom: .5rem;
}
.page-sub { color: var(--text-muted); margin-bottom: 2rem; font-size: .95rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: .4rem; font-size: .9rem; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: .65rem 1rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: inherit; font-size: 1rem;
  transition: border-color .15s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--gold);
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .65rem 1.5rem; border-radius: 8px;
  font-family: inherit; font-size: 1rem;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; font-weight: 500;
}
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: var(--gold-dark); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #000; }
.btn-sm { padding: .35rem .85rem; font-size: .875rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── ALERTS ── */
.alert {
  padding: .85rem 1.1rem; border-radius: 8px;
  margin-bottom: 1.25rem; font-size: .9rem;
}
.alert-error  { background: rgba(248,81,73,.15); border: 1px solid var(--red);   color: var(--red); }
.alert-success{ background: rgba(63,185,80,.15); border: 1px solid var(--green); color: var(--green); }
.alert-info   { background: rgba(201,162,39,.1); border: 1px solid var(--gold);  color: var(--gold); }

/* ── POSTS LIST ── */
.posts-list { display: flex; flex-direction: column; gap: 1rem; }
.post-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.post-card h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.post-card .meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.post-card .excerpt { color: var(--text-muted); font-size: .9rem; }

/* ── TABLE ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td {
  padding: .75rem 1rem; text-align: right;
  border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--text-muted); font-weight: 500; background: var(--bg2); }
.data-table tr:hover td { background: var(--bg3); }

/* ── BADGE ── */
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.badge-pending  { background: rgba(201,162,39,.2); color: var(--gold); }
.badge-approved { background: rgba(63,185,80,.2);  color: var(--green); }
.badge-none     { background: var(--bg3); color: var(--text-muted); }
.badge-rejected { background: rgba(248,81,73,.2);  color: var(--red); }

/* ── LOCKED BOX ── */
.locked-box {
  text-align: center; padding: 4rem 2rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.locked-box .lock-icon { font-size: 3rem; margin-bottom: 1rem; }
.locked-box h2 { font-size: 1.4rem; color: var(--gold); margin-bottom: .75rem; }
.locked-box p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── FOOTER ── */
.footer {
  text-align: center; padding: 1.5rem;
  color: var(--text-muted); font-size: .8rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

/* ── DASHBOARD STATS ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; text-align: center;
}
.stat-card .stat-val { font-size: 2rem; font-weight: 700; color: var(--gold); }
.stat-card .stat-lbl { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* ── DIVIDER ── */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── PHIL ACCESS REQUEST ── */
.phil-pending { color: var(--gold); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: .4rem .5rem; font-size: .8rem; }
  .logo-ar { font-size: 1rem; }
  .sections-grid { grid-template-columns: 1fr 1fr; }
}
