:root {
  --bg-dark: #080a0f;
  --bg-surface: rgba(16, 22, 34, 0.75);
  --bg-card: rgba(22, 30, 46, 0.65);
  --bg-card-hover: rgba(28, 38, 58, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.45);
  --border-accent: rgba(99, 102, 241, 0.25);

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

  --accent-primary: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;

  --brand-yt: #ff0000;
  --brand-ig: #e1306c;
  --brand-fb: #1877f2;
  --brand-th: #ffffff;
  --brand-tt: #00f2fe;
  --brand-x: #1da1f2;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Ambient Lighting Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
}

.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -120px;
  left: 10%;
}

.glow-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
  top: 30%;
  right: -150px;
}

.glow-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: 5%;
  left: 20%;
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 16px 36px -10px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.logo-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-text h1 span {
  background: linear-gradient(90deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.status-live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Platform Filter Bar */
.platform-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
}

.platform-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.platform-pill.active {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.yt-dot { background: var(--brand-yt); box-shadow: 0 0 8px rgba(255, 0, 0, 0.6); }
.ig-dot { background: var(--brand-ig); box-shadow: 0 0 8px rgba(225, 48, 108, 0.6); }
.fb-dot { background: var(--brand-fb); box-shadow: 0 0 8px rgba(24, 119, 242, 0.6); }
.th-dot { background: var(--brand-th); box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
.tt-dot { background: var(--brand-tt); box-shadow: 0 0 8px rgba(0, 242, 254, 0.6); }
.x-dot { background: var(--brand-x); box-shadow: 0 0 8px rgba(29, 161, 242, 0.6); }

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.period-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.period-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.period-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.refresh-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.refresh-action-btn:hover {
  color: #fff;
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.15);
}

/* Main Content Layout */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  z-index: 10;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.kpi-card {
  padding: 22px;
}

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

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.trend-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
}

.trend-badge.positive {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.trend-badge.premium {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.highlight-gold {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-subtext {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.sub-highlight {
  color: #a5b4fc;
  font-weight: 600;
}

.progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 1s ease-in-out;
}
.fill-purple { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.fill-cyan { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.fill-gold { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* Charts Layout */
.charts-row, .strategy-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 1080px) {
  .charts-row, .strategy-row {
    grid-template-columns: 1fr;
  }
}

.chart-box, .strategy-box {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.chart-header, .strategy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-header h3, .strategy-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-header p, .strategy-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
}

.donut-wrapper {
  height: 230px;
}

.share-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.share-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

/* Heatmap Grid */
.heatmap-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.heatmap-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.heatmap-day-label {
  width: 38px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.heatmap-cells {
  display: flex;
  gap: 4px;
  flex: 1;
}

.heatmap-cell {
  flex: 1;
  height: 26px;
  min-width: 18px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  position: relative;
}

.heatmap-cell:hover {
  transform: scale(1.2);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-gradient {
  width: 100px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), #6366f1 40%, #f59e0b 75%, #ef4444 100%);
}

.heatmap-tip-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12px;
  color: #fde68a;
  line-height: 1.5;
}

/* Milestones List */
.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.milestone-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.milestone-item.active-target {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
}

.milestone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.milestone-eta {
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}

.milestone-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.milestone-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #3b82f6);
  border-radius: 4px;
}

.milestone-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* Ranking Table Section */
.ranking-section {
  padding: 24px;
}

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

.ranking-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.ranking-filters {
  display: flex;
  gap: 6px;
}

.rank-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.rank-filter-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.ranking-table th {
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ranking-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.ranking-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.post-title-cell {
  font-weight: 600;
  color: #f1f5f9;
  max-width: 320px;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.badge-yt { background: rgba(255, 0, 0, 0.15); color: #ff6b6b; border: 1px solid rgba(255, 0, 0, 0.3); }
.badge-ig { background: rgba(225, 48, 108, 0.15); color: #ff75a0; border: 1px solid rgba(225, 48, 108, 0.3); }
.badge-fb { background: rgba(24, 119, 242, 0.15); color: #70b4ff; border: 1px solid rgba(24, 119, 242, 0.3); }
.badge-th { background: rgba(255, 255, 255, 0.12); color: #f8fafc; border: 1px solid rgba(255, 255, 255, 0.2); }

.metric-highlight {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #38bdf8;
}

.eng-rate-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

/* Footer */
.app-footer {
  margin-top: 40px;
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-muted);
/* Chart Metric Toggle */
.chart-actions-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-toggle-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.metric-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.metric-toggle-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Follower Growth Section */
.growth-section {
  padding: 24px;
  margin-top: 24px;
}

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

.growth-title-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.growth-title-box h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.growth-title-box p {
  font-size: 12px;
  color: var(--text-muted);
}

.growth-icon-glow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  color: #34d399;
}

.growth-total-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.growth-total-val {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: #34d399;
  letter-spacing: -0.5px;
}

.growth-total-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.growth-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.growth-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  transition: var(--transition-smooth);
}

.growth-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.growth-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.growth-channel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.growth-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-fire { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

.growth-number {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.growth-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.growth-pct {
  font-weight: 700;
  color: #34d399;
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .charts-row, .strategy-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .header-container {
    flex-wrap: wrap;
    gap: 16px;
  }
  .platform-bar {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 12px 16px;
  }
  .main-content {
    padding: 16px;
  }
  .brand-text h1 {
    font-size: 18px;
  }
  .status-live-pill {
    display: none;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  .period-selector {
    overflow-x: auto;
  }
  .period-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi-value {
    font-size: 28px;
  }
  .chart-box, .strategy-box, .ranking-section {
    padding: 16px;
  }
}

