/* ═══════════════════════════════════════════════════════
   TRADINGO — MASTER DESIGN SYSTEM
   Single source of truth for all colors, typography, spacing
   Loaded by every page alongside glass.css and components.css
   ═══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
  /* Brand Colors — SINGLE SOURCE OF TRUTH */
  --primary: #10B981;         /* Emerald — primary actions */
  --secondary: #059669;       /* Deeper emerald — hover states */
  --accent: #C9A84C;          /* Gold — premium highlights */
  --accent-bright: #EDC33B;   /* Bright gold — badges, CTA */
  --alert: #B71C1C;           /* Deep red — danger */
  --dark-green: #0a3d0c;      /* Dark forest — footer bg */
  --success: #10B981;
  --cta: #eab308;             /* Yellow-gold — call to action */
  --light: #f1f5f9;

  /* Neutral Palette (Dark Premium) */
  --bg-body: #030712;
  --bg-dark: #0f172a;
  --surface: rgba(15, 23, 30, 0.7);
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-light: rgba(255,255,255,0.12);
  --border-dark: rgba(255,255,255,0.2);

  /* Typography */
  --font-primary: 'Poppins', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Poppins', 'Inter', system-ui, sans-serif;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.18);

  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET & BASE ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── BRAND COLOR UTILITIES ── */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }
.text-alert { color: var(--alert) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-accent { background-color: var(--accent) !important; }

/* ── BUTTONS ── */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--secondary);
  border-color: var(--secondary);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  color: white;
}
.btn-accent {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transition: var(--transition-base);
}
.btn-accent:hover {
  background-color: #b8963f;
  color: #fff;
  box-shadow: 0 0 20px rgba(201,168,76,0.3);
  transform: translateY(-2px);
}
.btn-outline-accent {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-accent:hover {
  background-color: var(--accent);
  color: #fff;
}

/* Hover lift utility */
.hover-lift { transition: var(--transition-base); }
.hover-lift:hover { transform: translateY(-3px); }

/* ── GENERIC COMPONENTS ── */
.nm-section-title { font-weight: 700; }
.nm-category-card, .nm-trust-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  transition: var(--transition-base);
  height: 100%;
}
.nm-category-card:hover, .nm-trust-card:hover {
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15);
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.4);
}
.nm-supplier-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 1rem;
  height: 100%;
}

/* ── NAVBAR ── */
.navbar {
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(20px);
}
.navbar-brand {
  font-weight: 800;
  color: var(--primary) !important;
}
.navbar-toggler {
  border: none !important;
  padding: 0.5rem !important;
}
.navbar-nav .nav-link {
  padding: 0.75rem 1rem !important;
}

@media (max-width: 991px) {
  .navbar-nav { margin-top: 1rem; }
  .navbar-nav .nav-link { padding: 0.75rem 1.5rem; }
}

/* ── HERO SECTION (Generic) ── */
.hero {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  padding: 100px 0;
}
.hero h1 { font-size: 3rem; font-weight: 800; }
.hero .btn-cta {
  background: var(--cta);
  color: white;
  padding: 15px 40px;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
}

/* ── CARDS ── */
.card {
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
  text-align: center;
  padding: 20px;
  background: var(--surface);
  color: #ffffff;
}
.card:hover { transform: translateY(-5px); }

/* ── VERIFIED BADGE ── */
.verified {
  background: var(--success);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── PRICE SLAB ── */
.price-slab {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 10px 0;
  color: #e2e8f0;
}
.price-best {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.2);
}

/* ── FOOTER (Dark Green Theme) ── */
footer {
  background-color: var(--dark-green);
  color: #a5d6a7;
}
footer a { color: #a5d6a7; text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: none; }
footer h5, footer h6 { color: #ffffff; }
footer .text-muted { color: #81c784 !important; }
footer hr { border-color: rgba(255,255,255,0.1); }

/* ── DASHBOARD KPI ── */
.dashboard-kpi {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

/* ── PRICING CARDS ── */
.pricing-toggle {
  background: var(--dark-green);
  color: #e8f5e9;
  border-radius: var(--radius-pill);
  padding: 6px;
  display: inline-flex;
  gap: 4px;
}
.pricing-toggle button {
  border: none;
  background: transparent;
  color: #a5d6a7;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
}
.pricing-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.plan-hero {
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 18px 45px rgba(27,94,32,0.35);
  position: relative;
  overflow: hidden;
}
.plan-hero-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0,0,0,0.7);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}
.plan-card {
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  height: 100%;
  box-shadow: var(--shadow-md);
  color: #e2e8f0;
}
.plan-card.standard { border-top: 4px solid var(--secondary); }
.plan-card.premium {
  border-top: 4px solid var(--accent);
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark-green) 60%);
  color: #e8f5e9;
}
.plan-card .badge { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; }
.plan-price { font-size: 2.5rem; font-weight: 800; }
.plan-price small { font-size: 0.9rem; font-weight: 500; }
.plan-features { list-style: none; padding-left: 0; margin-bottom: 1rem; }
.plan-features li { font-size: 0.9rem; margin-bottom: 0.35rem; }
.plan-features li i { color: var(--secondary); margin-right: 6px; }
.plan-card.premium .plan-features li i { color: var(--accent); }
.plan-note { font-size: 0.75rem; color: #6b7280; }
.plan-card.premium .plan-note { color: #a5d6a7; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .display-4 { font-size: 1.9rem; }
  .btn-lg { width: 100%; }
  .nm-category-card,
  .nm-supplier-card { padding: 1rem; }
  .plan-price { font-size: 2rem; }
}

/* ── SECTION UTILITIES ── */
.section-title {
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.section-subtitle {
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── WORD-BREAK & OVERFLOW PROTECTION ── */
h1, h2, h3, h4, h5, h6, p, span, a, li, td, th {
  word-break: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
}

/* Long text in cards */
.card-body, .plan-card, .pillar-card, .buyer-card, .why-card {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── SMOOTH SCROLL ── */
html {
  scroll-behavior: smooth;
}

/* ── ACCESSIBILITY ── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── IMAGE LAZY LOADING FADE ── */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"][src] {
  opacity: 1;
}
