/* ==========================================
   SPOTPULSE — Global Premium CSS Design System
   ========================================== */

/* 1. Global Reset & Custom Properties */
:root {
  --color-bg: #030407;
  --color-panel: rgba(12, 14, 20, 0.55);
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  
  --text-main: #f8f9fa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  /* Neon Cyberpunk Colors */
  --neon-cyan: #00f2fe;
  --neon-blue: #2563eb;
  --neon-green: #00ff88;
  --neon-red: #ff2a55;
  --neon-yellow: #ffb800;
  --neon-purple: #a855f7;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --grad-ai: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --grad-alert: linear-gradient(135deg, #ff2a55 0%, #ff7b00 100%);

  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-title: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--color-bg);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* 2. Ambient Holographic Background */
.hologram-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
  animation: float 20s infinite alternate ease-in-out;
}

.orb-primary { width: 50vw; height: 50vw; background: var(--neon-cyan); top: -20%; right: -10%; }
.orb-secondary { width: 40vw; height: 40vw; background: var(--neon-purple); bottom: -10%; left: -10%; animation-delay: -5s; }
.orb-tertiary { width: 30vw; height: 30vw; background: var(--neon-blue); top: 40%; left: 30%; opacity: 0.08; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, 50px) scale(1.1); }
}

/* 3. Utility & Glassmorphism Core */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-column { display: flex; flex-direction: column; }
.gap-2 { gap: 0.75rem; }
.mt-2 { margin-top: 1rem; }
.hidden { display: none !important; }

/* The Glass Engine */
.glass-panel {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

/* Typography Enhancements */
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 4. Layout Container (Mobile First Wrapper) */
.app-container {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 5. Main Header styling */
.main-header {
  display: flex;
  flex-direction: column; /* Mobile first */
  gap: 1rem;
  padding: 1.25rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-pulse {
  width: 10px; height: 10px;
  background-color: var(--neon-cyan);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 12px var(--neon-cyan);
}
.logo-pulse::after {
  content: ''; position: absolute; inset: -4px;
  border: 1.5px solid var(--neon-cyan);
  border-radius: 50%;
  animation: pulse-ring 2s infinite ease-out;
}
@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.logo-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
}
.logo-title span { color: var(--neon-cyan); }
.logo-badge {
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.1em;
}

/* Connection Badges */
.connection-status {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 6px 14px; border-radius: 30px;
  font-size: 0.75rem; font-weight: 600;
  border: 1px solid transparent;
  width: fit-content;
}
.status-loading { background: rgba(255,184,0,0.08); border-color: rgba(255,184,0,0.2); color: var(--neon-yellow); }
.status-connected { background: rgba(0,255,136,0.08); border-color: rgba(0,255,136,0.2); color: var(--neon-green); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background-color: currentColor; box-shadow: 0 0 8px currentColor; }

/* Buttons */
.btn {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s ease;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary { background: var(--grad-primary); color: #000; box-shadow: 0 4px 15px rgba(0,242,254,0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,242,254,0.5); }

/* 6. SPOTPULSE Breaking Ticker */
.ticker-banner {
  display: flex;
  align-items: center;
  font-family: var(--font-body);
  border-radius: 12px;
}
.ticker-label {
  background: var(--grad-alert);
  color: #fff; font-weight: 800; font-size: 0.75rem;
  padding: 10px 16px; white-space: nowrap; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 0.5rem;
  z-index: 10;
}
.ticker-label::after {
  content: ''; width: 6px; height: 6px; background: #fff; border-radius: 50%;
  animation: beacon 1.2s infinite ease-out;
}
@keyframes beacon {
  0% { transform: scale(0.8); opacity: 1; box-shadow: 0 0 0 0px rgba(255,255,255,0.7); }
  100% { transform: scale(1.6); opacity: 0; box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}
.ticker-container { flex-grow: 1; overflow: hidden; position: relative; }
.ticker-wrap { width: 100%; overflow: hidden; }
.ticker-content {
  display: inline-flex; white-space: nowrap; padding-left: 100%;
  animation: ticker-slide 30s linear infinite; gap: 3rem;
}
.ticker-content:hover { animation-play-state: paused; cursor: pointer; }
@keyframes ticker-slide {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}
.ticker-item { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 500; }
.badge-red, .badge-blue, .badge-green { font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; color: #fff; }
.badge-red { background: var(--neon-red); box-shadow: 0 0 8px rgba(255,42,85,0.4); }
.badge-blue { background: var(--neon-blue); box-shadow: 0 0 8px rgba(37,99,235,0.4); }
.badge-green { background: var(--neon-green); color: #000; box-shadow: 0 0 8px rgba(0,255,136,0.4); }

/* 7. Stats summary cards row (Mobile First: Grid) */
.stats-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.stat-card {
  padding: 1.25rem; display: flex; align-items: center; gap: 1.25rem;
}
.stat-card:hover { border-color: var(--color-border-hover); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-cyan { background: rgba(0,242,254,0.1); color: var(--neon-cyan); }
.icon-red { background: rgba(255,42,85,0.1); color: var(--neon-red); }
.icon-green { background: rgba(0,255,136,0.1); color: var(--neon-green); }
.icon-purple { background: rgba(168,85,247,0.1); color: var(--neon-purple); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); font-weight: 600; margin-bottom: 2px; }
.stat-number { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sentiment-flex { display: flex; align-items: center; gap: 0.75rem; }
.sentiment-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 30px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.label-low { color: var(--neon-green) !important; }
.label-medium { color: var(--neon-yellow) !important; }
.label-high { color: var(--neon-red) !important; }

/* 8. Main Split Layout (Mobile First: Column) */
.main-split {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.split-col { display: flex; flex-direction: column; gap: 1rem; }

/* Right Panel Headers */
.panel-header {
  padding: 1.25rem; border-bottom: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center;
}
.feed-header { padding: 1.25rem 1.25rem 0.75rem; border-bottom: none; }
.panel-title { font-family: var(--font-title); font-size: 1.15rem; font-weight: 700; }
.panel-subtitle { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* 9. AI Prediction Matrix Panel (NEW) */
.ai-panel { border: 1px solid rgba(168,85,247,0.3); box-shadow: 0 4px 25px rgba(168,85,247,0.1); }
.ai-header-flex { display: flex; align-items: center; gap: 0.75rem; }
.ai-icon-glow { color: var(--neon-purple); filter: drop-shadow(0 0 8px var(--neon-purple)); }
.ai-prediction-wrapper { padding: 1.25rem; display: flex; flex-direction: column; }
.prediction-block { display: flex; flex-direction: column; gap: 0.4rem; }
.pred-label { font-size: 0.7rem; font-weight: 800; color: var(--neon-purple); letter-spacing: 0.05em; }
.pred-text { font-size: 0.85rem; color: #e5e7eb; line-height: 1.6; }
.pred-highlight { font-family: var(--font-title); font-size: 1.2rem; font-weight: 800; color: var(--neon-cyan); }

/* 10. Channels & Assets Lists */
.channels-list-wrapper, .assets-wrapper { max-height: 250px; overflow-y: auto; padding: 0.5rem 1rem 1rem; }
.list-placeholder { text-align: center; font-size: 0.82rem; color: var(--text-secondary); padding: 2rem 0; font-style: italic; }
.channel-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: rgba(255,255,255,0.02); border: 1px solid var(--color-border); border-radius: 8px; margin-bottom: 0.5rem; transition: all 0.2s ease; }
.channel-item:hover { background: rgba(0,242,254,0.05); border-color: rgba(0,242,254,0.3); }
.channel-name { font-size: 0.88rem; font-weight: 600; color: #fff; }
.channel-handle { font-size: 0.75rem; color: var(--text-secondary); }
.badge-unread { background: var(--neon-cyan); color: #000; font-size: 0.7rem; font-weight: 700; border-radius: 30px; padding: 2px 6px; }

.asset-item { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 0.85rem; background: rgba(255,255,255,0.02); border: 1px solid var(--color-border); border-radius: 8px; margin-bottom: 0.5rem; }
.asset-badge { font-family: var(--font-title); font-weight: 800; font-size: 0.85rem; color: var(--neon-cyan); background: rgba(0,242,254,0.08); padding: 2px 8px; border-radius: 4px; }
.asset-count { font-size: 0.75rem; color: var(--text-secondary); }

/* 11. Feed Interface */
.feed-filters { display: flex; gap: 0.5rem; padding: 0.5rem 1.25rem 1rem; border-bottom: 1px solid var(--color-border); overflow-x: auto; scrollbar-width: none; }
.feed-filters::-webkit-scrollbar { display: none; }
.filter-tab { background: transparent; border: none; font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); padding: 6px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.filter-tab.active { background: rgba(255,255,255,0.08); color: #fff; font-weight: 600; }

.feed-content-wrapper { padding: 1.25rem; min-height: 400px; max-height: 70vh; overflow-y: auto; }
.feed-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5rem 0; color: var(--text-secondary); font-size: 0.85rem; }
.pulse-ring { width: 40px; height: 40px; border: 3px solid rgba(0,242,254,0.1); border-top-color: var(--neon-cyan); border-radius: 50%; margin-bottom: 1rem; animation: spinner 0.8s linear infinite; }
@keyframes spinner { to { transform: rotate(360deg); } }

.messages-feed { display: flex; flex-direction: column; gap: 1rem; }
.message-card { background: rgba(255,255,255,0.02); border: 1px solid var(--color-border); border-radius: 12px; padding: 1.25rem; animation: slide-up 0.4s ease; transition: all 0.2s; }
.message-card:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.15); }
@keyframes slide-up { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.msg-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.msg-channel-title { font-family: var(--font-title); font-size: 0.95rem; font-weight: 700; color: #fff; }
.msg-channel-meta { font-size: 0.75rem; color: var(--text-secondary); }
.msg-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }

.msg-badge-ad { font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: rgba(255,184,0,0.1); color: var(--neon-yellow); }
.msg-badge-organic { font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: rgba(0,255,136,0.1); color: var(--neon-green); }
.badge-sentiment-bullish { background: rgba(0,255,136,0.1); color: var(--neon-green); font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.badge-sentiment-bearish { background: rgba(255,42,85,0.1); color: var(--neon-red); font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.badge-sentiment-neutral { background: rgba(255,255,255,0.05); color: var(--text-secondary); font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }

.msg-body { font-size: 0.88rem; color: #e4e4e7; white-space: pre-wrap; word-break: break-word; line-height: 1.6; margin-bottom: 0.75rem; }
.highlight-ticker { color: var(--neon-cyan); background: rgba(0,242,254,0.1); padding: 0 4px; border-radius: 3px; font-weight: 700; }
.msg-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.05); padding-top: 0.5rem; }
.msg-tickers { display: flex; gap: 0.4rem; }
.ticker-badge { font-size: 0.65rem; font-weight: 800; background: rgba(0,242,254,0.08); border: 1px solid rgba(0,242,254,0.2); color: var(--neon-cyan); padding: 1px 6px; border-radius: 3px; }

/* 12. Desktop Layout Overrides */
@media (min-width: 768px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .main-header { flex-direction: row; justify-content: space-between; align-items: center; }
  .app-container { padding: 1.5rem; gap: 1.5rem; }
}

@media (min-width: 1024px) {
  .main-split {
    display: grid;
    grid-template-columns: 1fr 360px; /* Feed on left, Sidebars on right */
    align-items: start;
    gap: 1.5rem;
  }
  .content-primary { order: 1; }
  .content-secondary { order: 2; }
  .feed-content-wrapper { max-height: 800px; }
}
