
/* ═══════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════ */
:root {
  --bg:          #FFFFFF;
  --bg2:         #F8F9FA;
  --bg3:         #F0F2F5;
  --surface:     #FFFFFF;
  --surface2:    #F8F9FA;
  --border:      #E5E7EB;
  --border2:     #D1D5DB;
  --red:         #CC1212;
  --red2:        #A80E0E;
  --red3:        #E53535;
  --red-light:   rgba(204, 18, 18, 0.07);
  --red-light2:  rgba(204, 18, 18, 0.14);
  --gold:        #D97706;
  --green:       #059669;
  --blue:        #2563EB;
  --text:        #111827;
  --text2:       #4B5563;
  --text3:       #9CA3AF;
  --sidebar-w:   280px;
  --topbar-h:    60px;
  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 2px 10px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.10);
  --transition:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font:        'Cairo', sans-serif;
  --font-mono:   'Space Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   FULL-SCREEN SPLASH LOADER
═══════════════════════════════════════════ */
#page-splash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  animation: splashLogoPop 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes splashLogoPop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.splash-name {
  font-family: 'Cairo', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #111827;
  letter-spacing: 0.5px;
  animation: splashFadeUp 0.5s 0.15s ease both;
}

@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-accent {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: #CC1212;
  letter-spacing: 2px;
  margin-top: 10px;
  text-transform: lowercase;
  animation: splashFadeUp 0.5s 0.25s ease both;
}

.splash-bar-track {
  width: 220px;
  height: 3px;
  background: rgba(204,18,18,0.12);
  border-radius: 3px;
  margin-top: 24px;
  overflow: hidden;
  animation: splashFadeUp 0.5s 0.3s ease both;
}

.splash-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #A80E0E, #CC1212, #E53535);
  border-radius: 3px;
  animation: splashProgress 1.8s 0.35s cubic-bezier(0.1, 0.6, 0.4, 1) forwards;
}

@keyframes splashProgress {
  0%   { width: 0%; }
  70%  { width: 90%; }
  95%  { width: 100%; }
  100% { width: 100%; }
}

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: -2px 0 16px rgba(0,0,0,0.04);
}

.sidebar-logo {
  padding: 22px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.logo-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
  line-height: 1;
}

.logo-tagline {
  font-size: 0.64rem;
  color: var(--red);
  font-family: var(--font-mono);
  margin-top: 4px;
  letter-spacing: 0.8px;
}

.nav-section-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text3);
  padding: 16px 20px 8px;
  font-family: var(--font-mono);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px 10px 20px;
  margin: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text2);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(204,18,18,0.12);
}

.nav-item.active {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(204,18,18,0.18);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--red);
  border-radius: 2px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.nav-badge {
  margin-right: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

/* ─── Contributions Dropdown Nav ─── */
.nav-item-with-dropdown {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.nav-item-with-dropdown .nav-item-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px 10px 20px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text2);
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  position: relative;
}

.nav-item-with-dropdown .nav-item-head:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(204,18,18,0.12);
}

.nav-item-with-dropdown.open .nav-item-head {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(204,18,18,0.18);
  font-weight: 700;
}

.nav-dropdown-chevron {
  margin-right: auto;
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
  opacity: 0.6;
}

.nav-item-with-dropdown.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--bg2);
  border-top: 1px solid transparent;
}

.nav-item-with-dropdown.open .nav-dropdown-list {
  max-height: 120px;
  border-top-color: var(--border);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px 9px 26px;
  cursor: pointer;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.nav-dropdown-item:last-child { border-bottom: none; }

.nav-dropdown-item:hover {
  background: var(--red-light);
  color: var(--red);
}

.nav-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* ─── Sidebar Footer ─── */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-mission {
  text-align: center;
}

.sidebar-mission-logo {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  display: block;
}

.sidebar-mission-text {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 7px;
}

.sidebar-mission-sub {
  font-size: 0.67rem;
  color: var(--text3);
  letter-spacing: 0.3px;
  direction: ltr;
  text-align: center;
}

/* Logged-in sidebar footer */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red2), var(--red3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.7rem;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

.sidebar-logout-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
.main {
  margin-right: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.topbar-logo svg { width: 32px; height: 35px; }

.topbar-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.hamburger {
  width: 38px;
  height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  transition: all var(--transition);
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 99;
}

/* ═══════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════ */
.section {
  display: none;
  padding: 32px 44px 56px;
  min-height: calc(100vh - var(--topbar-h));
}

.section.active {
  display: block;
  opacity: 1;
  animation: fadeSlideIn 0.3s ease forwards;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════ */
.section-header {
  margin-bottom: 30px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--red);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  max-width: 50px;
  background: linear-gradient(to left, transparent, var(--red));
  opacity: 0.4;
}

.section-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text2);
  margin-top: 8px;
  line-height: 1.7;
}

/* ═══════════════════════════════════════════
   HOME — HERO
═══════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, rgba(204,18,18,0.03) 0%, rgba(204,18,18,0.01) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 40px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red2), var(--red), var(--red3), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-content { max-width: 560px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red-light);
  border: 1px solid rgba(204,18,18,0.2);
  border-radius: 30px;
  padding: 5px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 16px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.hero-title {
  font-size: 2.7rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero-title span {
  color: var(--red);
}

.hero .hero-desc {
  font-size: 1rem;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--red2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(204,18,18,0.28);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 30px;
  border: 1px solid var(--border2);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

.hero .btn-outline {
  color: var(--text2);
  border-color: var(--border2);
  background: transparent;
}

.hero .btn-outline:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-light);
}

.hero-visual {
  flex-shrink: 0;
  width: 170px;
  height: 170px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 24px rgba(204,18,18,0.18));
}

.disciplines-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.discipline-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 7px 16px 7px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text2);
  transition: all var(--transition);
  cursor: default;
}

.discipline-tag:hover {
  border-color: rgba(204,18,18,0.3);
  color: var(--red);
  background: var(--red-light);
}

.disc-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   GRID ROWS
═══════════════════════════════════════════ */
.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.row-title svg { width: 20px; height: 20px; }

.row-title span {
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--red);
  border-radius: 2px;
}

.row-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--red);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(204,18,18,0.2);
  transition: all var(--transition);
}

.row-link:hover {
  background: var(--red-light);
  border-color: rgba(204,18,18,0.35);
}

.row-link svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 400px;
  gap: 20px;
  margin-bottom: 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card:hover {
  border-color: rgba(204,18,18,0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08), 0 0 0 1px rgba(204,18,18,0.08);
}

.card-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: var(--bg3);
  position: relative;
}

.card-img-placeholder {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg3);
}

.card-cat {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(255,255,255,0.92);
  border: 1px solid;
  backdrop-filter: blur(4px);
}

.cat-physics  { color: #0369A1; border-color: rgba(3,105,161,0.3); }
.cat-bio      { color: #059669; border-color: rgba(5,150,105,0.3); }
.cat-chem     { color: #D97706; border-color: rgba(217,119,6,0.3); }
.cat-astro    { color: #7C3AED; border-color: rgba(124,58,237,0.3); }
.cat-ai       { color: #DB2777; border-color: rgba(219,39,119,0.3); }
.cat-news     { color: #059669; border-color: rgba(5,150,105,0.3); }

.card-body { padding: 16px; flex: 1; min-height: 0; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red2), var(--red3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.card-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text3);
  margin-right: auto;
}

.card-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-top: 1px solid var(--border);
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  overflow: hidden;
  flex-shrink: 0;
  gap: 8px;
}

.card-views {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--text3);
}

.card-views svg { width: 14px; height: 14px; }

.card-read-btn {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--red);
  background: var(--red-light);
  border: 1px solid rgba(204,18,18,0.2);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.card-read-btn:hover {
  background: var(--red-light2);
  border-color: rgba(204,18,18,0.4);
}

/* ═══════════════════════════════════════════
   FEATURES GRID
═══════════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 44px;
}

.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover::before { opacity: 1; }

.feature-card:hover {
  border-color: rgba(204,18,18,0.2);
  background: var(--surface);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
}

.feature-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   FILTER TABS
═══════════════════════════════════════════ */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  transition: all var(--transition);
}

.filter-tab:hover {
  border-color: rgba(204,18,18,0.3);
  color: var(--red);
}

.filter-tab.active {
  background: var(--red-light);
  border-color: rgba(204,18,18,0.35);
  color: var(--red);
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-container {
  max-width: 660px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}

.form-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 28px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 7px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text3); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204,18,18,0.1);
  background: var(--surface);
}

.form-select option { background: var(--surface); color: var(--text); }

.form-textarea { min-height: 120px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }


/* ── PASSWORD RULES CHECKLIST ── */
.pwd-rules {
  display: none;
  margin-top: 0.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(140,140,140,0.25);
  border-radius: 10px;
  background: rgba(140,140,140,0.06);
}
.pwd-rules.open { display: block; animation: pwdDrop 0.22s ease; }
@keyframes pwdDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pwd-rule {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.9;
  color: var(--muted, #888);
}
.pwd-rule .pwd-dot {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(140,140,140,0.55);
  background: transparent;
  position: relative;
  transition: all 0.2s ease;
}
.pwd-rule.ok { color: #1a9e4b; }
.pwd-rule.ok .pwd-dot { border-color: #1a9e4b; background: #1a9e4b; }
.pwd-rule.ok .pwd-dot::after {
  content: '';
  position: absolute; inset: 0;
  background: no-repeat center/9px 9px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.form-input.invalid { border-color: #CC1212 !important; }
.field-error { display: none; margin-top: 0.35rem; font-size: 0.75rem; color: #CC1212; }
.field-error.show { display: block; }

.form-submit {
  width: 100%;
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.form-submit:hover {
  background: var(--red2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(204,18,18,0.25);
}

.form-submit svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════
   LOGIN / REGISTER
═══════════════════════════════════════════ */
.auth-container {
  max-width: 440px;
  margin: 0 auto;
}

.auth-tabs {
  display: flex;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text2);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--red);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.auth-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-social-btn:hover {
  border-color: var(--border2);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-social-btn svg { width: 18px; height: 18px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text3);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  min-width: 280px;
  max-width: 360px;
  animation: toastIn 0.3s ease both;
  border-right: 3px solid var(--red);
}

.toast.toast-success { border-right-color: var(--green); }
.toast.toast-error   { border-right-color: var(--red); }

.toast svg { width: 20px; height: 20px; flex-shrink: 0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════
   WELCOME MODAL
═══════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  place-items: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show { display: grid; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: modalIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  box-shadow: var(--shadow-lg);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red2), var(--red), var(--red3));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 22px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 0.92rem;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 28px;
}

.modal-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
  text-align: right;
}

.modal-highlight {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text2);
}

.modal-highlight svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--red); }

.modal-close-btn {
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 40px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close-btn:hover {
  background: var(--red2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(204,18,18,0.28);
}

/* ═══════════════════════════════════════════
   DETAIL PAGE
═══════════════════════════════════════════ */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(204,18,18,0.2);
  background: var(--red-light);
  margin-bottom: 28px;
  transition: all var(--transition);
  font-family: var(--font);
}
.detail-back:hover { background: var(--red-light2); border-color: rgba(204,18,18,0.4); }
.detail-back svg { width: 18px; height: 18px; }

.detail-hero-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  display: block;
  border: 1px solid var(--border);
}

.detail-cat-badge {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.detail-title {
  font-size: 1.95rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 20px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red2), var(--red3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.detail-author-name { font-size: 0.96rem; font-weight: 700; color: var(--text); }
.detail-author-date { font-size: 0.76rem; color: var(--text3); font-family: var(--font-mono); margin-top: 3px; }

.detail-body {
  font-size: 0.97rem;
  color: var(--text2);
  line-height: 1.9;
  margin-bottom: 40px;
}

.detail-body h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 28px 0 12px;
}

.detail-body p { margin-bottom: 16px; }

.detail-body blockquote {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.7;
  margin: 26px 0;
  font-style: normal;
}

/* أي نص بين علامتي تنصيص يظهر للأعضاء بحجم كبير */
.detail-body .article-quote {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.7;
}

/* وضع التعديل: تظهر الاقتباسات بشكلها الأصلي كنص عادي */
.detail-body.editing blockquote,
.detail-body.editing .article-quote {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: inherit;
  margin: 0 0 16px;
  font-style: normal;
}

/* ═══ قائمة الثلاث نقاط للمدير على بطاقات الأخبار/التقارير ═══ */
.card-menu-wrap { position: absolute; top: 10px; left: 10px; z-index: 6; }
.card-menu-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.card-menu-btn:hover { background: #fff; box-shadow: var(--shadow-md); }
.card-menu-btn svg { color: var(--text2); }
.card-menu {
  position: absolute; top: 42px; left: 0;
  min-width: 138px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.card-menu.show { display: flex; }
.card-menu-item {
  padding: 11px 16px;
  font-size: 0.86rem; font-weight: 700; font-family: var(--font);
  color: var(--text);
  background: none; border: none;
  text-align: right;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--transition);
}
.card-menu-item:hover { background: var(--red-light); }
.card-menu-item.menu-delete { color: var(--red); }
.card-menu-item svg { flex-shrink: 0; }

/* ═══ وضع تعديل المدير داخل صفحة التفاصيل ═══ */
.detail-desc {
  font-size: 0.97rem;
  color: var(--text2);
  line-height: 1.9;
  margin-bottom: 22px;
}
.editable-field, .detail-body.editing {
  outline: 1.5px dashed var(--border2);
  outline-offset: 6px;
  border-radius: 6px;
  cursor: text;
  transition: outline-color var(--transition), background var(--transition);
}
.editable-field:hover, .detail-body.editing:hover { outline-color: var(--red3); }
.editable-field:focus, .detail-body.editing:focus { outline-color: var(--red); background: var(--red-light); }

/* ═══ زر إضافة تقرير/خبر للمدير + منتقي الأقسام ═══ */
.admin-add-bar { display: none; margin: 0 0 22px; }
.admin-add-bar.show { display: flex; justify-content: flex-start; }
.admin-add-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border: none; border-radius: 999px;
  background: var(--red); color: #fff; cursor: pointer;
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  box-shadow: 0 6px 18px rgba(204,18,18,.25);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.admin-add-btn:hover { background: #a30f0f; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(204,18,18,.32); }
.admin-add-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.4; }

.cat-picker-wrap { position: relative; }
.cat-picker-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--border2); background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 0.88rem; font-weight: 700;
  transition: border-color var(--transition), background var(--transition);
}
.cat-picker-btn:hover { border-color: var(--red); background: var(--red-light); }
.cat-picker-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.cat-picker-panel {
  display: none; position: absolute; z-index: 60; top: calc(100% + 8px); inset-inline-start: 0;
  min-width: 250px; padding: 8px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border2);
  box-shadow: 0 16px 40px rgba(0,0,0,.14);
}
.cat-picker-panel.show { display: block; }
.cat-picker-panel-title {
  font-size: 0.74rem; font-weight: 800; letter-spacing: .06em;
  color: var(--text2); padding: 6px 10px 8px;
}
.cat-picker-option {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 9px 11px; border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 0.88rem; font-weight: 600; text-align: start;
}
.cat-picker-option:hover { background: var(--red-light); color: var(--red); }
.cat-picker-option.selected { background: var(--red); color: #fff; }

.detail-img-wrap { position: relative; }
.detail-img-edit-btn {
  position: absolute; bottom: 14px; left: 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(17,24,39,0.78);
  color: #fff;
  font-size: 0.83rem; font-weight: 700; font-family: var(--font);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background var(--transition);
}
.detail-img-edit-btn:hover { background: var(--red); }
.detail-edit-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 8px 0 30px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
}
.edit-save-btn {
  padding: 11px 26px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font-size: 0.9rem; font-weight: 800; font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition);
}
.edit-save-btn:hover { background: var(--red2); }
.edit-cancel-btn {
  padding: 11px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text2);
  font-size: 0.9rem; font-weight: 700; font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}
.edit-cancel-btn:hover { border-color: var(--border2); color: var(--text); }
.edit-hint { font-size: 0.78rem; color: var(--text3); flex-basis: 100%; }

.detail-related { margin-top: 12px; }

.detail-related-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-related-title span {
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--red);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════
   ACCOUNT PAGE
═══════════════════════════════════════════ */
.account-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  max-width: 900px;
}

.account-profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.account-avatar-big {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red2), var(--red3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(204,18,18,0.25);
}

.account-name-display {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.account-email-display {
  font-size: 0.8rem;
  color: var(--text3);
  font-family: var(--font-mono);
  margin-bottom: 20px;
  word-break: break-all;
}

.account-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.account-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}

.account-stat-num {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--red);
  font-family: var(--font-mono);
}

.account-stat-label {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 2px;
}

.account-logout-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.account-logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

.account-logout-btn svg { width: 18px; height: 18px; }

.account-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.settings-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-card-title svg { width: 20px; height: 20px; color: var(--red); }

.settings-save-btn {
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-save-btn:hover {
  background: var(--red2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(204,18,18,0.22);
}

/* ═══════════════════════════════════════════
   MY CONTRIBUTIONS PAGE
═══════════════════════════════════════════ */
.my-contrib-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

.my-contrib-empty svg {
  width: 64px;
  height: 64px;
  opacity: 0.25;
  margin-bottom: 16px;
}

.my-contrib-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 8px;
}

.my-contrib-empty-sub {
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════
   IMAGE CROPPER OVERLAY
═══════════════════════════════════════════ */
.cropper-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.cropper-overlay.show { display: flex; }

.cropper-wrapper {
  position: relative;
  width: 600px;
  max-width: 90vw;
  user-select: none;
}

.cropper-frame {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  background: #111;
  cursor: ns-resize;
  touch-action: none;
}

.cropper-img {
  width: 100%;
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(0px);
  will-change: transform;
  pointer-events: none;
  transition: none;
}

.cropper-guide-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cropper-guide-lines::before,
.cropper-guide-lines::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.2);
}

.cropper-guide-lines::before { top: 33.33%; }
.cropper-guide-lines::after  { top: 66.66%; }

/* ═══════════ PDF LIBRARY ═══════════ */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 22px;
}
@media (max-width: 640px) {
  .pdf-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
.pdf-card {
  background: var(--card-bg, #fff);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pdf-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,0.12); }
.pdf-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: #eceae5;
}
.pdf-card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pdf-card-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  min-height: 2.9em;
}
.pdf-btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: filter .15s ease;
}
.pdf-btn:hover { filter: brightness(0.93); }
.pdf-btn svg { width: 17px; height: 17px; }
.pdf-btn-download { background: #059669; color: #fff; }
.pdf-btn-read { background: #e5e7eb; color: #374151; }
.pdf-delete-btn {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(204,18,18,0.92);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 3;
}
.pdf-delete-btn svg { width: 17px; height: 17px; }
.pdf-add-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #059669; color: #fff;
  border: none; border-radius: 8px;
  padding: 11px 18px;
  font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  cursor: pointer; margin-bottom: 22px;
}
.pdf-add-btn svg { width: 18px; height: 18px; }
.pdf-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 1900;
  align-items: center; justify-content: center; padding: 18px;
}
.pdf-modal-overlay.show { display: flex; }
.pdf-modal {
  background: #fff; border-radius: 12px; width: 440px; max-width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 22px;
}
.pdf-modal h3 { font-family: var(--font); font-size: 1.1rem; margin: 0 0 16px; }
.pdf-modal label { display: block; font-family: var(--font); font-size: 0.85rem; font-weight: 700; margin: 12px 0 6px; }
.pdf-modal input[type=text] {
  width: 100%; padding: 10px 12px; border: 1px solid #d8d5cf;
  border-radius: 8px; font-family: var(--font); font-size: 0.9rem;
}
.pdf-pick {
  width: 100%; padding: 11px; border: 1px dashed #b9b5ac; background: #faf9f7;
  border-radius: 8px; font-family: var(--font); font-size: 0.85rem; cursor: pointer;
}
.pdf-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.pdf-modal-actions button { flex: 1; padding: 11px; border-radius: 8px; border: none; font-family: var(--font); font-weight: 700; cursor: pointer; }
.pdf-save-btn { background: #059669; color: #fff; }
.pdf-cancel-btn { background: #e5e7eb; color: #374151; }
.pdf-cover-preview { width: 110px; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; margin-top: 10px; display: none; }
.pdf-empty { font-family: var(--font); color: #6b7280; text-align: center; padding: 40px 0; }

.cropper-instructions {
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  margin-top: 14px;
  font-family: var(--font);
}

.cropper-confirm-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  cursor: pointer;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(5,150,105,0.5);
}

.cropper-confirm-btn:hover {
  background: #047857;
  transform: scale(1.08);
}

.cropper-confirm-btn svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

/* Image upload area */
.image-upload-area {
  width: 100%;
  border: 2px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg2);
  position: relative;
}

.image-upload-area:hover,
.image-upload-area.drag-over {
  border-color: var(--red);
  background: var(--red-light);
}

.image-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.image-upload-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--text3);
}

.image-upload-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}

.image-upload-sub {
  font-size: 0.76rem;
  color: var(--text3);
}

.image-upload-preview-wrap {
  display: none;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.image-upload-preview-wrap.show { display: block; }

.image-upload-preview {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
}

.image-upload-change {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.image-upload-change:hover { background: rgba(0,0,0,0.9); }

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET
═══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid    { grid-template-columns: repeat(2, 1fr); }
  .account-grid  { grid-template-columns: 1fr; }
  .account-profile-card { position: static; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show { display: block; }

  .topbar { display: flex; }

  .main {
    margin-right: 0;
  }

  .section {
    padding: 24px 16px 40px;
  }

  .hero {
    padding: 28px 20px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .hero-visual {
    width: 110px;
    height: 110px;
    align-self: center;
  }

  .hero-title { font-size: 1.8rem; }

  .cards-grid { grid-template-columns: 1fr; }

  .features-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .form-card { padding: 20px; }

  .modal { padding: 28px 20px; }

  .modal-highlights { grid-template-columns: 1fr; }

  .section-title { font-size: 1.5rem; }

  .auth-container { max-width: 100%; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn-primary,
  .hero-actions .btn-outline { justify-content: center; }

  .disciplines-strip { gap: 8px; }

  .account-grid { grid-template-columns: 1fr; }
  .cropper-wrapper { width: 92vw; }
}

@media (max-width: 480px) {
  .discipline-tag { font-size: 0.8rem; padding: 6px 12px 6px 10px; }
}

/* ═══════════════════════════════════════════
   ACCOUNT PAGE — NEW LAYOUT
═══════════════════════════════════════════ */
.account-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
  max-width: 820px;
  align-items: start;
}

.account-profile-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  text-align: center;
  position: sticky;
  top: 20px;
}

.account-avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.account-avatar-wrap:hover .avatar-change-overlay { opacity: 1; }

.avatar-change-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.avatar-change-overlay svg { width: 22px; height: 22px; color: #fff; }

.account-profile-info { width: 100%; }

.account-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 768px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-profile-card-top { position: static; flex-direction: row; text-align: right; }
}

.account-action-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.account-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  transition: all var(--transition);
}

.account-action-btn:hover {
  background: var(--red-light);
  color: var(--red);
}

.account-action-btn.account-action-logout:hover {
  background: rgba(204,18,18,0.07);
  color: var(--red);
}

.action-chevron {
  width: 18px;
  height: 18px;
  margin-right: auto;
  transition: transform var(--transition);
  opacity: 0.5;
  flex-shrink: 0;
}

.account-action-item.open .action-chevron {
  transform: rotate(180deg);
}

.account-action-item.open .account-action-btn {
  background: var(--red-light);
  color: var(--red);
  border-bottom: 1px solid var(--border);
}

.account-action-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.3s;
  padding: 0 20px;
  background: var(--bg2);
}

.account-action-item.open .account-action-panel {
  max-height: 400px;
  padding: 20px;
}

.account-contrib-sub-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
}

.account-contrib-sub-btn:hover {
  border-color: rgba(204,18,18,0.3);
  color: var(--red);
  background: var(--red-light);
}

@media (max-width: 768px) {
  .account-profile-card-top {
    flex-direction: column;
    text-align: center;
  }
}


/* ═══════════════════════════════════════════
   CONTRIBUTION STATUS BADGES
═══════════════════════════════════════════ */
.cards-grid-contrib {
  display: grid;
  /* minmax(0, 1fr): يمنع المحتوى الطويل (مثل سبب الرفض) من تمديد العمود —
     كل البطاقات بنفس العرض والارتفاع الثابت مهما كان محتواها */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 400px;
  gap: 20px;
  margin-bottom: 48px;
}

.contrib-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font);
  width: fit-content;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Status badge wrapper inside card footer */
.mycontrib-status-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  display: flex;
  align-items: center;
  height: 100%;
}
.mycontrib-status-wrap::-webkit-scrollbar { display: none; }
.mycontrib-status-wrap:active { cursor: grabbing; }
.mycontrib-status-wrap .contrib-status {
  display: inline-flex;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: none;
  margin-bottom: 0;
}

.contrib-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.contrib-status-pending {
  background: #1a1a1a;
  border-color: #000;
  color: #fff;
}
.contrib-status-pending .contrib-status-dot {
  background: #bbb;
  animation: pulse 2s ease-in-out infinite;
}

.contrib-status-accepted {
  background: #059669;
  border-color: #047857;
  color: #fff;
}
.contrib-status-accepted .contrib-status-dot { background: rgba(255,255,255,0.8); }

.contrib-status-rejected {
  background: #CC1212;
  border-color: #A80E0E;
  color: #fff;
}
.contrib-status-rejected .contrib-status-dot { background: rgba(255,255,255,0.8); }

.contrib-reject-reason {
  font-weight: 500;
  opacity: 0.85;
  font-size: 0.73rem;
}

/* (legacy — no longer rendered) */

/* Admin action buttons at bottom of detail page */
.detail-admin-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

@media (max-width: 1100px) { .cards-grid-contrib { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .cards-grid-contrib { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════
   ADMIN STYLES
═══════════════════════════════════════════ */
.admin-cards-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
}
.admin-req-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-req-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border2);
}
.admin-req-card-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.admin-req-card-info { flex: 1; min-width: 0; }
.admin-req-card-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-req-card-meta {
  font-size: 0.78rem;
  color: var(--text2);
  display: flex; gap: 12px; flex-wrap: wrap;
}
.admin-req-card-meta span { display: flex; align-items: center; gap: 4px; }
.admin-req-card-arrow {
  color: var(--text3);
  flex-shrink: 0;
}
.admin-detail-page {
  max-width: 740px;
  margin: 0 auto;
}
.admin-detail-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
}
.admin-detail-box h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 14px;
}
.admin-detail-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.admin-detail-row:last-child { border-bottom: none; }
.admin-detail-label {
  font-size: 0.82rem; color: var(--text3); width: 140px; flex-shrink: 0; padding-top: 1px;
}
.admin-detail-value {
  font-size: 0.9rem; color: var(--text); font-weight: 600; flex: 1;
}
.admin-detail-value.details-text {
  font-weight: 400; line-height: 1.65; color: var(--text2);
}

/* Admin contrib card with delete btn */
.admin-contrib-card-wrap {
  position: relative;
  height: 100%;
  min-width: 0;
}
.admin-contrib-card-wrap .card {
  height: 100%;
}
.admin-delete-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: #CC1212;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
  box-shadow: 0 2px 8px rgba(204,18,18,0.25);
}
.admin-delete-btn:hover {
  background: #A80E0E;
  transform: scale(1.08);
}
.admin-contrib-detail-actions {
  display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap;
}
.admin-action-accept-btn {
  flex: 1; min-width: 150px;
  background: var(--green);
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.18s;
  font-family: var(--font);
}
.admin-action-accept-btn:hover { background: #047857; }
.admin-action-reject-btn {
  flex: 1; min-width: 150px;
  background: var(--red);
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.18s;
  font-family: var(--font);
}
.admin-action-reject-btn:hover { background: var(--red2); }

/* Admin confirm/reject modals */
.admin-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
}
.admin-modal-overlay.show {
  opacity: 1; pointer-events: all;
}
.admin-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.admin-modal-title {
  font-size: 1.15rem; font-weight: 800;
  color: var(--text); margin-bottom: 10px;
}
.admin-modal-body {
  font-size: 0.9rem; color: var(--text2);
  line-height: 1.65; margin-bottom: 22px;
}
.admin-modal-warning {
  background: var(--red-light);
  border: 1px solid var(--red-light2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--red);
  margin-bottom: 22px;
  line-height: 1.55;
}
.admin-modal-btns {
  display: flex; gap: 10px;
}
.admin-modal-btns .btn-cancel {
  flex: 1; padding: 11px; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); background: var(--bg2);
  color: var(--text); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}
.admin-modal-btns .btn-confirm-delete {
  flex: 1; padding: 11px; border: none;
  border-radius: var(--radius-sm); background: var(--red);
  color: #fff; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; font-family: var(--font);
}
.admin-modal-btns .btn-confirm-accept {
  flex: 1; padding: 11px; border: none;
  border-radius: var(--radius-sm); background: var(--green);
  color: #fff; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; font-family: var(--font);
}
.admin-modal-btns .btn-confirm-reject {
  flex: 1; padding: 11px; border: none;
  border-radius: var(--radius-sm); background: var(--red);
  color: #fff; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; font-family: var(--font);
}
.admin-reject-reason-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg2);
  resize: vertical;
  min-height: 90px;
  margin-bottom: 16px;
}
.admin-contrib-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; font-weight: 700;
  padding: 4px 11px; border-radius: 20px;
  margin-top: 8px;
}
.admin-contrib-status-badge.pending  { background: #FEF3C7; color: #92400E; }
.admin-contrib-status-badge.accepted { background: #D1FAE5; color: #065F46; }
.admin-contrib-status-badge.rejected { background: #FEE2E2; color: #991B1B; }
.admin-empty-state {
  text-align: center; padding: 60px 20px; color: var(--text3);
}
.admin-empty-state svg { width: 52px; height: 52px; opacity: 0.3; margin-bottom: 14px; }
.admin-empty-state-title { font-size: 1.05rem; font-weight: 700; color: var(--text2); margin-bottom: 6px; }

/* Back button for admin sub-pages */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); border-radius: var(--radius-sm);
  padding: 9px 18px; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: background var(--transition), border-color var(--transition);
  margin-bottom: 24px;
}
.back-btn:hover { background: var(--bg3); border-color: var(--border2); color: var(--text); }

/* ═══════════════════════════════════════════
   UNIFIED FONT — force Cairo across all pages
═══════════════════════════════════════════ */
:root {
  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-latin: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

.splash-accent { font-family: var(--font); letter-spacing: 1px; }

/* Logo renders at its natural image size (no forced 48x48 / 32x35 box) */
.logo-icon {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

.splash-logo {
  width: auto;
  height: auto;
  max-width: 180px;
  max-height: 180px;
}

.sidebar-mission-logo {
  width: auto;
  height: auto;
  max-width: 72px;
  max-height: 72px;
}

/* ═══════════════════════════════════════════
   HOME REDESIGN — STATS / SECTIONS / EMPTY / CTA
═══════════════════════════════════════════ */

/* ─── Stats strip ─── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), border-color var(--transition);
}

.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(204,18,18,0.22);
}

.stat-num {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}

/* ─── Sections grid ─── */
.sec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 44px;
}

.sec-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  min-width: 0;
}

.sec-card:hover {
  border-color: rgba(204,18,18,0.25);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.07);
}

.sec-card-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.sec-card-icon svg {
  width: 24px;
  height: 24px;
}

.sec-card-icon.cat-physics { color: #0369A1; }
.sec-card-icon.cat-bio     { color: #059669; }
.sec-card-icon.cat-chem    { color: #D97706; }
.sec-card-icon.cat-astro   { color: #7C3AED; }
.sec-card-icon.cat-ai      { color: #DB2777; }
.sec-card-icon.cat-math    { color: #2563EB; }

.sec-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sec-card-meta {
  font-size: 0.72rem;
  color: var(--text3);
  font-family: var(--font-mono);
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}

.empty-state svg {
  width: 52px;
  height: 52px;
  opacity: 0.28;
  margin-bottom: 14px;
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 0.88rem;
  color: var(--text3);
  line-height: 1.7;
  margin-bottom: 18px;
}

.empty-state .btn-outline {
  display: inline-flex;
}

/* ─── CTA banner ─── */
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(204,18,18,0.06) 0%, rgba(204,18,18,0.02) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red2), var(--red), var(--red3), transparent);
}

.cta-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.cta-desc {
  font-size: 0.92rem;
  color: var(--text2);
  line-height: 1.7;
}

/* ─── Home redesign responsive ─── */
@media (max-width: 1100px) {
  .sec-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sec-grid { grid-template-columns: 1fr; gap: 12px; }
  .cta-banner { padding: 26px 22px; }
}

@media (max-width: 480px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .cta-banner { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════
   عرض المقالات + تحسينات الجوال
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .section { padding: 24px 16px 40px; }
}

@media (max-width: 768px) {
  .detail-page { padding: 0; }
  .article { padding: 22px 18px; }
  .article-cover { max-height: 300px; }
  .cards-grid { grid-auto-rows: auto; }
  .card { display: flex; flex-direction: column; }
  .article-content { font-size: 0.98rem; line-height: 1.95; }
  .article-content p { font-size: 0.98rem; }
  .article-content h2 { font-size: 1.3rem; }
  .article-content blockquote { padding: 12px 14px; }
  .article-content code { overflow-wrap: break-word; }
  .article-tools { flex-direction: column; }
  .article-tools .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .article { padding: 18px 14px; }
  .article-header h1 { font-size: 1.4rem; }
  .article-meta { gap: 10px; font-size: 0.78rem; }
  .article-content { font-size: 0.96rem; line-height: 1.9; }
  .comment { padding: 14px; }
  .comment-form { padding: 16px !important; }
  .section-head h2 { font-size: 1.25rem; }
}

/* ============ عرض كامل للشاشات الكبيرة ============ */
.main { max-width: none; width: 100%; }
.detail-page { max-width: none; margin: 0; }

