/* ============================================================
   PixelVerse design system — extracted from index.html
   Link this on every BrandLoop app page so the UI matches the
   intro page by construction.

   Required in <head>:
   <link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap" rel="stylesheet">
   Required on <html>:  lang="ar" dir="rtl"
   ============================================================ */

:root {
  /* Brand */
  --core-purple:   #7e57d3;
  --core-blue:     #3a84d9;
  --core-orange:   #f9843e;
  --gold-highlight:#f8bb7c;

  /* Text */
  --text-dark: #2d2d2d;
  --text-gray: #666666;

  /* Background pastels */
  --bg-top-left:     #ece7fb;
  --bg-bottom-left:  #cbedf9;
  --bg-top-right:    #fddfc3;
  --bg-bottom-right: #fde7d9;
  --bg-base-1:       #f8f6fc;
  --bg-base-2:       #f5f9fd;

  /* Gradient border (card frame) */
  --border-left:   #B9A4FF;
  --border-right:  #FFC48E;
  --border-bottom: #A7D4FF;

  /* Cube accents (signature motif) */
  --cube-orange:     #f99449;
  --cube-purple:     #8267e5;
  --cube-blue:       #549fea;
  --cube-light-blue: #95d3f6;

  /* Tokens */
  --radius-card:  24px;
  --radius-btn:   14px;
  --radius-input: 14px;
  --shadow-card:    0 10px 40px rgba(130,103,229,.08), 0 4px 20px rgba(84,159,234,.06);
  --shadow-primary: 0 8px 30px rgba(126,87,211,.3);
  --font: 'Tajawal', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

body {
  font-family: var(--font);
  direction: rtl;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 0% 0%,   var(--bg-top-left) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, var(--bg-top-right) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, var(--bg-bottom-left) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, var(--bg-bottom-right) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-base-1) 0%, var(--bg-base-2) 100%);
  background-attachment: fixed;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section    { padding: 80px 0; }

/* Typography */
h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.3; color: var(--text-dark); }
.section-title { font-size: 2rem;   font-weight: 700; text-align: center; margin-bottom: 16px; color: var(--text-dark); }
.card-title    { font-size: 1.8rem; font-weight: 700; color: var(--text-dark); }
p { color: var(--text-gray); line-height: 1.7; }

/* Gradient accent text — use sparingly, like the hero highlight */
.gradient-text {
  background: linear-gradient(135deg, var(--core-purple) 0%, var(--core-blue) 50%, var(--core-orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Card — white surface, gradient frame, soft shadow */
.card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-card);
  padding: 40px;
  box-shadow: var(--shadow-card);
}
.card::before {
  content: ''; position: absolute; inset: -3px; border-radius: 27px; z-index: -1; opacity: .9;
  background: linear-gradient(135deg, var(--border-left) 0%, var(--border-bottom) 50%, var(--border-right) 100%);
}
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius-card); background: #fff; z-index: -1;
}
.card-glow {
  position: absolute; inset: -20px; border-radius: 40px; filter: blur(20px); z-index: -2;
  background: linear-gradient(135deg, rgba(185,164,255,.15) 0%, rgba(167,212,255,.1) 50%, rgba(255,196,142,.15) 100%);
}

/* Buttons */
.btn {
  padding: 16px 32px; border-radius: var(--radius-btn); font-family: var(--font);
  font-size: 1.1rem; font-weight: 700; cursor: pointer; text-decoration: none; border: none;
  display: inline-flex; align-items: center; gap: 10px; transition: all .3s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--core-purple) 0%, var(--core-blue) 100%);
  color: #fff; box-shadow: var(--shadow-primary);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(126,87,211,.4); }
.btn-outline { background: transparent; color: var(--core-purple); border: 2px solid var(--core-purple); }
.btn-outline:hover { background: var(--core-purple); color: #fff; transform: translateY(-3px); }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; box-shadow: 0 8px 24px rgba(192,57,43,.3); }
.btn-danger:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(192,57,43,.4); }
.btn-danger-outline { background: transparent; color: #c0392b; border: 2px solid #e6b0aa; }
.btn-danger-outline:hover { background: #c0392b; color: #fff; border-color: #c0392b; transform: translateY(-3px); }

/* Form controls — app extension, kept in the same visual language */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field label { font-weight: 700; color: var(--text-dark); font-size: 1rem; }
.input, .textarea, .select {
  font-family: var(--font); font-size: 1.05rem; color: var(--text-dark);
  padding: 14px 16px; border-radius: var(--radius-input);
  border: 2px solid #e7e2f5; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--core-purple); box-shadow: 0 0 0 4px rgba(126,87,211,.12);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }

/* Score chips — for the Critic's per-dimension results */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.chip-pass    { background: rgba(58,132,217,.12); color: var(--core-blue); }
.chip-fail    { background: rgba(249,132,62,.14); color: #c75a16; }
.chip-neutral { background: rgba(126,87,211,.10); color: var(--core-purple); }

/* Hover-lift utility (matches gallery/card behaviour) */
.lift { transition: transform .3s ease, box-shadow .3s ease; }
.lift:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(126,87,211,.18); }

/* ============================================================
   PixelVerse v2 layer — aurora, 3D cubes, credit + status pills.
   Purely additive; existing pages inherit it via this one file.
   ============================================================ */

/* --- Aurora background (injected once by app.js:initAurora) --------------- */
.pv-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.pv-aurora .blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; will-change: transform;
  background: radial-gradient(circle, var(--c) 0%, transparent 65%);
  animation: pvAurora var(--dur, 24s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes pvAurora {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(var(--ax), var(--ay)) scale(1.18); }
  66%      { transform: translate(var(--bx), var(--by)) scale(.9); }
}

/* --- Signature 3D cube (pure CSS; built by app.js:pvCube) ----------------- */
.pv-cube-scene { perspective: 220px; display: inline-flex; }
.pv-cube {
  position: relative; transform-style: preserve-3d;
  transform: rotateX(-24deg) rotateY(32deg);
}
.pv-cube.spin  { animation: pvSpin  2.6s linear infinite; }
.pv-cube.float { animation: pvFloat 4s ease-in-out infinite; }
.pv-cube .face { position: absolute; inset: 0; border-radius: 3px; }
@keyframes pvSpin  { from { transform: rotateX(-24deg) rotateY(0); } to { transform: rotateX(-24deg) rotateY(360deg); } }
@keyframes pvFloat { 0%,100% { transform: rotateX(-24deg) rotateY(32deg) translateY(0); }
                     50%     { transform: rotateX(-24deg) rotateY(32deg) translateY(-6px); } }

/* --- Credits pill (cube + Arabic-Indic number + رصيد) --------------------- */
.credit-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.72); border: 1px solid rgba(126,87,211,.18);
  border-radius: 999px; padding: 6px 14px 6px 8px; font-weight: 800; color: #6a4bb0;
}
.credit-pill .credit-num { font-size: 1rem; line-height: 1; }
.credit-pill .credit-word { font-size: .82rem; font-weight: 700; color: #8a86a0; }
.credit-pill.low { background: #fdecea; border-color: #f3c4bd; color: #c0392b; }
/* Closed launch: a trial balance reads differently from a paid-for one. */
.credit-pill.trial { background: rgba(255,183,122,.16); border-color: rgba(224,120,48,.32); color: #b4651f; }
.credit-pill.trial .credit-word { color: #c07a3a; }
.credit-pill.trial.low { background: #fdecea; border-color: #f3c4bd; color: #c0392b; }

/* --- Status pill (توليد → نقد → إصلاح → جاهزة) ---------------------------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: .9rem; padding: 5px 14px; border-radius: 999px;
  background: rgba(126,87,211,.10); color: var(--core-purple);
  border: 1px solid rgba(126,87,211,.22);
}
.status-pill .status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.running .status-dot { animation: pvDotPulse 1s ease-in-out infinite; }
.status-pill.done { background: rgba(58,160,106,.12); color: #3aa06a; border-color: rgba(58,160,106,.25); }
.status-pill.fail { background: rgba(249,132,62,.14); color: #c75a16; border-color: rgba(249,132,62,.3); }
@keyframes pvDotPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* --- Primary button spark glyph (opt-in via .btn-spark) ------------------- */
.btn-primary.btn-spark::before { content: "\2726"; font-size: .95em; margin-inline-end: 2px; }

/* --- Gradient-active chips/presets (match mockup) ------------------------- */
.preset-chip.active, .mode-btn.active {
  background: linear-gradient(135deg, var(--core-purple), var(--core-blue));
  border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(126,87,211,.3);
}

@media (prefers-reduced-motion: reduce) {
  .pv-aurora .blob, .pv-cube.spin, .pv-cube.float, .status-pill.running .status-dot { animation: none !important; }
}
