/* Save Insights - Ocean Blue Theme with Dark Mode Support */

/* Color scheme declaration for browser compatibility */
:root {
  color-scheme: light dark;
}

/* ==================== LIGHT THEME (Default) ==================== */
:root {
  /* Primary Colors */
  --primary: #0066FF;
  --primary-hover: #0052CC;
  --primary-light: #E6F0FF;
  --accent: #00C2FF;
  --accent-gradient: linear-gradient(135deg, #0066FF 0%, #00C2FF 100%);

  /* Background Colors */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F7FA;
  --bg-tertiary: #EDF2F7;

  /* Text Colors */
  --text-primary: #1A202C;
  --text-secondary: #718096;
  --text-tertiary: #A0AEC0;

  /* Status Colors */
  --success: #38A169;
  --success-light: #E6F7EF;
  --warning: #DD6B20;
  --warning-light: #FEEBC8;
  --error: #E53E3E;
  --error-light: #FED7D7;

  /* UI Elements */
  --border: #E2E8F0;
  --border-focus: #0066FF;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);

  /* Spacing */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ==================== DARK THEME (Auto-detected from system) ==================== */
@media (prefers-color-scheme: dark) {
  :root {
    /* Primary Colors - slightly brighter for dark backgrounds */
    --primary: #3388FF;
    --primary-hover: #4499FF;
    --primary-light: rgba(51, 136, 255, 0.15);
    --accent: #00D4FF;
    --accent-gradient: linear-gradient(135deg, #0066FF 0%, #00C2FF 100%);

    /* Background Colors - dark grays */
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;

    /* Text Colors - light for contrast */
    --text-primary: #F5F5F5;
    --text-secondary: #A0A0A0;
    --text-tertiary: #6B6B6B;

    /* Status Colors - brighter for dark mode */
    --success: #34D399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #FBBF24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --error: #F87171;
    --error-light: rgba(248, 113, 113, 0.15);

    /* UI Elements */
    --border: #2E2E2E;
    --border-focus: #3388FF;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
  }
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { color: var(--text-secondary); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--primary-hover); }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==================== HEADER ==================== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-tertiary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  filter: brightness(0.9);
  color: white;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  filter: brightness(0.9);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

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

.btn-icon {
  padding: 0.5rem;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* ==================== STAT CARDS ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: rgba(124, 58, 237, 0.15); color: #A78BFA; }

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.stat-change {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--error); }

/* ==================== SECTION ==================== */
.section {
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==================== ACCOUNT CARDS ==================== */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.account-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  transition: box-shadow 0.2s ease;
}

.account-card:hover {
  box-shadow: var(--shadow-md);
}

.account-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  flex-shrink: 0;
}

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

.account-username {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.account-followers {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.account-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.account-status.active {
  background: var(--success-light);
  color: var(--success);
}

.account-status.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.account-status.error {
  background: var(--error-light);
  color: var(--error);
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.account-stat {
  text-align: center;
}

.account-stat-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.account-stat-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-actions {
  display: flex;
  gap: 0.5rem;
}

.account-actions .btn {
  flex: 1;
}

.account-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ==================== DATA TABLE ==================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-primary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.875rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

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

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

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

.table-post-caption {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 9999px;
}

.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--error-light); color: var(--error); }
.badge-gray { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-purple { background: rgba(124, 58, 237, 0.15); color: #A78BFA; }

/* ==================== ALERTS ==================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.alert-error {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid var(--error);
}

.alert-info {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* ==================== SPINNER ==================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==================== HERO (Landing Page) ==================== */
.hero {
  background: var(--accent-gradient);
  color: white;
  padding: 5rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero .btn-primary {
  background: white;
  color: var(--primary);
  font-size: 1.125rem;
  padding: 1rem 2rem;
}

.hero .btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-hover);
}

/* Features Grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 4rem 0;
}

.feature-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* ==================== FOOTER ==================== */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: var(--bg-primary);
}

/* ==================== EXPORT PAGE ==================== */
.export-page-content {
  max-width: 700px;
  margin: 0 auto;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.export-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.export-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.export-summary-item:last-child {
  border-bottom: none;
  font-weight: 600;
}

/* Compact horizontal export summary */
.export-summary-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.export-stat {
  white-space: nowrap;
}

.export-stat strong {
  color: var(--text-primary);
}

.export-stat-separator {
  color: var(--text-tertiary);
}

.whats-included-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .whats-included-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== SETTINGS PAGE ==================== */
.settings-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.settings-section-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
}

.settings-section-body {
  padding: 1.5rem;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item-label {
  font-weight: 500;
}

.settings-item-value {
  color: var(--text-secondary);
}

.danger-zone {
  border-color: var(--error);
}

.danger-zone .settings-section-header {
  background: var(--error-light);
  color: var(--error);
}

/* ==================== UTILITIES ==================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-tertiary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-content {
    height: 56px;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    text-align: center;
  }

  .nav-divider {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .user-info {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .export-options {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.8125rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.625rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

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

  .stat-card {
    flex-direction: row;
    align-items: center;
  }

  .account-actions {
    flex-direction: column;
  }

  .btn {
    min-height: 44px;
  }
}

/* ==================== INSIGHTS GRID ==================== */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.insight-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.insight-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.insight-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.insight-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.insight-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.insight-icon.purple {
  background: rgba(124, 58, 237, 0.15);
  color: #A78BFA;
}

.insight-content {
  flex: 1;
  min-width: 0;
}

.insight-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.insight-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==================== TREND INDICATORS ==================== */
.trend {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  margin-top: 0.375rem;
}

.trend-up {
  color: var(--success);
  background: var(--success-light);
}

.trend-down {
  color: var(--error);
  background: var(--error-light);
}

.trend-neutral {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

/* ==================== ACCOUNT BAR ==================== */
.account-bar {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.account-bar-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}

.account-bar-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.account-bar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.account-bar-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.account-bar-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.account-bar-username {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.account-bar-separator {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

.account-bar-followers {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.account-bar-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.25rem;
}

.account-bar-status.active {
  background: var(--success-light);
  color: var(--success);
}

.account-bar-status.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.account-bar-status.error {
  background: var(--error-light);
  color: var(--error);
}

.account-bar-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.account-bar-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.account-bar-meta .account-bar-separator {
  margin: 0 0.25rem;
}

.account-bar-actions {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

/* Responsive account bar */
@media (max-width: 900px) {
  .account-bar-meta {
    display: none;
  }
}

@media (max-width: 600px) {
  .account-bar-content {
    flex-wrap: wrap;
  }

  .account-bar-left {
    flex: 1 1 100%;
  }

  .account-bar-right {
    flex: 1 1 100%;
    justify-content: flex-end;
  }

  .account-bar-actions .btn {
    flex: 1;
  }
}

/* ==================== NO ACCOUNT CTA ==================== */
.no-account-cta {
  padding: 4rem 0;
  background: var(--bg-secondary);
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
}

.no-account-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 3rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.no-account-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.no-account-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.no-account-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ==================== SYNC OVERLAY ==================== */
.sync-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.sync-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.sync-modal {
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  padding: 3rem 4rem;
  text-align: center;
  max-width: 420px;
  box-shadow:
    0 25px 60px -15px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(59, 130, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sync-spinner {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.75rem;
  border: 3px solid rgba(59, 130, 246, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: sync-spin 0.8s linear infinite;
}

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

.sync-title {
  color: #f1f5f9;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.sync-status {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  min-height: 1.5em;
}

.sync-progress {
  height: 6px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.sync-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
  background-size: 200% 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sync-hint {
  color: #64748b;
  font-size: 0.8rem;
  margin: 0;
}

.sync-progress-bar.error {
  background: #ef4444;
  animation: none;
}

.sync-progress-bar.success {
  background: #22c55e;
  animation: none;
}

/* ==================== SYNC STATUS (Account Header) ==================== */

.sync-status-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-label {
  color: #64748b;
}
