/* assets/css/base.css */
/* Base styles for NetPix - Modern, clean aesthetic */

/* tokens.css is a genuine prerequisite, not an optional extra — every rule
   below depends on its variables. @import makes that a structural fact
   instead of a convention every page has to remember to follow correctly
   (which is exactly how admin pages and every auth page ended up loading
   this file without tokens.css, breaking fonts/colors entirely, 2026-08-27).
   tokens.css is pure :root values with zero rules, so the usual @import
   performance concern (blocking parallel downloads) is negligible here. */
@import url('/assets/css/tokens.css');

/* ── Poppins — self-hosted latin subset (no external CDN dependency) ──────── */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/assets/fonts/poppins/poppins-300.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/poppins/poppins-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/poppins/poppins-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/poppins/poppins-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/poppins/poppins-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inline SVG icons emitted by helpers/icons.php */
.npx-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Pointer cursor on all interactive elements globally */
a,
button,
[role="button"],
label[for] {
  cursor: pointer;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No overflow-x set here — any overflow value on html/body can act as
   a scroll container on older Android/Huawei WebViews, trapping
   position:sticky elements. Horizontal overflow is clipped on <main>
   below so the sticky <nav> (a sibling of <main>) is unaffected. */
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  /* No overflow-x — see html comment above. */
}

/* Clip horizontal overflow at the content level, not the root.
 <nav> is a sibling of <main> so sticky on <nav> is unaffected.
 -webkit-sticky + sticky combo in nav.css handles older WebViews. */
main {
  overflow-x: clip;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}

a:hover {
  color: var(--color-blue);
  text-decoration: underline;
}

/* Buttons - Matching screenshot style */
button,
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
}

[role="button"],
summary,
label[for] {
  cursor: pointer;
}

/*
  Defensive cursor rule for desktop browsers:
  ensures interactive controls keep the hand cursor even if later
  component styles accidentally override cursor.
*/
@media (hover: hover) and (pointer: fine) {

  a[href],
  button,
  [role="button"],
  input[type="button"],
  input[type="submit"],
  summary,
  label[for] {
    cursor: pointer !important;
  }

  /* Higher specificity than the rule above (element + pseudo-class beats
     element alone), so this wins the !important tie regardless of source
     order — a disabled button should never show the hand cursor. */
  button:disabled {
    cursor: not-allowed !important;
  }
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Neither rule existed before — a disabled .btn-primary/.btn-secondary
   rendered in full, undimmed color with a working hover effect, since
   nothing distinguished the disabled state visually (found 2026-09-17
   testing the gift modal's Send Gift button: functionally blocked by the
   `disabled` attribute, but looked fully active). */
.btn-primary:disabled {
  background: var(--color-border);
  color: var(--color-text-light);
  box-shadow: none;
}

.btn-primary:disabled:hover {
  background: var(--color-border);
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: white;
  color: var(--color-blue);
  border: 2px solid var(--color-blue);
}

.btn-secondary:hover {
  background: var(--color-blue-light);
}

.btn-secondary:disabled {
  color: var(--color-text-light);
  border-color: var(--color-border);
}

.btn-secondary:disabled:hover {
  background: white;
}

/* Forms */
input,
textarea,
select {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  padding: 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-blue);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* Card */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-xl);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Default custom select css - can be overridden by individual components   */
.npx-custom-select {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border, #E0E0E0);
  border-radius: var(--radius-md, 6px);
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
  /* Prevent iOS from zooming in on focus */
  font-size: max(0.9rem, 16px);
}

.npx-custom-select:focus {
  outline: none;
  border-color: var(--color-primary, #667eea);
}