/* Cliqk Analytics Dashboard - Professional Theme */
/* Purple theme from Cliqk logo */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  /* Cliqk Purple Theme - From logo */
  --primary-50: #faf5ff;
  --primary-100: #f3e8ff;
  --primary-200: #e9d5ff;
  --primary-300: #d8b4fe;
  --primary-400: #c084fc;
  --primary-500: #a855f7;
  --primary-600: #7C3AED;
  --primary-700: #6B21A8;
  --primary-800: #5B21B6;
  --primary-900: #4C1D95;

  /* Purple accent from logo */
  --brand-primary: #6B21A8;
  --brand-dark: #4C1D95;
  --brand-glow: rgba(124, 58, 237, 0.5);

  /* Neutrals */
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;

  /* Semantic */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 40px var(--brand-glow);

  /* Background colors */
  --bg-primary: #f8f8f8;
  --bg-card: white;
  --bg-input: white;
  --border-color: var(--gray-200);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    /* Inverted neutrals for dark mode */
    --gray-50: #18181b;
    --gray-100: #27272a;
    --gray-200: #3f3f46;
    --gray-300: #52525b;
    --gray-400: #71717a;
    --gray-500: #a1a1aa;
    --gray-600: #d4d4d8;
    --gray-700: #e4e4e7;
    --gray-800: #f4f4f5;
    --gray-900: #fafafa;

    /* Adjusted primary for dark mode */
    --primary-50: #2e1065;
    --primary-100: #3b0764;
    --primary-200: #4c1d95;
    --primary-300: #5b21b6;
    --primary-400: #7c3aed;
    --primary-500: #8b5cf6;
    --primary-600: #a78bfa;
    --primary-700: #c4b5fd;
    --primary-800: #ddd6fe;
    --primary-900: #ede9fe;

    /* Semantic colors for dark mode */
    --success: #34d399;
    --success-light: #064e3b;
    --warning: #fbbf24;
    --warning-light: #78350f;
    --danger: #f87171;
    --danger-light: #7f1d1d;

    /* Background colors */
    --bg-primary: #0a0a0a;
    --bg-card: #18181b;
    --bg-input: #27272a;
    --border-color: #3f3f46;

    /* Shadows for dark mode */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  }
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Layout */
.app {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--brand-dark) 0%, var(--brand-primary) 100%);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.nav-item svg {
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 12px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sheet-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.sheet-link:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Header */
.header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.last-updated {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
  display: block;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: #7C3AED;
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: #6B21A8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

.btn-primary.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .btn-loading { display: inline; }
.btn-primary .btn-loading { display: none; }

.btn-primary.loading .refresh-icon {
  animation: spin 1s linear infinite;
}

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

/* Sections */
.section {
  display: none;
  padding: 24px 32px;
}

.section.active {
  display: block;
}

/* Full width sections on desktop */
#sentiment .card,
#accounts .card {
  max-width: 100%;
  width: 100%;
}

#sentiment .sentiment-detail {
  width: 100%;
  display: block;
}

#sentiment .sentiment-overview-card {
  max-width: 100%;
  width: 100%;
}

/* Full width layout for sentiment content */
#sentiment .sentiment-scores-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
  width: 100%;
}

#sentiment .sentiment-posts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
}

#sentiment .sentiment-platform-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

#sentiment .sentiment-breakdown,
#sentiment .sentiment-why-score,
#sentiment .sentiment-insight {
  width: 100%;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.kpi-card.primary {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
  border: none;
  box-shadow: var(--shadow-md);
}

.kpi-card.primary .kpi-label,
.kpi-card.primary .kpi-value,
.kpi-card.primary .kpi-change {
  color: white;
}

.kpi-card.primary .kpi-label {
  opacity: 0.9;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -1px;
}

.kpi-change {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }
.kpi-change.neutral { color: var(--gray-500); }

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card.full-width {
  width: 100%;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.card-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

.card-body {
  padding: 20px 24px;
}

/* Performers List */
.performers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.performer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.performer-item:hover {
  background: var(--primary-50);
  transform: translateX(4px);
}

.performer-rank {
  width: 32px;
  height: 32px;
  background: var(--primary-600);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.performer-info {
  flex: 1;
}

.performer-handle {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 14px;
}

.performer-platform {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: capitalize;
}

.performer-stats {
  text-align: right;
}

.performer-impressions {
  font-weight: 700;
  color: var(--primary-600);
  font-size: 15px;
}

.performer-trend {
  font-size: 12px;
  font-weight: 600;
}

.performer-trend.positive { color: var(--success); }
.performer-trend.negative { color: var(--danger); }

/* Sentiment */
.sentiment-summary {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sentiment-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.sentiment-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}

.sentiment-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}

.sentiment-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.sentiment-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.sentiment-fill.positive { background: linear-gradient(90deg, var(--success), #34d399); }
.sentiment-fill.neutral { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.sentiment-fill.negative { background: linear-gradient(90deg, var(--danger), #f87171); }

/* Platform Grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.platform-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.platform-card:hover {
  background: var(--bg-card);
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.platform-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-icon svg {
  width: 24px;
  height: 24px;
}

.platform-icon.instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.platform-icon.tiktok { background: linear-gradient(135deg, #00f2ea, #ff0050); }
.platform-icon.youtube { background: #ff0000; }
.platform-icon.twitter { background: #14171a; }
.platform-icon.linkedin { background: #0a66c2; }
.platform-icon.reddit { background: #ff4500; }
.platform-icon.beehiiv { background: #f59e0b; }

.platform-info {
  flex: 1;
  min-width: 0;
}

.platform-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: capitalize;
  margin-bottom: 4px;
}

.platform-impressions {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.platform-metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: 0;
}

.platform-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.platform-accounts,
.platform-trend {
  font-size: 12px;
  color: var(--gray-500);
}

.platform-trend.positive { color: var(--success); font-weight: 600; }
.platform-trend.negative { color: var(--danger); font-weight: 600; }
.platform-trend.neutral { color: var(--gray-500); }

/* Clickable post cards in modal */
.post-card-link:hover {
  background: var(--primary-50) !important;
  border-color: var(--primary-300) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sentiment Breakdown Bars */
.sentiment-breakdown {
  margin: 20px 0;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 12px;
}

.sentiment-breakdown h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.sentiment-breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.breakdown-label {
  width: 70px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

.breakdown-bar-container {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.breakdown-bar.positive { background: var(--success); }
.breakdown-bar.neutral { background: var(--warning); }
.breakdown-bar.negative { background: var(--danger); }

.breakdown-count {
  width: 60px;
  font-size: 12px;
  color: var(--gray-500);
  text-align: right;
}

/* Why This Score Section */
.sentiment-why-score {
  margin: 20px 0;
  padding: 16px;
  background: var(--primary-50);
  border-radius: 12px;
  border-left: 4px solid var(--primary-500);
}

.sentiment-why-score h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-800);
  margin-bottom: 12px;
}

.sentiment-reasons-detailed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reason-detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.reason-check {
  color: var(--success);
  font-weight: bold;
}

.reason-detail-item .reason-text {
  flex: 1;
  color: var(--gray-700);
}

.reason-count {
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Recent Posts in Sentiment */
.sentiment-recent-posts {
  margin: 20px 0;
}

.sentiment-recent-posts h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

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

.sentiment-post-card {
  display: block;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  text-decoration: none;
  transition: all 0.2s ease;
}

.sentiment-post-card:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sentiment-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.sentiment-post-handle {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.sentiment-post-score {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: auto;
}

.sentiment-post-score.positive {
  background: var(--success-light);
  color: var(--success);
}

.sentiment-post-score.neutral {
  background: var(--warning-light);
  color: var(--warning);
}

.sentiment-post-score.negative {
  background: var(--danger-light);
  color: var(--danger);
}

.sentiment-post-content {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.sentiment-post-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.reason-tag {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 4px;
}

.sentiment-post-cta {
  font-size: 12px;
  color: var(--primary-600);
  font-weight: 500;
}

/* Platform Sentiment Badge */
.platform-sentiment-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.platform-sentiment-badge.positive {
  background: var(--success-light);
  color: var(--success);
}

.platform-sentiment-badge.neutral {
  background: var(--warning-light);
  color: var(--warning);
}

.platform-sentiment-badge.negative {
  background: var(--danger-light);
  color: var(--danger);
}

/* Example Post Why Section */
.example-post-why {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
  line-height: 1.5;
}

.example-post-why strong {
  color: var(--gray-700);
}

/* Clickable table rows */
.clickable-row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-row:hover {
  background: var(--primary-50) !important;
}

.clickable-row:hover td {
  color: var(--primary-700);
}

.clickable-row:active {
  background: var(--primary-100) !important;
}

/* Clickable cards */
.clickable-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-card:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.click-hint {
  font-size: 12px;
  color: var(--primary-600);
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.clickable-card:hover .click-hint {
  opacity: 1;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--gray-200);
  background: var(--bg-card);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--primary-300);
  color: var(--primary-600);
}

.filter-tab.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
}

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

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--gray-50);
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

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

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

.platform-badge.instagram { background: rgba(221,42,123,0.1); color: #dd2a7b; }
.platform-badge.tiktok { background: linear-gradient(135deg, rgba(0,242,234,0.2), rgba(255,0,80,0.2)); color: #ff0050; }
.platform-badge.youtube { background: rgba(255,0,0,0.1); color: #ff0000; }
.platform-badge.twitter { background: #14171a; color: #fff; }
.platform-badge.linkedin { background: rgba(10,102,194,0.1); color: #0a66c2; }
.platform-badge.reddit { background: rgba(255,69,0,0.1); color: #ff4500; }
.platform-badge.beehiiv { background: rgba(245,158,11,0.15); color: #b45309; }

.view-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--gray-200);
  background: var(--bg-card);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover {
  border-color: var(--primary-400);
  color: var(--primary-600);
  background: var(--primary-50);
}

/* Mobile handle - hidden on desktop */
.mobile-handle {
  display: none;
  margin-left: 10px;
  font-size: 14px;
  color: var(--gray-900);
}

/* Video Analysis */
.video-analysis-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-analysis-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.video-analysis-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.video-analysis-header:hover {
  background: var(--gray-100);
}

.video-account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-handle {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 15px;
}

.video-platform-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.video-platform-tag.tiktok { background: linear-gradient(135deg, rgba(0,242,234,0.2), rgba(255,0,80,0.2)); color: #ff0050; }
.video-platform-tag.instagram { background: rgba(221,42,123,0.1); color: #dd2a7b; }

.video-count {
  font-size: 12px;
  color: var(--gray-500);
}

.video-scores {
  display: flex;
  gap: 24px;
}

.video-score {
  text-align: center;
}

.video-score-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.video-score-value {
  font-size: 18px;
  font-weight: 800;
}

.video-score-value.high { color: var(--success); }
.video-score-value.medium { color: var(--warning); }
.video-score-value.low { color: var(--danger); }

.expand-icon {
  color: var(--gray-400);
  transition: transform 0.2s;
}

.video-analysis-card.expanded .expand-icon {
  transform: rotate(180deg);
}

.video-analysis-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--gray-200);
}

.video-analysis-card.expanded .video-analysis-body {
  display: block;
}

.video-insights {
  padding-top: 16px;
}

.video-insight-item {
  margin-bottom: 16px;
}

.video-insight-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.video-insight-text {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}

.video-tips {
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
  border-left: 3px solid var(--primary-500);
}

.video-tips-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-600);
  margin-bottom: 4px;
}

.video-tips-text {
  font-size: 13px;
  color: var(--primary-700);
}

/* Sentiment Detail */
.sentiment-detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.sentiment-detail-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 20px;
}

.sentiment-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sentiment-detail-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 14px;
}

.sentiment-detail-score {
  font-size: 24px;
  font-weight: 800;
}

.sentiment-detail-score.positive { color: var(--success); }
.sentiment-detail-score.neutral { color: var(--warning); }
.sentiment-detail-score.negative { color: var(--danger); }

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* Scraper Progress Overlay */
.scraper-progress-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.scraper-progress-overlay.show {
  display: flex;
}

.scraper-progress-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.scraper-progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.scraper-progress-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.scraper-spinner {
  color: var(--primary-600);
  animation: spin 1s linear infinite;
}

.scraper-progress-status {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.scraper-progress-bar-container {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.scraper-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

.scraper-progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

#scraperPercent {
  font-weight: 600;
  color: var(--primary-600);
}

.scraper-progress-platforms {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.platform-progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.platform-progress-name {
  font-weight: 500;
  color: var(--gray-700);
}

.platform-progress-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.platform-progress-status.pending {
  background: var(--gray-200);
  color: var(--gray-500);
}

.platform-progress-status.running {
  background: var(--primary-100);
  color: var(--primary-700);
}

.platform-progress-status.done {
  background: var(--success-light);
  color: var(--success);
}

.platform-progress-status.error {
  background: var(--danger-light);
  color: var(--danger);
}

/* Sentiment Detail Styles */
.sentiment-overview-card {
  background: var(--bg-card);
  padding: 0;
  width: 100%;
}

.sentiment-scores-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
  width: 100%;
}

.sentiment-score-box {
  text-align: center;
  padding: 20px 16px;
  background: var(--gray-100);
  border-radius: 12px;
}

.sentiment-score-value {
  font-size: 32px;
  font-weight: 800;
}

.sentiment-score-value.positive { color: var(--success); }
.sentiment-score-value.neutral { color: var(--warning); }
.sentiment-score-value.negative { color: var(--danger); }

.sentiment-score-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-top: 4px;
}

.sentiment-score-sublabel {
  font-size: 12px;
  color: var(--gray-500);
}

.sentiment-score-meta {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
}

.sentiment-insight {
  margin-bottom: 20px;
}

.sentiment-insight h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sentiment-insight p {
  padding: 14px;
  background: var(--primary-50);
  border-radius: 8px;
  border-left: 3px solid var(--primary-500);
  font-size: 13px;
  color: var(--primary-800);
  line-height: 1.6;
  margin: 0;
}

.sentiment-platforms h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.sentiment-platform-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

.sentiment-platform-card {
  display: flex;
  align-items: center;
  padding: 18px 24px;
  background: var(--bg-card);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--gray-200);
  gap: 20px;
  overflow: visible;
  position: relative;
}

/* Platform-specific left border accents */
.sentiment-platform-card.instagram { border-left: 4px solid #dd2a7b; }
.sentiment-platform-card.tiktok { border-left: 4px solid #ff0050; }
.sentiment-platform-card.youtube { border-left: 4px solid #ff0000; }
.sentiment-platform-card.twitter { border-left: 4px solid #1d9bf0; }
.sentiment-platform-card.linkedin { border-left: 4px solid #0a66c2; }
.sentiment-platform-card.reddit { border-left: 4px solid #ff4500; }
.sentiment-platform-card.beehiiv { border-left: 4px solid #f59e0b; }

.sentiment-platform-card:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sentiment-platform-card:active {
  transform: translateY(0);
}

.platform-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 120px;
  max-width: 160px;
  flex-shrink: 0;
}

.platform-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-card-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.platform-card-icon.instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.platform-card-icon.tiktok { background: linear-gradient(135deg, #00f2ea, #ff0050); }
.platform-card-icon.youtube { background: #ff0000; }
.platform-card-icon.twitter { background: #000; }
.platform-card-icon.linkedin { background: #0a66c2; }
.platform-card-icon.reddit { background: #ff4500; }
.platform-card-icon.beehiiv { background: linear-gradient(135deg, #f59e0b, #d97706); }

.platform-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.platform-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}

.platform-card-accounts {
  font-size: 12px;
  color: var(--gray-500);
}

.platform-card-stats {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.platform-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 65px;
}

.platform-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
}

.platform-stat-value.positive { color: var(--success); }
.platform-stat-value.neutral { color: var(--warning); }
.platform-stat-value.negative { color: var(--danger); }

.platform-stat-label {
  font-size: 10px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.platform-card-arrow {
  color: var(--gray-400);
  flex-shrink: 0;
  margin-left: 8px;
}

.platform-card-arrow svg {
  transition: transform 0.2s ease;
}

.sentiment-platform-card:hover .platform-card-arrow svg {
  transform: translateX(4px);
}

/* Platform Sentiment Modal */
.platform-sentiment-modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.platform-sentiment-header {
  display: flex;
  align-items: center;
}

.platform-sentiment-overview {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 12px;
}

.platform-sentiment-score {
  text-align: center;
}

.score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
}

.score-circle.positive { background: var(--success); }
.score-circle.neutral { background: var(--warning); }
.score-circle.negative { background: var(--danger); }

.score-label {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 6px;
  font-weight: 500;
}

.platform-sentiment-metrics {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.metric-label {
  color: var(--gray-500);
}

.metric-value {
  font-weight: 600;
  color: var(--gray-900);
}

.platform-sentiment-analysis h4,
.platform-sentiment-examples h4,
.platform-sentiment-accounts h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.platform-sentiment-analysis p {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0;
}

.example-posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.example-post {
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
  border-left: 3px solid var(--primary-400);
}

.example-post-handle {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-600);
  margin-bottom: 4px;
}

.example-post-caption {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}

.accounts-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-mini-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 20px;
  font-size: 12px;
}

.account-handle {
  font-weight: 600;
  color: var(--gray-700);
}

.account-impressions {
  color: var(--gray-500);
}

/* Loading State */
.loading-state {
  padding: 40px;
  text-align: center;
  color: var(--gray-500);
}

/* Empty State */
.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--gray-400);
}

/* Data Range Banner */
.data-range {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-range-label {
  font-size: 13px;
  color: var(--primary-800);
  font-weight: 500;
}

.data-range-dates {
  font-size: 13px;
  color: var(--primary-700);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 72px;
  }

  .sidebar-header {
    justify-content: center;
    padding: 16px;
  }

  .logo-text {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 14px;
  }

  .nav-item span:not(.nav-icon) {
    display: none;
  }

  .sidebar-footer .sheet-link span {
    display: none;
  }

  .main-content {
    margin-left: 72px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Hide desktop sidebar, show mobile nav */
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 20px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Mobile Header */
  .header {
    padding: 0 12px;
    height: 56px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
  }

  .main-content {
    padding-top: 56px;
  }

  .header-title h1 {
    font-size: 16px;
  }

  .last-updated {
    font-size: 11px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .btn-text {
    display: none;
  }

  .btn .refresh-icon {
    margin: 0;
  }

  /* Sections */
  .section {
    padding: 12px;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
  }

  /* Cards on mobile */
  .card {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .card.full-width {
    width: 100%;
    min-height: auto;
  }

  /* Video Analysis section full height */
  #video-analysis .card,
  #sentiment .card,
  #accounts .card {
    min-height: calc(100vh - 84px);
  }

  #video-analysis .card-body,
  #sentiment .card-body,
  #accounts .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .video-analysis-list {
    flex: 1;
    overflow-y: auto;
  }

  /* KPI Grid - 2 columns on mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-label {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-change {
    font-size: 11px;
    margin-top: 4px;
  }

  /* Stats Row */
  .stats-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Cards */
  .card {
    border-radius: var(--radius-md);
  }

  .card-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-header h2 {
    font-size: 14px;
  }

  .card-subtitle {
    font-size: 12px;
  }

  .card-body {
    padding: 14px 16px;
  }

  /* Performers List */
  .performer-item {
    padding: 10px 12px;
    gap: 12px;
  }

  .performer-rank {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .performer-handle {
    font-size: 13px;
  }

  .performer-platform {
    font-size: 11px;
  }

  .performer-impressions {
    font-size: 13px;
  }

  /* Sentiment */
  .sentiment-summary {
    gap: 16px;
  }

  .sentiment-label,
  .sentiment-value {
    font-size: 12px;
  }

  /* Platform Grid */
  .platform-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .platform-card {
    padding: 14px;
  }

  .platform-icon {
    width: 40px;
    height: 40px;
  }

  .platform-icon svg {
    width: 20px;
    height: 20px;
  }

  .platform-name {
    font-size: 11px;
  }

  .platform-impressions {
    font-size: 18px;
  }

  .platform-meta {
    gap: 8px;
  }

  .platform-accounts,
  .platform-trend {
    font-size: 11px;
  }

  /* Filter Tabs - Scrollable */
  .card-header {
    overflow: visible;
  }

  .filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    width: calc(100% + 24px);
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Data Table - Compact Card Layout on Mobile */
  .table-container {
    margin: 0;
    padding: 0;
    overflow: visible;
    width: 100%;
  }

  .data-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .data-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1px solid var(--gray-200);
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .data-table tbody tr:hover {
    background: var(--gray-100);
  }

  .data-table td {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    min-width: 0;
    word-wrap: break-word;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--gray-500);
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  /* First cell (platform + handle) - spans full width */
  .data-table td:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
  }

  .data-table td:first-child::before {
    display: none;
  }

  /* Hide the standalone handle row on mobile */
  .data-table td[data-label="Handle"] {
    display: none;
  }

  /* Hide updated column on small phones */
  .data-table td[data-label="Updated"] {
    display: none;
  }

  /* Last cell (view button) - spans full width */
  .data-table td:last-child {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--gray-200);
  }

  .data-table td:last-child::before {
    display: none;
  }

  .platform-badge {
    padding: 4px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }

  /* Show mobile handle */
  .mobile-handle {
    display: inline;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .view-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: var(--radius-md);
  }

  .view-btn:hover,
  .view-btn:active {
    background: var(--primary-700);
  }

  /* Fix card body padding on mobile */
  .card-body {
    padding: 12px;
  }

  /* Video Analysis */
  .video-analysis-card {
    border-radius: var(--radius-md);
  }

  .video-analysis-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .video-account {
    width: 100%;
    justify-content: space-between;
  }

  .video-handle {
    font-size: 13px;
  }

  .video-platform-tag {
    font-size: 10px;
  }

  .video-scores {
    width: 100%;
    justify-content: flex-start;
    gap: 20px;
  }

  .video-score-label {
    font-size: 10px;
  }

  .video-score-value {
    font-size: 16px;
  }

  .expand-icon {
    position: absolute;
    right: 14px;
    top: 14px;
  }

  .video-analysis-body {
    padding: 0 14px 14px;
  }

  .video-insight-label {
    font-size: 11px;
  }

  .video-insight-text {
    font-size: 13px;
  }

  .video-tips {
    padding: 10px 12px;
  }

  .video-tips-title {
    font-size: 11px;
  }

  .video-tips-text {
    font-size: 12px;
  }

  /* Sentiment Detail */
  .sentiment-detail {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sentiment-detail-card {
    padding: 16px;
  }

  .sentiment-detail-title {
    font-size: 13px;
  }

  .sentiment-detail-score {
    font-size: 20px;
  }

  /* Platform cards mobile */
  .sentiment-platform-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sentiment-platform-card {
    padding: 14px 16px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .platform-card-left {
    min-width: 100px;
    max-width: 130px;
    flex-shrink: 0;
  }

  .platform-card-icon {
    width: 36px;
    height: 36px;
  }

  .platform-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .platform-card-name {
    font-size: 13px;
  }

  .platform-card-accounts {
    font-size: 11px;
  }

  .platform-card-stats {
    gap: 12px;
    margin-left: auto;
  }

  .platform-stat-item {
    min-width: 40px;
  }

  .platform-stat-value {
    font-size: 14px;
  }

  .platform-stat-label {
    font-size: 9px;
  }

  .platform-card-arrow {
    margin-left: 4px;
  }

  .platform-card-arrow svg {
    width: 16px;
    height: 16px;
  }

  /* Modal - Full Screen on Mobile */
  .modal {
    align-items: flex-end;
  }

  .modal.open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
  }

  .modal-backdrop {
    background: rgba(0,0,0,0.9);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    overflow: hidden;
  }

  .modal-header {
    padding: 12px 16px;
    background: var(--bg-card);
    z-index: 10;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    padding-right: 0;
    flex: 1;
  }

  .modal-close {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    flex-shrink: 0;
  }

  .modal-close:hover {
    background: var(--gray-200);
  }

  .modal-body {
    padding: 16px;
    padding-bottom: 80px;
    flex: 1;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    height: calc(100vh - 56px) !important;
    max-height: calc(100vh - 56px) !important;
  }

  /* Data Range */
  .data-range {
    padding: 10px 14px;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .data-range-label,
  .data-range-dates {
    font-size: 12px;
  }

  /* Toast */
  .toast {
    left: 16px;
    right: 16px;
    bottom: 24px;
    width: auto;
  }
}

/* Hamburger Button - Hidden on Desktop */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--gray-700);
  border-radius: var(--radius-sm);
}

.hamburger-btn:hover {
  background: var(--gray-100);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85%;
  height: 100%;
  background: var(--bg-card);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-menu-overlay.open .mobile-menu {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-primary) 100%);
}

.mobile-menu-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.mobile-menu-title {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.mobile-menu-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: white;
  border-radius: var(--radius-sm);
}

.mobile-menu-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.mobile-menu-item:hover {
  background: var(--gray-100);
}

.mobile-menu-item.active {
  background: var(--primary-50);
  color: var(--primary-700);
}

.mobile-menu-item.active svg {
  stroke: var(--primary-700);
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

  .mobile-menu-overlay {
    display: block;
  }

  .main-content {
    padding-bottom: 20px;
  }
}

/* Extra Small Screens */
@media (max-width: 380px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .header-title h1 {
    font-size: 14px;
  }
}

/* Dark Mode Specific Overrides */
@media (prefers-color-scheme: dark) {
  /* Header */
  .header {
    background: var(--bg-card);
    border-bottom-color: var(--border-color);
  }

  /* Cards */
  .card {
    background: var(--bg-card);
    border-color: var(--border-color);
  }

  .card-header {
    border-bottom-color: var(--border-color);
  }

  /* KPI Cards */
  .kpi-card {
    background: var(--bg-card);
    border-color: var(--border-color);
  }

  .kpi-card.primary {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-primary) 100%);
  }

  /* Buttons - Keep consistent purple in both modes */
  .btn-primary {
    background: #7C3AED;
  }

  .btn-primary:hover {
    background: #6B21A8;
  }

  /* Filter tabs */
  .filter-tab {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--gray-600);
  }

  .filter-tab:hover {
    border-color: var(--primary-400);
    color: var(--primary-500);
  }

  .filter-tab.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
  }

  /* Table */
  .data-table th {
    background: var(--gray-100);
    color: var(--gray-600);
  }

  .data-table tbody tr:hover {
    background: var(--gray-100);
  }

  .data-table td {
    border-bottom-color: var(--border-color);
  }

  /* Data table cards on mobile */
  .data-table tbody tr {
    background: var(--gray-100);
    border-color: var(--border-color);
  }

  /* View button */
  .view-btn {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--gray-600);
  }

  .view-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
    color: var(--primary-500);
  }

  /* Performer items */
  .performer-item {
    background: var(--gray-100);
  }

  .performer-item:hover {
    background: var(--primary-50);
  }

  .performer-rank {
    background: var(--primary-600);
  }

  .performer-impressions {
    color: var(--primary-500);
  }

  /* Platform cards */
  .platform-card {
    background: var(--gray-100);
  }

  .platform-card:hover {
    background: var(--bg-card);
    border-color: var(--primary-400);
  }

  /* Sentiment bars */
  .sentiment-bar {
    background: var(--gray-200);
  }

  /* Video analysis */
  .video-analysis-card {
    background: var(--gray-100);
    border-color: var(--border-color);
  }

  .video-analysis-header:hover {
    background: var(--gray-200);
  }

  .video-analysis-body {
    border-top-color: var(--border-color);
  }

  /* Sentiment detail */
  .sentiment-detail-card {
    background: var(--gray-100);
  }

  /* Modal */
  .modal-content {
    background: var(--bg-card);
  }

  .modal-header {
    background: var(--bg-card);
    border-bottom-color: var(--border-color);
  }

  .modal-backdrop {
    background: rgba(0,0,0,0.7);
  }

  /* Mobile menu */
  .mobile-menu {
    background: var(--bg-card);
  }

  .mobile-menu-item {
    color: var(--gray-700);
  }

  .mobile-menu-item:hover {
    background: var(--gray-100);
  }

  .mobile-menu-item.active {
    background: var(--primary-50);
    color: var(--primary-500);
  }

  /* Scraper progress */
  .scraper-progress-modal {
    background: var(--bg-card);
  }

  .scraper-progress-bar-container {
    background: var(--gray-200);
  }

  .platform-progress-item {
    background: var(--gray-100);
  }

  /* Toast */
  .toast {
    background: var(--gray-100);
    color: var(--gray-900);
  }

  /* Platform badges - keep their colors with proper contrast */
  .platform-badge.instagram { background: rgba(221,42,123,0.2); color: #f472b6; }
  .platform-badge.tiktok { background: linear-gradient(135deg, rgba(0,242,234,0.2), rgba(255,0,80,0.2)); color: #ff0050; }
  .platform-badge.youtube { background: rgba(255,0,0,0.2); color: #f87171; }
  .platform-badge.twitter { background: #1d1d1d; color: #fff; }
  .platform-badge.linkedin { background: rgba(10,102,194,0.2); color: #60a5fa; }
  .platform-badge.reddit { background: rgba(255,69,0,0.2); color: #fb923c; }
  .platform-badge.beehiiv { background: rgba(245,158,11,0.2); color: #fbbf24; }

  /* Hamburger button */
  .hamburger-btn {
    color: var(--gray-700);
  }

  .hamburger-btn:hover {
    background: var(--gray-100);
  }

  /* Input/select elements */
  input, select, textarea {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--gray-900);
  }

  /* Video platform tags */
  .video-platform-tag.tiktok { background: linear-gradient(135deg, rgba(0,242,234,0.2), rgba(255,0,80,0.2)); color: #ff0050; }
  .video-platform-tag.instagram { background: rgba(221,42,123,0.2); color: #f472b6; }
  .video-platform-tag.youtube { background: rgba(255,0,0,0.2); color: #f87171; }
  .video-platform-tag.twitter { background: #1d1d1d; color: #fff; }

  /* Sentiment result boxes - ensure text is readable */
  .sentiment-result-box {
    background: var(--gray-100);
  }

  .sentiment-result-box.positive {
    background: rgba(16, 185, 129, 0.15);
  }

  .sentiment-result-box.neutral {
    background: rgba(245, 158, 11, 0.15);
  }

  .sentiment-result-box.negative {
    background: rgba(239, 68, 68, 0.15);
  }

  .sentiment-reasons-box {
    background: var(--gray-100);
    border-color: var(--border-color);
  }

  .sentiment-reasons-box h4 {
    color: var(--gray-800);
  }

  .reason-text {
    color: var(--gray-600);
  }

  .post-content-box {
    background: var(--gray-100);
    border-color: var(--border-color);
  }

  .post-content-text {
    color: var(--gray-800);
  }

  /* Sentiment post cards */
  .sentiment-post-card {
    background: var(--gray-100);
    border-color: var(--border-color);
  }

  .sentiment-post-card:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
  }

  /* Example posts */
  .example-post {
    background: var(--gray-100);
  }

  .example-post-caption {
    color: var(--gray-600);
  }

  /* Platform cards in dark mode */
  .sentiment-platform-card {
    background: var(--gray-100);
    border-color: var(--border-color);
  }

  .sentiment-platform-card:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
  }

  .platform-card-icon.twitter {
    background: #fff;
  }

  .platform-card-icon.twitter svg {
    color: #000;
  }
}

/* ===== Clickable Posts Sentiment Analysis ===== */

/* Clickable post styling */
.clickable-post {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
  display: block;
  color: inherit;
}

.clickable-post:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.clickable-post:hover .example-post-hint {
  color: var(--primary-700);
}

.example-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.example-post-score {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.example-post-score.positive {
  background: var(--success-light);
  color: var(--success);
}

.example-post-score.neutral {
  background: var(--warning-light);
  color: var(--warning);
}

.example-post-score.negative {
  background: var(--danger-light);
  color: var(--danger);
}

.example-post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}

.example-post-hint {
  font-size: 11px;
  color: var(--primary-500);
  font-weight: 500;
  opacity: 0.8;
}

.clickable-post:hover .example-post-hint {
  opacity: 1;
}

.example-post-link {
  font-size: 12px;
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--primary-50);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.example-post-link:hover {
  background: var(--primary-100);
  color: var(--primary-700);
}

/* Post Sentiment Detail Modal */
.post-sentiment-detail {
  padding: 4px 0;
}

.post-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.post-handle {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}

.post-content-box {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--gray-200);
}

.post-content-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.post-content-text {
  font-size: 14px;
  color: var(--gray-800);
  line-height: 1.7;
  white-space: pre-wrap;
}

.sentiment-result-box {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--gray-300);
}

.sentiment-result-box.positive {
  background: var(--success-light);
  border-left-color: var(--success);
}

.sentiment-result-box.neutral {
  background: var(--warning-light);
  border-left-color: var(--warning);
}

.sentiment-result-box.negative {
  background: var(--danger-light);
  border-left-color: var(--danger);
}

.sentiment-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sentiment-result-score {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
}

.sentiment-result-box.positive .sentiment-result-score { color: var(--success); }
.sentiment-result-box.neutral .sentiment-result-score { color: var(--warning); }
.sentiment-result-box.negative .sentiment-result-score { color: var(--danger); }

.sentiment-result-percent {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
}

.sentiment-meter {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.sentiment-meter-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(to right, var(--danger), var(--warning), var(--success));
  transition: width 0.5s ease;
}

.sentiment-meter-marker {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: white;
  border: 3px solid var(--primary-600);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: var(--shadow-md);
}

.sentiment-meter-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--gray-500);
}

.sentiment-reasons-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.sentiment-reasons-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

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

.sentiment-reason-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.reason-number {
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.reason-text {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.5;
  flex: 1;
}

.sentiment-tips-box {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.sentiment-tips-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-800);
  margin-bottom: 12px;
}

.sentiment-tips-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--primary-700);
  line-height: 1.7;
}

.sentiment-tips-list li {
  margin-bottom: 8px;
}

.sentiment-tips-list li:last-child {
  margin-bottom: 0;
}

.back-to-platform-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-to-platform-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.post-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.view-on-platform-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--primary-600);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.view-on-platform-btn:hover {
  background: var(--primary-700);
}

/* Mobile adjustments for sentiment detail */
@media (max-width: 768px) {
  .sentiment-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .sentiment-result-score {
    font-size: 20px;
  }

  .post-content-text {
    font-size: 13px;
  }

  .sentiment-reasons-box,
  .sentiment-tips-box {
    padding: 16px;
  }

  .back-to-platform-btn {
    width: 100%;
    justify-content: center;
  }
}
