/* ============================================
   AlphaSignal - Professional Trading Terminal
   Bloomberg-inspired Dark Theme
   ============================================ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1420;
  --bg-tertiary: #161b2c;
  --bg-card: #1a2035;
  --bg-hover: #232a44;
  --border-color: #2a3352;
  --text-primary: #e8edf5;
  --text-secondary: #9ca3b8;
  --text-muted: #6b7390;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --green: #10b981;
  --green-bright: #00ff88;
  --red: #ef4444;
  --red-bright: #ff3b5c;
  --yellow: #fbbf24;
  --orange: #f97316;
  --purple: #a855f7;
}

* {
  font-family: 'Cairo', 'Inter', sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace !important;
}

.font-cairo {
  font-family: 'Cairo', 'Inter', sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* Ticker Tape */
.ticker-tape {
  background: linear-gradient(90deg, #0f1420 0%, #161b2c 100%);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: ticker-scroll 90s linear infinite;
  padding-right: 100%;
}

@keyframes ticker-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.ticker-item {
  display: inline-block;
  margin: 0 24px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

/* Glass Card */
.glass-card {
  background: linear-gradient(145deg, rgba(26, 32, 53, 0.6), rgba(15, 20, 32, 0.8));
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Stat Card */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-blue);
}

.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.purple::before { background: var(--purple); }

/* Color helpers */
.text-green { color: var(--green-bright); }
.text-red { color: var(--red-bright); }
.text-yellow { color: var(--yellow); }
.bg-green-soft { background: rgba(16, 185, 129, 0.15); }
.bg-red-soft { background: rgba(239, 68, 68, 0.15); }
.bg-yellow-soft { background: rgba(251, 191, 36, 0.15); }
.bg-purple-soft { background: rgba(168, 85, 247, 0.15); }

/* Sidebar */
.sidebar {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  min-height: 100vh;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.1));
  color: var(--accent-blue);
  border-left: 3px solid var(--accent-blue);
}

.sidebar-link i {
  width: 20px;
  text-align: center;
}

/* Search */
.search-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--accent-blue);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #10ffa3;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ff5577;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-yellow {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: right;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pulse */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--green-bright);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 255, 136, 0.7); }
  50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(16, 255, 136, 0); }
}

/* Heatmap */
.heatmap-cell {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 12px 8px;
  min-height: 60px;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.heatmap-cell:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}

/* Animation utilities */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tab styles */
.tab-btn {
  padding: 10px 18px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Range buttons */
.range-btn {
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
  border: 1px solid rgba(42, 51, 82, 0.5);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
}
.range-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}
.range-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

/* Spinner */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Hero gradient */
.hero-gradient {
  background:
    radial-gradient(ellipse at top, rgba(59, 130, 246, 0.15), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.1), transparent 50%),
    var(--bg-primary);
}

/* Number formatting */
.num-positive { color: var(--green-bright); }
.num-negative { color: var(--red-bright); }
.num-neutral { color: var(--text-secondary); }

/* Section title */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-title h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.section-title .icon-box {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}

/* Mini chart container */
.mini-chart {
  height: 50px;
  position: relative;
}

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }
}
