/* ========================================
   Symtrade.com — Dark Finance Theme
   ======================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-hover: #1f2937;
  --border: #2a3040;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --green-bg: rgba(34, 197, 94, 0.1);
  --red-bg: rgba(239, 68, 68, 0.1);
  --header-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Header ─── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo span { color: var(--accent-cyan); }

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ─── Main Content ─── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.page-subtitle .date {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Stats Bar ─── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.stat-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-card .value.green { color: var(--accent-green); }
.stat-card .value.red { color: var(--accent-red); }
.stat-card .value.blue { color: var(--accent-blue); }
.stat-card .value.cyan { color: var(--accent-cyan); }

/* ─── Table — Terminal/Monospaced stijl ─── */
.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1117;
  max-height: 540px;
}

.table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #0d1117;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
}

thead th {
  background: #161b22;
  color: #8b949e;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 10px 10px;
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  border-bottom: 1px solid #30363d;
}

thead th:first-child,
thead th:nth-child(2),
thead th:last-child {
  text-align: left;
}

thead th:hover {
  color: #c9d1d9;
  background: #1c2333;
}

thead th .sort-icon {
  margin-left: 3px;
  opacity: 0.3;
  font-size: 0.65rem;
}

thead th.sorted .sort-icon { opacity: 1; color: var(--accent-cyan); }

tbody tr {
  border-bottom: 1px solid #21262d;
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover {
  background: #161b22;
}

tbody td {
  padding: 5px 10px;
  white-space: nowrap;
  text-align: right;
  color: #c9d1d9;
}

tbody td:first-child {
  color: #8b949e;
  text-align: center;
}

tbody td:nth-child(2) {
  text-align: left;
  font-weight: 600;
  color: #e6edf3;
}

tbody td:last-child {
  text-align: left;
  color: #8b949e;
  font-size: 0.72rem;
}

/* Sentiment badges — terminal stijl */
.badge-bull { 
  color: var(--accent-green); 
  font-weight: 700;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.badge-bear { 
  color: var(--accent-red); 
  font-weight: 700;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.badge-earn {
  color: var(--accent-yellow);
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.badge-earn-today {
  color: #f0883e;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* Volume change colors */
.vol-up { color: var(--accent-green); }
.vol-down { color: var(--accent-red); }

/* Price / Change */
.price-up { color: var(--accent-green); }
.price-down { color: var(--accent-red); }

/* Table header separator — like ---|--------- style */
.table-separator {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  padding: 0 10px;
  color: #21262d;
  background: #0d1117;
  line-height: 1;
  border-bottom: none !important;
}

.table-separator td {
  padding: 0 10px;
  color: #21262d !important;
  font-size: 0.7rem;
}

/* ─── Footer ─── */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 48px;
}

/* ─── Navigation mobile ─── */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: column;
  }
  .nav-links.open { display: flex; }
  .mobile-toggle { display: block; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  thead th, tbody td { padding: 4px 6px; font-size: 0.65rem; }
  table { font-size: 0.65rem; }
}

/* ─── Loading State ─── */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}

.loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive table improvements ─── */
@media (max-width: 600px) {
  table { font-size: 0.6rem; }
  thead th, tbody td { padding: 3px 4px; }
  .container { padding: 16px 12px; }
}

/* Download button */
.btn-download {
  background: transparent;
  border: 1px solid #30363d;
  color: #8b949e;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-download:hover {
  background: #1c2333;
  border-color: #58a6ff;
  color: #c9d1d9;
}
