/* ============================================================
   ZIKR AI — Design System
   Theme: White + Sage Green | Premium Islamic AI Chat
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:       #1a7a4a;
  --primary-light: #22a35f;
  --primary-dark:  #145c38;
  --primary-glow:  rgba(26,122,74,.15);
  --accent:        #d4a843;
  --accent-light:  #f0c96a;

  /* Surfaces */
  --bg:            #f5f7f5;
  --surface:       #ffffff;
  --surface2:      #f0f4f1;
  --surface3:      #e8f0ea;
  --sidebar-bg:    #fafcfa;

  /* Text */
  --text:          #1a2e1f;
  --text-2:        #3d5445;
  --text-muted:    #7a9485;
  --text-inv:      #ffffff;

  /* Borders */
  --border:        #cfe0d4;
  --border-light:  #e4ede6;

  /* Chat bubbles */
  --user-bubble:   linear-gradient(135deg, #1a7a4a, #22a35f);
  --ai-bubble:     #ffffff;

  /* Shadows */
  --shadow-sm:     0 1px 4px rgba(26,122,74,.08);
  --shadow-md:     0 4px 20px rgba(26,122,74,.12);
  --shadow-lg:     0 12px 40px rgba(26,122,74,.16);

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Sidebar */
  --sidebar-w: 300px;
  --header-h:  64px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ── Logo / Icon ─────────────────────────────────────────────── */
.zikr-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.zikr-logo svg.arch-icon {
  width: 38px; height: 38px;
}
.zikr-logo .brand-name {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.3px;
}
.zikr-logo .brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  display: block;
  margin-top: -4px;
}

/* ── Button ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(26,122,74,.3);
}
.btn-primary:active { transform: scale(.97); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); background: var(--primary-glow); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface3); color: var(--text); }

.btn-icon {
  padding: 8px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--surface3); color: var(--text); }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-green { background: var(--primary-glow); color: var(--primary); }
.badge-gold  { background: rgba(212,168,67,.12); color: var(--accent); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 13px;
}
.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border-light);
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity:0 } to { opacity:1 } }
@keyframes fadeUp    { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:translateY(0) } }
@keyframes scaleIn   { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }
@keyframes blink     { 50% { opacity:0 } }
@keyframes spin      { to { transform:rotate(360deg) } }
@keyframes pulse     { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
@keyframes shimmer   {
  0%   { background-position: -200% 0 }
  100% { background-position:  200% 0 }
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 0 var(--primary-glow) }
  50%     { box-shadow: 0 0 0 8px transparent }
}

.animate-fadeIn  { animation: fadeIn  .3s ease }
.animate-fadeUp  { animation: fadeUp  .35s ease }
.animate-scaleIn { animation: scaleIn .25s ease }

/* ── Typing Cursor ───────────────────────────────────────────── */
.typing-cursor::after {
  content: '▋';
  color: var(--primary);
  animation: blink .7s step-end infinite;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: fadeUp .3s ease;
  display: flex; align-items: center; gap: 8px;
  max-width: 320px;
}
.toast.success { background: var(--primary); }
.toast.error   { background: #c0392b; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: min(480px, 94vw);
  animation: scaleIn .25s ease;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--surface3); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s;
}
.modal-close:hover { background: var(--border); }

/* ── Input ───────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-field::placeholder { color: var(--text-muted); }

/* ── Sidebar toggle for mobile ───────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }
}
