/*
Theme Name: GainWave
Theme URI: https://gainwave.local
Author: Volkan
Description: Lavender Light trading dashboard theme met invite-only registratie, Node.js engine koppeling, draggable widgets, live prijzen en crypto nieuws.
Version: 2.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-amber: #f59e0b;
  --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: 14px;
  color: var(--gw-ink);
  letter-spacing: 1px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.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;
  transition: box-shadow 0.3s ease-in-out, transform 0.2s ease-in-out;
}
.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;
}

/* ---------- Widgets & Drag & Drop ---------- */
.gw-widget { position: relative; }
.gw-widget-handle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  cursor: grab;
}
.gw-widget-handle:active { cursor: grabbing; }
.gw-widget-handle .gw-card-title { margin: 0; }
.gw-drag-hint {
  font-size: 14px;
  color: var(--gw-border);
  cursor: grab;
  user-select: none;
  line-height: 1;
  letter-spacing: 2px;
  transition: color 0.2s;
}
.gw-drag-hint:hover { color: var(--gw-lav-500); }
.gw-widget[draggable="true"] { cursor: default; }
.gw-widget.dragging {
  opacity: 0.6;
  transform: scale(0.98);
  box-shadow: var(--gw-shadow-hover);
}
.gw-widget.drag-over {
  border-color: var(--gw-lav-500);
  box-shadow: 0 0 0 2px rgba(199, 125, 255, 0.2);
}

/* ---------- 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: var(--gw-amber); }
.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-6 { grid-column: span 6; }
.gw-col-8 { grid-column: span 8; }
.gw-col-12 { grid-column: span 12; }
@media (max-width: 860px) {
  .gw-col-4, .gw-col-6, .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: 16px; letter-spacing: 2px; }
.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; }

/* ---------- Live prijs ticker ---------- */
.gw-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gw-mint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gw-live-dot .pulse {
  width: 7px;
  height: 7px;
  background: var(--gw-mint);
  border-radius: 50%;
  animation: gw-pulse 2s ease-in-out infinite;
}
@keyframes gw-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.gw-ticker {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.gw-ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.gw-ticker-name {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gw-ink);
  min-width: 40px;
}
.gw-ticker-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gw-ink);
}
.gw-ticker-change {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--gw-canvas);
}

/* ---------- P&L Summary ---------- */
.gw-pnl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .gw-pnl-grid { grid-template-columns: 1fr; }
}
.gw-pnl-item {
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  background: var(--gw-canvas);
}
.gw-pnl-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gw-ink-soft);
  margin-bottom: 8px;
}
.gw-pnl-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}
.gw-pnl-meta {
  font-size: 12px;
  color: var(--gw-ink-soft);
}

/* ---------- News widget ---------- */
.gw-news-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gw-canvas);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  border-radius: 8px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}
.gw-news-item:last-child { border-bottom: 0; }
.gw-news-item:hover {
  background: var(--gw-canvas);
  text-decoration: none;
}
.gw-news-img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.gw-news-body { flex: 1; min-width: 0; }
.gw-news-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gw-ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.gw-news-meta {
  font-size: 11px;
  color: var(--gw-ink-soft);
}
.gw-news-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gw-canvas);
}

/* ---------- Activity log ---------- */
.gw-activity-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gw-canvas);
  font-size: 12px;
}
.gw-activity-item:last-child { border-bottom: 0; }
.gw-activity-time {
  color: var(--gw-ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 110px;
}
.gw-activity-msg {
  color: var(--gw-ink);
  flex: 1;
  word-break: break-word;
}

/* ---------- Pagination ---------- */
.gw-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gw-canvas);
}

/* ---------- Keyboard hints ---------- */
kbd {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  background: var(--gw-canvas);
  border: 1px solid var(--gw-border);
  border-radius: 5px;
  box-shadow: 0 1px 0 var(--gw-border);
  color: var(--gw-ink-soft);
  line-height: 1.3;
}
