:root {
  --bg-primary: #0f1117;
  --bg-secondary: #171b26;
  --bg-card: #1e2333;
  --border-color: #2b3247;
  --gold-primary: #d4af37;
  --gold-light: #f5d77f;
  --gold-dark: #aa8528;
  --text-primary: #f0f3fa;
  --text-secondary: #9da7be;
  --positive: #10b981;
  --neutral: #64748b;
  --negative: #ef4444;
  --accent: #3b82f6;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: 50px;
}

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

/* Header */
header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-logo {
  font-size: 28px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-connected {
  background: rgba(16, 185, 129, 0.15);
  color: var(--positive);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #0b0c10;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.4);
}

.metric-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-delta {
  font-size: 13px;
  margin-top: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.delta-positive { color: var(--positive); }
.delta-neutral { color: var(--neutral); }
.delta-negative { color: var(--negative); }

/* Dashboard Sections */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Trends Chart Bars */
.trend-item {
  margin-bottom: 16px;
}

.trend-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

.trend-bar-bg {
  width: 100%;
  height: 10px;
  background-color: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
}

.trend-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.8s ease-in-out;
}

/* Sentiment Breakdown */
.sentiment-bar-container {
  display: flex;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.sent-fill-pos { background-color: var(--positive); }
.sent-fill-neu { background-color: var(--neutral); }
.sent-fill-neg { background-color: var(--negative); }

.sentiment-legend {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-top: 14px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Mentions Feed */
.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.filter-select, .search-input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.search-input {
  flex-grow: 1;
  min-width: 200px;
}

.search-input:focus, .filter-select:focus {
  border-color: var(--gold-primary);
}

.mentions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mention-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  transition: all 0.2s ease;
}

.mention-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.mention-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mention-author {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: #2a3147;
  color: var(--gold-light);
}

.mention-sentiment {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
}

.sentiment-positive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--positive);
  border: 1px solid var(--positive);
}

.sentiment-neutral {
  background: rgba(100, 116, 139, 0.15);
  color: var(--neutral);
  border: 1px solid var(--neutral);
}

.sentiment-negative {
  background: rgba(239, 68, 68, 0.15);
  color: var(--negative);
  border: 1px solid var(--negative);
}

.mention-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.mention-content {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.mention-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

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

.mention-link {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
}

.mention-link:hover {
  text-decoration: underline;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  border-top-color: #000;
  animation: spin 0.8s linear infinite;
}

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