/* PredictTick — Dark Crypto Dashboard Theme */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #14141c;
  --border: #1e1e2e;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --accent-cyan: #00e5ff;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-purple: #a855f7;
}

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

html { font-size: 14px; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
}

/* Grid background */
.grid-bg {
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Scan line */
.scan-line::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,229,255,0.015) 2px, rgba(0,229,255,0.015) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Noise overlay */
.noise::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.main-content { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}

.page-content { padding: 1.5rem; flex: 1; }

/* Sidebar styles */
.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--accent-cyan);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.sidebar-logo-text {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0.75rem; }
.nav-section { margin-bottom: 0.5rem; }
.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.5rem 0.5rem 0.25rem;
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { background: var(--border); color: var(--text-primary); }
.nav-link.active {
  background: rgba(0,229,255,0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,229,255,0.15);
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border); }
.sidebar-footer-text { font-size: 0.7rem; color: var(--text-muted); text-align: center; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid helpers */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid-cols-3.md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Flex helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Text helpers */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }
.text-purple { color: var(--accent-purple); }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.capitalize { text-transform: capitalize; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseGlow { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-fade-in { animation: fadeIn 0.4s ease-out both; }
.animate-slide-up { animation: slideUp 0.5s ease-out both; }
.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

/* Stagger delays for cards */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-cyan); color: #000;
}
.btn-primary:hover { background: rgba(0,229,255,0.85); }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem; font-weight: 700;
  border: 1px solid transparent;
}

/* Live indicator */
.live-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem; font-weight: 600;
  border: 1px solid;
}
.live-badge.live {
  background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3);
  color: var(--accent-green);
}
.live-badge.demo {
  background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3);
  color: var(--accent-yellow);
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.live-badge.live .live-dot { animation: pulseGlow 2s ease-in-out infinite; }

/* Sentiment card */
.sentiment-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid;
}
.sentiment-bullish {
  background: rgba(16,185,129,0.05);
  border-color: rgba(16,185,129,0.2);
}
.sentiment-bearish {
  background: rgba(239,68,68,0.05);
  border-color: rgba(239,68,68,0.2);
}
.sentiment-neutral {
  background: rgba(245,158,11,0.05);
  border-color: rgba(245,158,11,0.2);
}

/* Ticker card */
.ticker-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.ticker-card:hover { border-color: rgba(0,229,255,0.2); }

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Dividers */
.divider { height: 1px; background: var(--border); }
.v-divider { width: 1px; background: var(--border); }

/* Symbol badge */
.symbol-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Tag pills */
.tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem; font-weight: 700;
  border: 1px solid;
}
.tag-up { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--accent-green); }
.tag-down { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--accent-red); }
.tag-neutral { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: var(--accent-yellow); }

/* Rounded-full */
.rounded-full { border-radius: 9999px; }

/* Tabs */
.tab-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  background: rgba(0,229,255,0.08);
  color: var(--accent-cyan);
  border-color: rgba(0,229,255,0.2);
}

/* Sparkline container */
.sparkline-container { height: 48px; }

/* Range input */
input[type="range"] { width: 100%; accent-color: var(--accent-cyan); }

/* Table */
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(30,30,46,0.5);
}
tbody tr:hover { background: rgba(17,17,24,0.5); }

/* Form elements */
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: monospace;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus {
  border-color: rgba(0,229,255,0.4);
}
input[type="number"] { font-family: monospace; }

/* Toggle switch */
.toggle {
  position: relative;
  width: 40px; height: 20px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}
.toggle.on { background: var(--accent-cyan); }
.toggle.off { background: var(--border); }
.toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  transition: left 0.2s;
}
.toggle.on .toggle-knob { left: 22px; }

/* Opportunity row */
.opp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  background: var(--bg-card);
  margin-bottom: 0.75rem;
}
.opp-row:hover { border-color: rgba(168,85,247,0.4); }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon { width: 40px; height: 40px; margin-bottom: 0.75rem; opacity: 0.4; }

/* Disclaimer box */
.disclaimer {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(245,158,11,0.2);
  background: rgba(245,158,11,0.05);
  display: flex; align-items: flex-start; gap: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .hide-mobile { display: none; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl\:col-span-2 { grid-column: span 2 / span 2; }
}
