/* ═══════════════════════════════════════════════════
   NOOR — Components CSS: Shared UI Elements
   ═══════════════════════════════════════════════════ */

/* ── Home / Hero ── */
.home {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.hero { text-align: center; padding: 56px 16px 20px; }
.hero-ar { font-family: var(--font-arabic); font-size: 26px; color: var(--gold-500); margin-bottom: 18px; opacity: 0; animation: hIn 1s var(--ease) .2s forwards; }
.hero-h1 { font-size: clamp(26px, 5vw, 42px); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 14px; opacity: 0; animation: hIn 1s var(--ease) .35s forwards; }
.hl { background: linear-gradient(135deg, var(--emerald-600), var(--emerald-400)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-p { font-size: 15px; color: var(--text-2); max-width: 500px; margin: 0 auto; line-height: 1.7; opacity: 0; animation: hIn 1s var(--ease) .5s forwards; }

.hero-divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0 8px; opacity: 0; animation: hIn 1s var(--ease) .6s forwards; }
.hero-divider-line { flex: 1; max-width: 80px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-400), transparent); }
.hero-divider-star { color: var(--gold-400); font-size: 10px; }

.stats-bar { display: flex; justify-content: center; gap: 28px; margin: 4px 0 12px; opacity: 0; animation: hIn 1s var(--ease) .7s forwards; }
.stat { text-align: center; }
.stat-num { font-size: 18px; font-weight: 700; color: var(--emerald-600); }
.stat-lbl { font-size: 11px; color: var(--text-3); font-weight: 500; }

/* ── Suggestion Cards ── */
.sugs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 0 28px; }
.sug {
  background: var(--bg-el);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 18px;
  cursor: pointer;
  transition: all .35s var(--ease);
  text-align: start;
  position: relative;
  overflow: hidden;
}
.sug::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary-glow), transparent); opacity: 0; transition: opacity .35s; }
.sug:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--emerald-400); }
.sug:hover::after { opacity: 1; }
.sug:hover .sug-arr { opacity: 1; transform: translateX(0); }
.sug-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; position: relative; z-index: 1; }
.sug-ic { width: 38px; height: 38px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 17px; border: 1px solid var(--border-1); }
.sug-ic.g { background: var(--emerald-50); color: var(--emerald-600); }
.sug-ic.a { background: var(--gold-50); color: var(--gold-600); }
[data-theme="dark"] .sug-ic.g { background: rgba(5,150,105,0.1); }
[data-theme="dark"] .sug-ic.a { background: rgba(245,158,11,0.1); }
.sug-arr { color: var(--text-3); font-size: 15px; opacity: 0; transform: translateX(-6px); transition: all .3s var(--ease); }
.sug-t { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; position: relative; z-index: 1; }
.sug-d { font-size: 12.5px; color: var(--text-3); line-height: 1.5; position: relative; z-index: 1; }

/* ── Chat Messages ── */
.chat { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-bottom: 14px; }
.msg { display: flex; gap: 10px; max-width: 88%; animation: mIn .5s var(--spring); }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
[dir="rtl"] .msg.user { flex-direction: row; }
.msg-av { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.msg.user .msg-av { background: linear-gradient(135deg, var(--emerald-600), var(--emerald-700)); color: white; box-shadow: 0 2px 8px rgba(5,150,105,0.25); }
.msg.assistant .msg-av { background: var(--gold-50); color: var(--gold-600); border: 1px solid var(--border-1); }
[data-theme="dark"] .msg.assistant .msg-av { background: rgba(245,158,11,0.1); }
.msg-body { padding: 14px 18px; border-radius: var(--r-md); font-size: 14px; line-height: 1.8; }
.msg.user .msg-body { background: linear-gradient(135deg, var(--emerald-600), var(--emerald-700)); color: white; border-bottom-right-radius: 4px; box-shadow: 0 2px 12px rgba(5,150,105,0.2); }
[dir="rtl"] .msg.user .msg-body { border-bottom-right-radius: var(--r-md); border-bottom-left-radius: 4px; }
.msg.assistant .msg-body { background: var(--bg-el); border: 1px solid var(--border-1); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
[dir="rtl"] .msg.assistant .msg-body { border-bottom-left-radius: var(--r-md); border-bottom-right-radius: 4px; }

/* ── Scholar Opinion Block ── */
.opinion { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--emerald-500); background: var(--emerald-50); border-radius: 0 8px 8px 0; font-size: 13px; }
[data-theme="dark"] .opinion { background: rgba(5,150,105,0.06); }
[dir="rtl"] .opinion { border-left: none; border-right: 3px solid var(--emerald-500); border-radius: 8px 0 0 8px; }
.opinion-scholar { font-weight: 600; color: var(--emerald-700); font-size: 12px; margin-bottom: 3px; display: flex; align-items: center; gap: 5px; }
.opinion-scholar i { font-size: 14px; }

/* ── Source Tags ── */
.src-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.src-t {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--emerald-50);
  color: var(--emerald-700);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all .25s var(--ease);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}
[data-theme="dark"] .src-t { background: rgba(5,150,105,0.1); }
.src-t:hover { background: var(--emerald-600); color: white; border-color: var(--emerald-600); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(5,150,105,0.3); }
.src-t i { font-size: 13px; }

/* ── Research Disclaimer Note ── */
.research-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--gold-50);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.6;
}
[data-theme="dark"] .research-note { background: rgba(245,158,11,0.05); }
.research-note i { color: var(--gold-500); font-size: 16px; margin-top: 1px; flex-shrink: 0; }

/* ── Typing Indicator ── */
.typ { display: flex; gap: 5px; padding: 6px 0; }
.typ span { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-500); animation: tBnc 1.4s infinite; }
.typ span:nth-child(2) { animation-delay: .15s; }
.typ span:nth-child(3) { animation-delay: .3s; }

/* ── Source Strip (below chat) ── */
.src-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border-1);
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.src-strip::-webkit-scrollbar { display: none; }
.src-strip-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.src-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-el);
  border: 1px solid var(--border-1);
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: all .25s;
  cursor: pointer;
  text-decoration: none;
}
.src-chip:hover { border-color: var(--emerald-500); color: var(--emerald-700); background: var(--emerald-50); transform: translateY(-1px); }
.src-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald-500); box-shadow: 0 0 6px rgba(16,185,129,0.4); }

/* ── Input Bar ── */
.inp-wrap { position: sticky; bottom: 0; padding: 12px 0 20px; background: linear-gradient(to top, var(--bg) 75%, transparent); }
.inp-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-el);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 5px 5px 5px 18px;
  box-shadow: var(--shadow-lg);
  transition: border-color .3s, box-shadow .3s;
}
.inp-bar:focus-within { border-color: var(--emerald-500); box-shadow: var(--shadow-lg), 0 0 0 3px var(--primary-glow); }
.inp-bar input { flex: 1; border: none; background: transparent; font-size: 14.5px; font-family: var(--font); color: var(--text-1); outline: none; padding: 10px 0; }
.inp-bar input::placeholder { color: var(--text-3); }
.send {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  border: none;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-700));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: all .25s var(--ease);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(5,150,105,0.3);
}
.send:hover { transform: scale(1.06); }
.send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.inp-note { text-align: center; font-size: 11px; color: var(--text-3); margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.inp-note i { font-size: 13px; }

/* ── Category Grid ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 24px; }
.cat {
  background: var(--bg-el);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 26px 18px 22px;
  text-align: center;
  cursor: pointer;
  transition: all .4s var(--ease);
  position: relative;
  overflow: hidden;
}
.cat::before { content: ''; position: absolute; inset: 0; background: linear-gradient(145deg, var(--emerald-600), var(--emerald-800)); opacity: 0; transition: opacity .4s; }
.cat:hover { transform: translateY(-5px); box-shadow: var(--shadow-xl); }
.cat:hover::before { opacity: 1; }
.cat:hover .cat-ic, .cat:hover .cat-nm, .cat:hover .cat-sub { position: relative; z-index: 1; color: white; }
.cat:hover .cat-ic { background: rgba(255,255,255,0.15) !important; color: white; border-color: rgba(255,255,255,0.2); }
.cat-ic { width: 48px; height: 48px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; transition: all .4s var(--ease); border: 1px solid var(--border-1); }
.c1 { background: var(--emerald-50); color: var(--emerald-700); }
.c2 { background: var(--gold-50); color: var(--gold-600); }
.c3 { background: #EEF2FF; color: #4F46E5; }
.c4 { background: #FEF2F2; color: #DC2626; }
.c5 { background: #F0F9FF; color: #0284C7; }
.c6 { background: #FFF7ED; color: #EA580C; }
.c7 { background: #FAF5FF; color: #9333EA; }
.c8 { background: #ECFEFF; color: #0891B2; }
.cat-nm { font-weight: 600; font-size: 14px; margin-bottom: 3px; transition: color .3s; }
.cat-sub { font-size: 11.5px; color: var(--text-3); transition: color .3s; }

/* ── Source Card Grid ── */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-top: 24px; }
.src-card { background: var(--bg-el); border: 1px solid var(--border-1); border-radius: var(--r-md); padding: 20px; display: flex; gap: 14px; transition: all .3s var(--ease); align-items: flex-start; }
.src-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--emerald-400); }
.src-favicon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--border-1); background: var(--bg-sunk); overflow: hidden; padding: 8px; }
.src-favicon img { width: 100%; height: 100%; object-fit: contain; }
.src-card h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.src-card p { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }
.src-lnk { display: inline-flex; align-items: center; gap: 4px; color: var(--emerald-600); font-size: 12px; font-weight: 600; text-decoration: none; margin-top: 6px; transition: gap .2s; }
.src-lnk:hover { gap: 8px; }
.src-lnk i { font-size: 13px; }

/* ── Trust Box ── */
.trust {
  background: linear-gradient(135deg, var(--emerald-50), var(--gold-50));
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
[data-theme="dark"] .trust { background: linear-gradient(135deg, rgba(5,150,105,0.06), rgba(245,158,11,0.04)); }
.trust-ic { width: 48px; height: 48px; border-radius: 13px; background: var(--bg-el); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--emerald-600); flex-shrink: 0; border: 1px solid var(--border-1); }
.trust h3 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.trust p { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ── Mission Banner ── */
.mission {
  background: linear-gradient(150deg, var(--emerald-700), var(--emerald-900));
  border-radius: var(--r-xl);
  padding: 44px 32px;
  color: white;
  text-align: center;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(6,78,59,0.3);
}
.mission::before { content: ''; position: absolute; top: -50%; right: -30%; width: 80%; height: 200%; background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 60%); }
.mission::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-400), transparent); opacity: 0.3; }
.mission h2 { font-size: clamp(20px, 3.5vw, 26px); font-weight: 700; margin-bottom: 12px; position: relative; }
.mission p { font-size: 14.5px; opacity: .85; line-height: 1.8; max-width: 540px; margin: 0 auto; position: relative; }

/* ── About / Feature Cards ── */
.audience-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 24px 0; }
.audience-card { background: var(--bg-el); border: 1px solid var(--border-1); border-radius: var(--r-md); padding: 24px 20px; text-align: center; transition: all .3s var(--ease); }
.audience-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.audience-card i { font-size: 28px; margin-bottom: 10px; display: block; }
.audience-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.audience-card p { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

.ab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 24px 0; }
.ab-card { background: var(--bg-el); border: 1px solid var(--border-1); border-radius: var(--r-md); padding: 22px 20px; transition: all .3s var(--ease); }
.ab-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ab-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: 14px; border: 1px solid var(--border-1); }
.a1 { background: var(--emerald-50); color: var(--emerald-700); }
.a2 { background: #EEF2FF; color: #4F46E5; }
.a3 { background: var(--gold-50); color: var(--gold-600); }
.a4 { background: #FEF2F2; color: #DC2626; }
.a5 { background: #F0F9FF; color: #0284C7; }
.ab-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.ab-card p { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ── Responsive: Components ── */
@media (max-width: 640px) {
  .hero { padding: 40px 8px 16px; }
  .sugs { grid-template-columns: 1fr; }
  .home { padding: 0 12px; }
  .mission { padding: 28px 18px; border-radius: var(--r-lg); }
  .ab-grid { grid-template-columns: 1fr; }
  .trust { flex-direction: column; text-align: center; }
  .msg { max-width: 94%; }
  .audience-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 16px; }
  .src-strip { gap: 6px; }
  .src-grid { grid-template-columns: 1fr; }
  .hero-h1 { font-size: 24px; }
  .hero-ar { font-size: 22px; }
  .hero-p { font-size: 14px; }
  .sug { padding: 14px; }
}
