/*
Theme Name: GainWave
Theme URI: https://gainwave.local
Author: Volkan
Description: Lavender Light trading dashboard theme met invite-only registratie en Node.js engine koppeling.
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: gainwave
*/

/* ---------- Tokens ---------- */
:root {
  --gw-white: #ffffff;
  --gw-canvas: #f9fafb;
  --gw-border: #eaeaea;
  --gw-ink: #17151f;
  --gw-ink-soft: #6b6580;
  --gw-lav-100: #f3e8ff;
  --gw-lav-300: #e0aaff;
  --gw-lav-500: #c77dff;
  --gw-lav-700: #9d4edd;
  --gw-mint: #10b981;
  --gw-red: #ef4444;
  --gw-grad: linear-gradient(135deg, #e0aaff 0%, #c77dff 50%, #9d4edd 100%);
  --gw-shadow: 0 12px 40px rgba(157, 78, 221, 0.03);
  --gw-shadow-hover: 0 16px 48px rgba(157, 78, 221, 0.10);
  --gw-radius: 16px;
  --gw-font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --gw-font-pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--gw-canvas);
  color: var(--gw-ink);
  font-family: var(--gw-font-body);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gw-lav-700); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--gw-lav-700);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

.gw-wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.gw-header {
  background: var(--gw-white);
  border-bottom: 1px solid var(--gw-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.gw-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.gw-logo {
  font-family: var(--gw-font-pixel);
  font-size: 15px;
  color: var(--gw-ink);
  letter-spacing: 0;
}
.gw-logo:hover { text-decoration: none; }
.gw-logo .accent { color: var(--gw-lav-700); }
.gw-nav { display: flex; align-items: center; gap: 18px; }
.gw-nav a { color: var(--gw-ink-soft); font-weight: 500; font-size: 14px; }
.gw-nav a:hover { color: var(--gw-ink); text-decoration: none; }

/* ---------- Buttons ---------- */
.gw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  border: 1px solid var(--gw-lav-500);
  background: var(--gw-lav-100);
  color: var(--gw-lav-700);
  font-family: var(--gw-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  min-height: 42px;
}
.gw-btn:hover:not(:disabled) {
  background: var(--gw-grad);
  border-color: transparent;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--gw-shadow-hover);
}
.gw-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.gw-btn-outline { background: transparent; }
.gw-btn-solid { background: var(--gw-grad); border-color: transparent; color: #fff; }
.gw-btn-solid:hover:not(:disabled) { filter: brightness(1.05); }
.gw-btn-danger { border-color: var(--gw-red); color: var(--gw-red); background: #fef2f2; }
.gw-btn-danger:hover:not(:disabled) { background: var(--gw-red); color: #fff; box-shadow: 0 12px 32px rgba(239,68,68,0.15); }

.gw-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(157,78,221,0.25);
  border-top-color: var(--gw-lav-700);
  border-radius: 50%;
  display: inline-block;
  animation: gw-spin 0.7s linear infinite;
}
@keyframes gw-spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.gw-card {
  background: var(--gw-white);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius);
  box-shadow: var(--gw-shadow);
  padding: 24px;
}
.gw-card h2, .gw-card h3 { margin-top: 0; }
.gw-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gw-ink-soft);
  margin: 0 0 14px;
}

/* ---------- Landing ---------- */
.gw-hero {
  background: var(--gw-white);
  border-bottom: 1px solid var(--gw-border);
  overflow: hidden;
  position: relative;
}
.gw-hero-wave {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 90% at 15% 0%, rgba(224,170,255,0.45), transparent 60%),
    radial-gradient(50% 80% at 85% 10%, rgba(255,182,193,0.30), transparent 60%),
    radial-gradient(70% 100% at 50% -20%, rgba(157,78,221,0.20), transparent 70%);
  pointer-events: none;
}
.gw-hero-inner {
  position: relative;
  padding: 96px 0 72px;
  text-align: center;
}
.gw-hero .gw-brand {
  font-family: var(--gw-font-pixel);
  font-size: clamp(26px, 5vw, 44px);
  margin: 0 0 20px;
  line-height: 1.4;
}
.gw-hero p.lede {
  max-width: 560px;
  margin: 0 auto 32px;
  color: var(--gw-ink-soft);
  font-size: 17px;
}
.gw-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.gw-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: -36px auto 0;
  position: relative;
  z-index: 2;
}
.gw-stat { text-align: center; padding: 22px 16px; }
.gw-stat .num {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gw-stat .lbl { color: var(--gw-ink-soft); font-size: 13px; margin-top: 4px; }

.gw-section { padding: 72px 0; }
.gw-section h2.gw-h {
  text-align: center;
  font-size: 26px;
  margin: 0 0 8px;
}
.gw-section p.gw-sub {
  text-align: center;
  color: var(--gw-ink-soft);
  margin: 0 0 40px;
}
.gw-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.gw-feature { text-align: center; padding: 30px 20px; transition: all 0.3s ease-in-out; }
.gw-feature:hover { box-shadow: var(--gw-shadow-hover); transform: translateY(-2px); }
.gw-feature .ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--gw-lav-100);
  color: var(--gw-lav-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.gw-feature h3 { font-size: 15px; margin: 0 0 6px; }
.gw-feature p { font-size: 13px; color: var(--gw-ink-soft); margin: 0; }

/* ---------- Dashboard ---------- */
.gw-dash { padding: 36px 0 72px; }
.gw-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.gw-dash-head h1 { font-size: 22px; margin: 0; }
.gw-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--gw-border);
  background: var(--gw-white);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gw-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.gw-badge.running .dot { background: var(--gw-mint); }
.gw-badge.running { color: var(--gw-mint); }
.gw-badge.paused .dot { background: #f59e0b; }
.gw-badge.paused { color: #b45309; }
.gw-badge.stopped .dot { background: var(--gw-red); }
.gw-badge.stopped { color: var(--gw-red); }

.gw-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.gw-col-4 { grid-column: span 4; }
.gw-col-8 { grid-column: span 8; }
.gw-col-12 { grid-column: span 12; }
@media (max-width: 860px) {
  .gw-col-4, .gw-col-8 { grid-column: span 12; }
}

.gw-metric .num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gw-metric .sub { color: var(--gw-ink-soft); font-size: 13px; }
.gw-mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12px; word-break: break-all; }

.gw-controls { display: flex; gap: 10px; flex-wrap: wrap; }

.gw-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--gw-border);
  border-radius: 12px;
  overflow: hidden;
}
.gw-mode-toggle button {
  border: 0;
  background: var(--gw-white);
  padding: 10px 18px;
  font-family: var(--gw-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--gw-ink-soft);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}
.gw-mode-toggle button.active { background: var(--gw-grad); color: #fff; }
.gw-mode-toggle button:disabled { opacity: 0.55; cursor: not-allowed; }

/* Formulieren */
.gw-field { margin-bottom: 14px; }
.gw-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gw-ink);
}
.gw-field input, .gw-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--gw-border);
  border-radius: 12px;
  background: var(--gw-white);
  font-family: var(--gw-font-body);
  font-size: 14px;
  color: var(--gw-ink);
  transition: all 0.3s ease-in-out;
}
.gw-field input:focus { border-color: var(--gw-lav-500); outline: none; box-shadow: 0 0 0 3px rgba(199,125,255,0.15); }
.gw-field .hint { font-size: 12px; color: var(--gw-ink-soft); margin-top: 4px; }

/* Tabellen */
.gw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gw-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gw-ink-soft);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gw-border);
}
.gw-table td {
  padding: 12px;
  border-bottom: 1px solid var(--gw-canvas);
  font-variant-numeric: tabular-nums;
}
.gw-table tr:last-child td { border-bottom: 0; }
.gw-pos { color: var(--gw-mint); font-weight: 600; }
.gw-neg { color: var(--gw-red); font-weight: 600; }
.gw-empty { color: var(--gw-ink-soft); text-align: center; padding: 28px 12px; font-size: 13px; }

/* Auth kaart (login / register) */
.gw-auth {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.gw-auth .gw-card { width: 100%; max-width: 420px; padding: 36px; }
.gw-auth .gw-logo { display: block; text-align: center; margin-bottom: 26px; font-size: 17px; }
.gw-notice {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid var(--gw-border);
}
.gw-notice.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.gw-notice.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.gw-notice.info { background: var(--gw-lav-100); border-color: var(--gw-lav-300); color: #5b21b6; }

/* Footer */
.gw-footer {
  border-top: 1px solid var(--gw-border);
  background: var(--gw-white);
  padding: 28px 0;
  color: var(--gw-ink-soft);
  font-size: 13px;
}
.gw-footer .gw-wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Generieke content fallback (index.php) */
.gw-content { padding: 48px 0; }
.gw-content article { margin-bottom: 32px; }

/* ---------- v2: logo ratio fix ---------- */
.gw-logo { line-height: 1; display: inline-flex; align-items: center; padding-top: 3px; }
.gw-hero .gw-brand { line-height: 1.25; }
.gw-hint-kbd { font-size: 11px; color: var(--gw-ink-soft); border: 1px solid var(--gw-border); border-radius: 8px; padding: 5px 10px; background: var(--gw-white); }

/* ---------- v2: widgets & drag ---------- */
.gw-widget { transition: box-shadow 0.3s ease-in-out, transform 0.25s ease-in-out, opacity 0.25s ease-in-out; }
.gw-widget.dragging { opacity: 0.55; transform: scale(0.985) rotate(0.4deg); box-shadow: var(--gw-shadow-hover); }
.gw-widget-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.gw-widget-head .gw-card-title { margin: 0; }
.gw-drag {
  border: 0; background: transparent; color: #c8c2d8; font-size: 13px;
  cursor: grab; padding: 4px 6px; border-radius: 8px; letter-spacing: -2px;
  transition: all 0.3s ease-in-out;
}
.gw-drag:hover { background: var(--gw-lav-100); color: var(--gw-lav-700); }
.gw-drag:active { cursor: grabbing; }

/* ---------- v2: ticker ---------- */
.gw-ticker { padding: 0; overflow: hidden; margin-bottom: 16px; }
.gw-ticker-track {
  display: inline-flex; gap: 34px; white-space: nowrap; padding: 13px 0;
  animation: gw-marquee 45s linear infinite; will-change: transform;
}
.gw-ticker:hover .gw-ticker-track { animation-play-state: paused; }
.gw-ticker-item { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--gw-ink); padding-left: 20px; }
.gw-ticker-item strong { color: var(--gw-lav-700); margin-right: 4px; }
@keyframes gw-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .gw-ticker-track { animation: none; } }

/* ---------- v2: P&L rows ---------- */
.gw-pnl-rows { display: flex; flex-direction: column; }
.gw-pnl-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--gw-canvas); font-size: 13px;
}
.gw-pnl-row:last-child { border-bottom: 0; }
.gw-pnl-row span { color: var(--gw-ink-soft); }
.gw-pnl-row strong { font-variant-numeric: tabular-nums; }

/* ---------- v2: wallet ---------- */
.gw-addr-row { display: flex; gap: 8px; align-items: center; }
.gw-addr-row code { flex: 1; background: var(--gw-canvas); border: 1px solid var(--gw-border); border-radius: 10px; padding: 9px 12px; }
.gw-copy {
  border: 1px solid var(--gw-border); background: var(--gw-white); color: var(--gw-ink-soft);
  font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 10px; cursor: pointer;
  transition: all 0.3s ease-in-out; font-family: var(--gw-font-body);
}
.gw-copy:hover { border-color: var(--gw-lav-500); color: var(--gw-lav-700); background: var(--gw-lav-100); }
.gw-withdraw { margin-top: 14px; border-top: 1px solid var(--gw-canvas); padding-top: 12px; }
.gw-withdraw summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--gw-lav-700); }
.gw-transfers { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.gw-transfers li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--gw-canvas); }
.gw-transfers li:last-child { border-bottom: 0; }

/* ---------- v2: planner ---------- */
.gw-schedule { margin-top: 16px; border-top: 1px solid var(--gw-canvas); padding-top: 14px; }
.gw-switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.gw-switch input { position: absolute; opacity: 0; }
.gw-switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: #e4e0ee; position: relative;
  transition: all 0.3s ease-in-out; flex: none;
}
.gw-switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: all 0.3s ease-in-out; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.gw-switch input:checked + .track { background: var(--gw-grad); }
.gw-switch input:checked + .track::after { left: 19px; }
.gw-schedule-times { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.gw-schedule-times input { padding: 8px 10px; border: 1px solid var(--gw-border); border-radius: 10px; font-family: var(--gw-font-body); font-size: 13px; }
.gw-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- v2: console/logs ---------- */
.gw-console {
  background: #faf9fd; border: 1px solid var(--gw-border); border-radius: 12px;
  padding: 12px 14px; max-height: 340px; overflow-y: auto;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12px; line-height: 1.7;
}
.gw-log { color: var(--gw-ink-soft); word-break: break-all; }
.gw-log .t { color: #b3aec6; margin-right: 10px; }
.gw-log.ok { color: var(--gw-mint); }
.gw-log.warn { color: #b45309; }
.gw-log.trade { color: var(--gw-lav-700); font-weight: 600; }

/* ---------- v2: paginatie ---------- */
.gw-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.gw-page-btn {
  border: 1px solid var(--gw-border); background: var(--gw-white); color: var(--gw-ink-soft);
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer; transition: all 0.3s ease-in-out;
}
.gw-page-btn:hover:not(:disabled) { border-color: var(--gw-lav-500); color: var(--gw-lav-700); background: var(--gw-lav-100); }
.gw-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gw-page-info { font-size: 12px; color: var(--gw-ink-soft); font-variant-numeric: tabular-nums; }
.gw-mini-select { border: 1px solid var(--gw-border); border-radius: 10px; padding: 6px 8px; font-size: 12px; font-family: var(--gw-font-body); background: var(--gw-white); }

/* ---------- v2: nieuws ---------- */
.gw-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gw-news-item {
  display: flex; flex-direction: column; border: 1px solid var(--gw-border); border-radius: 14px;
  overflow: hidden; background: var(--gw-white); transition: all 0.3s ease-in-out; text-decoration: none;
}
.gw-news-item:hover { box-shadow: var(--gw-shadow-hover); transform: translateY(-2px); text-decoration: none; }
.gw-news-item .thumb { height: 120px; background-size: cover; background-position: center; background-color: var(--gw-lav-100); }
.gw-news-item .thumb-empty { background: var(--gw-grad); opacity: 0.35; }
.gw-news-item .body { padding: 12px 14px; }
.gw-news-item .src { font-size: 11px; color: var(--gw-ink-soft); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.gw-news-item .ttl { font-size: 13px; font-weight: 600; color: var(--gw-ink); line-height: 1.45; }
