/* ============================================================
   VERSE - الآية  |  Global Design System
   iOS Liquid Glass · Black/Grey Premium · Playfair Display
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  height: 100%;
  min-height: 100dvh;
  background: #000;
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Design Tokens ── */
:root {
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Colors */
  --bg: #000000;
  --bg-secondary: #0a0a0a;
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.30);

  /* Glass */
  --glass-bg: rgba(18, 18, 18, 0.60);
  --glass-bg-light: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-border-bright: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
  --glass-shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.7);
  --glass-blur: blur(24px) saturate(180%);
  --glass-blur-sm: blur(12px) saturate(150%);

  /* Accents */
  --accent-1: #7c3aed;   /* violet */
  --accent-2: #9333ea;   /* purple */
  --accent-3: #c2410c;   /* orange */
  --accent-4: #9f1239;   /* rose */
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #c2410c 100%);
  --accent-gradient-alt: linear-gradient(135deg, #9333ea 0%, #9f1239 100%);

  /* Spacing */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  --mini-player-h: 76px;
  --header-h: 64px;

  /* Radius */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-full: 9999px;

  /* Transition */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 500ms;
}

/* ── Animated Gradient Background ── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.75;
  will-change: transform;
}

.orb-1 {
  width: 70vw; height: 70vw;
  max-width: 520px; max-height: 520px;
  background: radial-gradient(circle, #6d28d9 0%, #4c1d95 60%, transparent 100%);
  top: -10%; left: -15%;
  animation: orbFloat1 12s ease-in-out infinite;
}

.orb-2 {
  width: 60vw; height: 60vw;
  max-width: 460px; max-height: 460px;
  background: radial-gradient(circle, #c2410c 0%, #7c2d12 60%, transparent 100%);
  bottom: -5%; right: -10%;
  animation: orbFloat2 15s ease-in-out infinite;
}

.orb-3 {
  width: 50vw; height: 50vw;
  max-width: 380px; max-height: 380px;
  background: radial-gradient(circle, #9f1239 0%, #4c0519 60%, transparent 100%);
  top: 40%; left: 40%;
  animation: orbFloat3 18s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10vw, 15vh) scale(1.1); }
  66% { transform: translate(-5vw, 8vh) scale(0.9); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-12vw, -10vh) scale(1.15); }
  70% { transform: translate(8vw, 5vh) scale(0.95); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8vw, -12vh) scale(1.2); }
}

/* ── Glass Utility Classes ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-light {
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
}

.glass-strong {
  background: rgba(8, 8, 8, 0.80);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--glass-border-bright);
  box-shadow: var(--glass-shadow-lg);
}

/* ── Typography ── */
.display-font { font-family: var(--font-display); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

.text-sm   { font-size: 0.75rem; }
.text-base { font-size: 0.9rem; }
.text-lg   { font-size: 1.1rem; }
.text-xl   { font-size: 1.4rem; }
.text-2xl  { font-size: 1.75rem; }
.text-3xl  { font-size: 2.25rem; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-spring),
              box-shadow var(--t-fast) var(--ease-smooth),
              background var(--t-fast) var(--ease-smooth);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.95); }

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border-radius: var(--r-full);
  padding: 14px 32px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.55);
  filter: brightness(1.08);
}

.btn-ghost {
  background: var(--glass-bg-light);
  color: var(--text-primary);
  border-radius: var(--r-full);
  padding: 10px 22px;
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.1rem;
  border: none;
  padding: 0;
}
.btn-icon:hover { background: var(--glass-bg-light); }

/* ── Navigation Bar ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: stretch;
}

.nav-inner {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-around;
  padding: 0 16px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
}

.nav-item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-item:hover { color: var(--text-primary); }
.nav-item.active { color: var(--text-primary); }
.nav-item.active svg { stroke: #fff; }

/* ── App Layout ── */
.app-root {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 0; }
* { scrollbar-width: none; }

/* ── Loading Spinner ── */
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(30,30,30,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 9999;
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.toast.success { border-color: rgba(34, 197, 94, 0.4); color: #86efac; }

/* ── No select on key elements ── */
.no-select { user-select: none; -webkit-user-select: none; }
