/* Sorsa Intelligence Terminal Cyberpunk Dark Theme */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0e121a;
  --bg-card: rgba(18, 24, 38, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 240, 255, 0.5);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --neon-cyan: #00f0ff;
  --neon-purple: #a855f7;
  --neon-green: #00ff88;
  --neon-pink: #ff007a;
  --neon-amber: #f59e0b;
  --neon-blue: #3b82f6;

  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(0, 240, 255, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 40%);
}

.terminal-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Glass Panel Utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-orb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 10px rgba(0, 240, 255, 0.4); }
  100% { transform: scale(1.05); box-shadow: 0 0 20px rgba(168, 85, 247, 0.8); }
}

.brand-text h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-text h1 span {
  color: var(--neon-cyan);
}

.subtext {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-radar {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-radar:hover {
  background: rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.vps-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
}

/* Search Bar */
.search-section {
  margin-bottom: 24px;
}

.search-bar-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px 8px 6px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar-wrap:focus-within {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.search-prefix {
  font-size: 20px;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-right: 8px;
}

.search-bar-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  font-family: var(--font-sans);
}

.scan-depth-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  margin-right: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scan-depth-select:focus, .scan-depth-select:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.scan-depth-select option {
  background: #0f172a;
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), #00a8ff);
  color: #030712;
  border: none;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.quick-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chip-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.3);
}

/* Target Overview Hero Card */
.target-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 24px;
  padding: 24px;
  margin-bottom: 24px;
}

.target-profile-col {
  display: flex;
  gap: 18px;
}

.target-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
  object-fit: cover;
}

.target-info {
  flex: 1;
}

.target-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.target-name-row h2 {
  font-size: 20px;
  font-weight: 700;
}

.handle-tag {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 14px;
}

.x-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s;
}

.x-link:hover {
  color: var(--neon-cyan);
}

.target-bio {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.target-stats-row {
  display: flex;
  gap: 16px;
}

.stat-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-dim);
}

/* Target Score Column */
.target-score-col {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 0 20px;
}

.score-display {
  text-align: center;
}

.score-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.score-val {
  font-size: 52px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.5);
  line-height: 1;
  margin-bottom: 4px;
}

.score-delta {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--neon-green);
  margin-bottom: 6px;
}

.score-delta.negative {
  color: #f43f5e;
}

.score-tier {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

/* Audit Column */
.target-audit-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.audit-header {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.audit-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.audit-num {
  font-family: var(--font-mono);
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-fill.green { background: var(--neon-green); }
.progress-fill.cyan { background: var(--neon-cyan); }
.progress-fill.purple { background: var(--neon-purple); }

/* Score Tier Histogram Section */
.histogram-section {
  padding: 20px 24px;
  margin-bottom: 24px;
}

.hist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.hist-header h3 {
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.btn-tiny {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tiny:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.hist-bars-wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  height: 140px;
}

.hist-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.hist-col:hover {
  background: rgba(255, 255, 255, 0.04);
}

.hist-col.active {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.hist-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.hist-bar-track {
  flex: 1;
  width: 38px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: 8px;
}

.hist-bar-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-whale { background: linear-gradient(to top, #be185d, #ff007a); }
.bar-alpha { background: linear-gradient(to top, #7e22ce, #a855f7); }
.bar-kol { background: linear-gradient(to top, #0284c7, #00f0ff); }
.bar-rising { background: linear-gradient(to top, #059669, #00ff88); }
.bar-micro { background: linear-gradient(to top, #475569, #94a3b8); }

.hist-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.3;
}

.tier-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

/* Controls Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-inputs input {
  width: 80px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  outline: none;
}

.range-inputs input:focus {
  border-color: var(--neon-cyan);
}

.range-sep {
  color: var(--text-dim);
}

.category-pills {
  display: flex;
  gap: 6px;
}

.pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pill.active {
  background: var(--neon-cyan);
  color: #030712;
  font-weight: 700;
  border-color: var(--neon-cyan);
}

.search-filter input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  outline: none;
  width: 180px;
}

.search-filter input:focus {
  border-color: var(--neon-cyan);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.btn-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-action.btn-accent {
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.4);
  color: var(--neon-green);
}

.btn-action.btn-accent:hover {
  background: rgba(0, 255, 136, 0.25);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.3);
}

/* Leaderboard Table */
.table-container {
  overflow-x: auto;
  position: relative;
  min-height: 300px;
}

.loader-wrap {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 9, 14, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--neon-cyan);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.leaderboard-table tbody tr {
  transition: background 0.15s;
}

.leaderboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rank-cell {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 12px;
}

.profile-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.profile-names {
  display: flex;
  flex-direction: column;
}

.profile-display-name {
  font-weight: 600;
  color: var(--text-main);
}

.profile-handle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--neon-cyan);
}

.score-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1;
}

.score-badge.whale { background: rgba(255, 0, 122, 0.15); color: #ff007a; border: 1px solid rgba(255, 0, 122, 0.3); }
.score-badge.alpha { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.score-badge.kol { background: rgba(0, 240, 255, 0.15); color: #00f0ff; border: 1px solid rgba(0, 240, 255, 0.3); }
.score-badge.rising { background: rgba(0, 255, 136, 0.15); color: #00ff88; border: 1px solid rgba(0, 255, 136, 0.3); }
.score-badge.micro { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

.delta-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.delta-badge.pos { color: var(--neon-green); }
.delta-badge.neg { color: #f43f5e; }
.delta-badge.zero { color: var(--text-dim); }

.tier-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.followers-cell {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.cat-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.action-btn {
  color: var(--neon-cyan);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.05);
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(0, 240, 255, 0.2);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Gainers Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #d8b4fe;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.btn-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.gainers-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-dim);
}

.pill-gainer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
}

.pill-gainer.active {
  background: var(--neon-purple);
  color: #fff;
  border-color: var(--neon-purple);
  font-weight: 700;
}

.gainers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.gainer-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.gainer-card:hover {
  border-color: var(--neon-purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2);
}

.gainer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.gainer-details {
  flex: 1;
  overflow: hidden;
}

.gainer-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gainer-handle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon-cyan);
}

.gainer-stat {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-green);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--neon-cyan);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 240, 255, 0.3);
  z-index: 2000;
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .target-card {
    grid-template-columns: 1fr;
  }
  .target-score-col {
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
  }
}

