/* ============================================
   NOVA STORE — Unified Design System
   Typography | Colors | Spacing | Responsive
   ============================================ */

/* ---------- Root Design Tokens ---------- */
:root {
  /* Softened palette (less neon) */
  --bg0: #0a0e1a;
  --bg1: #12182b;
  --bg2: #1a2035;
  --ink: rgba(255, 255, 255, 0.92);
  --ink-secondary: rgba(255, 255, 255, 0.68);
  --ink-tertiary: rgba(255, 255, 255, 0.45);
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* Primary — calmed cyan */
  --primary: #5ecde0;
  --primary-soft: rgba(94, 205, 224, 0.12);
  --primary-glow: rgba(94, 205, 224, 0.25);

  /* Accent violet — muted */
  --violet: #7b6bc7;
  --violet-soft: rgba(123, 107, 199, 0.12);

  /* Accent pink — muted */
  --pink: #c97ab8;
  --pink-soft: rgba(201, 122, 184, 0.10);

  /* Functional */
  --success: #4caf7d;
  --warning: #e8a838;
  --danger: #e07070;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows — softer, no harsh glow */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.30);
  --shadow-lg: 0 14px 48px rgba(0,0,0,0.35);

  /* Typography scale */
  --fs-xs: 0.75rem;   /* 12px */
  --fs-sm: 0.8125rem; /* 13px */
  --fs-base: 0.9375rem; /* 15px */
  --fs-md: 1.0625rem; /* 17px */
  --fs-lg: 1.25rem;   /* 20px */
  --fs-xl: 1.5rem;    /* 24px */
  --fs-2xl: 1.875rem; /* 30px */
  --fs-3xl: 2.25rem;  /* 36px */
  --fs-hero: clamp(2rem, 5vw + 1rem, 3.5rem);

  /* Line heights */
  --lh-tight: 1.3;
  --lh-base: 1.6;
  --lh-relaxed: 1.75;

  /* Letter spacing */
  --ls-tight: -0.01em;
  --ls-base: 0;
  --ls-wide: 0.02em;
}

/* ---------- Typography System ---------- */
body {
  font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); font-weight: 600; }

/* Body text */
p {
  margin: 0 0 1em;
  line-height: var(--lh-relaxed);
  color: var(--ink-secondary);
}
p:last-child { margin-bottom: 0; }

/* Labels / captions */
.label, .caption, .muted {
  font-size: var(--fs-sm);
  color: var(--ink-tertiary);
  line-height: var(--lh-base);
}

/* Buttons */
.btn, button, [type="submit"] {
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  line-height: 1.4;
}

/* Inputs */
input, textarea, select {
  font-family: inherit;
  font-size: var(--fs-base);
  line-height: var(--lh-base);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: #8ee5f5; }

/* Code / mono */
code, kbd, pre {
  font-family: "IBM Plex Mono", "SF Mono", Monaco, "Courier New", monospace;
  font-size: 0.9em;
}

/* ---------- Background System (softer) ---------- */
.nova-bg {
  background:
    radial-gradient(1200px 600px at 10% -5%, rgba(123, 107, 199, 0.10), transparent 60%),
    radial-gradient(900px 480px at 95% 5%, rgba(94, 205, 224, 0.08), transparent 55%),
    linear-gradient(170deg, var(--bg0), var(--bg1));
  min-height: 100vh;
  min-height: 100dvh;
}

/* Reduced motion blob (static, no animation) */
.nova-blob::before,
.nova-blob::after {
  content: "";
  position: fixed;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
}
.nova-blob::before {
  background: var(--violet);
  top: -10vw;
  left: -8vw;
}
.nova-blob::after {
  background: var(--primary);
  bottom: -10vw;
  right: -8vw;
}

/* ---------- Card System ---------- */
.nova-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.nova-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ---------- Button System ---------- */
.nova-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nova-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.nova-btn-primary {
  background: linear-gradient(135deg, rgba(94,205,224,0.18), rgba(123,107,199,0.18));
  border-color: rgba(94,205,224,0.35);
  color: #fff;
}
.nova-btn-primary:hover {
  background: linear-gradient(135deg, rgba(94,205,224,0.28), rgba(123,107,199,0.28));
  box-shadow: 0 8px 24px rgba(94,205,224,0.12);
}

/* ---------- Form System ---------- */
.nova-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  color: var(--ink);
  font-size: var(--fs-base);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nova-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---------- Utility Spacing ---------- */
.nova-stack-xs > * + * { margin-top: 4px; }
.nova-stack-sm > * + * { margin-top: 8px; }
.nova-stack-md > * + * { margin-top: 16px; }
.nova-stack-lg > * + * { margin-top: 24px; }
.nova-stack-xl > * + * { margin-top: 32px; }

/* ---------- Responsive Grid ---------- */
.nova-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.20); }

/* ---------- Selection ---------- */
::selection {
  background: var(--primary-soft);
  color: #fff;
}

/* ---------- Brand Logo (circular orb) ---------- */
img[src*="branding/nova-logo"] {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(94, 205, 224, 0.45);
  background: linear-gradient(145deg, rgba(94,205,224,.18), rgba(123,107,199,.22));
  box-shadow:
    0 4px 14px rgba(0,0,0,.25),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 20px rgba(94,205,224,.12);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
img[src*="branding/nova-logo"]:hover {
  transform: scale(1.05);
  border-color: rgba(94, 205, 224, 0.75);
  box-shadow:
    0 6px 24px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 28px rgba(94,205,224,.22);
}

/* ---------- Responsive Typography ---------- */
@media (max-width: 640px) {
  :root {
    --fs-base: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
  }
  .nova-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .nova-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Global responsive helpers (store + panels) ---------- */
html, body {
  overflow-x: clip;
}
@supports not (overflow-x: clip) {
  html, body { overflow-x: hidden; }
}

.container-fluid,
.page-wrap,
.store-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 768px) {
  .top-bar,
  .admPageHead,
  .admActionRow {
    flex-direction: column;
    align-items: stretch;
  }
  .top-bar-actions,
  .admPageActions {
    width: 100%;
    justify-content: flex-start;
  }
}
