/* Modern Dark Theme Design System */
:root {
  /* Color Palette - Deep Slate & Violet */
  --bg-color: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --surface-color: rgba(30, 41, 59, 0.7);
  --surface-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(148, 163, 184, 0.1);

  --primary-color: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.5);
  --secondary-color: #06b6d4;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;

  /* Neon Palette */
  --neon-cyan: #22d3ee;
  --neon-violet: #a78bfa;
  --neon-emerald: #34d399;
  --neon-amber: #fbbf24;
  --neon-rose: #f43f5e;

  /* Spacing & Layout */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Effects */
  --glass-blur: blur(12px);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 24px;
}

/* Glassmorphism Components */
.glass-panel {
  background: var(--surface-color);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Header & Nav */
.header {
  margin-bottom: 32px;
  padding: 24px 32px;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.1), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  margin-bottom: 32px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo::before {
  content: '🚀';
  font-size: 24px;
  -webkit-text-fill-color: initial;
}

.nav-links {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-link {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Hero Section */
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  margin-top: 24px;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Data Table */
.table-container {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 20px 24px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.5);
}

td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 15px;
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Table Elements */
.rank {
  font-family: 'Outfit', monospace;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 14px;
}

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

.company-name {
  font-weight: 600;
  color: var(--text-primary);
}

.ticker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  text-transform: uppercase;
  font-weight: 600;
}

.metric {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.lift {
  font-weight: 700;
  color: var(--success-color);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lift.high {
  color: #f472b6;
  /* Pink for high trending */
  text-shadow: 0 0 10px rgba(244, 114, 182, 0.3);
}

.timestamp {
  color: var(--text-muted);
  font-size: 13px;
}

/* Sectors Grid */
.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.sector-card {
  padding: 24px;
  transition: var(--transition);
}

.sector-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}

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

.sector-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sector-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.05);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.sector-name {
  font-size: 18px;
  font-weight: 700;
}

.sector-count {
  background: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.company-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.company-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}

.company-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Loading State */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 16px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .header {
    padding: 20px;
  }

  .nav {
    flex-direction: column;
    gap: 16px;
  }

  .stats-bar {
    gap: 24px;
    flex-wrap: wrap;
  }

  h1 {
    font-size: 32px;
  }

  .sectors-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 16px;
  }

  .hide-mobile {
    display: none;
  }
}