/* =====================================================
   OpportunityIQ - Design System & Styles
   ===================================================== */

:root {
  --bg-primary: #05110F;
  --bg-secondary: #081815;
  --bg-tertiary: #0C211D;
  --bg-card: #0A1715;
  --bg-card-hover: #0E201D;
  --bg-sidebar: rgba(12, 33, 29, 0.98);
  --border: rgba(52, 211, 153, 0.08);
  --border-glow: rgba(52, 211, 153, 0.25);

  --text-primary: #ecfdf5;
  --text-secondary: #86a89a;
  --text-muted: #4a6358;

  --emerald: #34D399;
  --emerald-soft: #6EE7B7;

  --accent-blue: #34D399;
  --accent-purple: #6EE7B7;
  --accent-green: #10B981;
  --accent-orange: #F59E0B;
  --accent-red: #EF4444;
  --accent-pink: #EC4899;
  --accent-teal: #14B8A6;

  --gradient-hero: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  --gradient-card: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.05) 100%);
  --gradient-green: linear-gradient(135deg, #68d391, #38a169);
  --gradient-orange: linear-gradient(135deg, #fbd38d, #ed8936);
  --gradient-blue: linear-gradient(135deg, #34d399, #10b981);
  --gradient-purple: linear-gradient(135deg, #6ee7b7, #34d399);
  --gradient-pink: linear-gradient(135deg, #f687b3, #ed64a6);
  --gradient-teal: linear-gradient(135deg, #4fd1c5, #38b2ac);

  --sidebar-width: 280px;
  --header-height: 80px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.15);

  --font: 'Geist', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --banner-height: 0px;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  line-height: 1.6;
  padding-top: var(--banner-height);
  transition: padding-top 0.3s ease;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #059669, #064e3b);
  top: -150px; left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #10b981, #0d9488);
  top: 30%; right: -100px;
  animation-delay: -4s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #34d399, #059669);
  bottom: -100px; left: 35%;
  animation-delay: -8s;
}

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

/* ===== APP SHELL ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(13, 23, 21, 0.98);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  transform: translateX(-100%);
  top: var(--banner-height);
  height: calc(100vh - var(--banner-height));
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 9999;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(99, 179, 237, 0.6));
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.sidebar-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  transition: all 0.2s;
}
.sidebar-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-green);
}

.sidebar-section {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-search-input {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.source-search-input:focus {
  border-color: var(--accent-blue);
}

/* Status card */
.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse 2s infinite;
}

.status-dot.pending {
  background: var(--accent-orange);
  box-shadow: 0 0 6px var(--accent-orange);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.last-scan {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* Source count badge */
.source-count {
  background: var(--gradient-blue);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

/* Source list */
.source-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 20px;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.source-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.source-item.active {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(99, 179, 237, 0.15);
}

.source-item.new-source {
  border-color: rgba(104, 211, 145, 0.3);
  animation: sourceAppear 0.4s ease;
}

@keyframes sourceAppear {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.source-favicon {
  width: 16px; height: 16px;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.source-favicon-img {
  width: 16px; height: 16px;
  border-radius: 3px;
  object-fit: contain;
}

.source-count-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent-blue);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-add-source {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: rgba(99, 179, 237, 0.08);
  border: 1px dashed rgba(99, 179, 237, 0.3);
  border-radius: var(--radius-xs);
  color: var(--accent-blue);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}

.btn-add-source:hover {
  background: rgba(99, 179, 237, 0.15);
  border-color: rgba(99, 179, 237, 0.5);
  transform: translateY(-1px);
}

/* Formula card */
.formula-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.formula {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.formula-num { color: var(--accent-green); font-weight: 600; }
.formula-den { color: var(--accent-red); font-weight: 600; }

.formula-divider {
  width: 80%;
  height: 1px;
  background: var(--border);
}

.formula-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.sidebar-footer {
  padding: 20px;
  margin-top: auto;
}

.telegram-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(99, 179, 237, 0.06);
  border: 1px solid rgba(99, 179, 237, 0.2);
  border-radius: var(--radius-sm);
}

.tg-icon { font-size: 22px; }

.tg-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.tg-badge {
  margin-left: auto;
  background: rgba(104, 211, 145, 0.15);
  color: var(--accent-green);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(104, 211, 145, 0.3);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOP HEADER ===== */
.top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

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

.sidebar-toggle {
  padding: 10px 14px;
  font-size: 18px;
}

.page-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-badge {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
}

.india-badge {
  font-size: 13px;
  color: var(--accent-orange);
  background: rgba(251, 211, 141, 0.1);
  border: 1px solid rgba(251, 211, 141, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
}

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

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 90px;
  backdrop-filter: blur(10px);
}

.stat-pill.highlight {
  background: rgba(99, 179, 237, 0.08);
  border-color: rgba(99, 179, 237, 0.25);
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-pill.highlight .stat-num {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ===== DIGEST BANNER ===== */
.digest-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(183, 148, 244, 0.08));
  border: 1px solid rgba(102, 126, 234, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.digest-icon { font-size: 20px; }

.digest-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}

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

.sidebar-close-btn {
  display: block;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.digest-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition);
  line-height: 1;
}

.digest-close:hover { color: var(--text-primary); }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 24px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 8px;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.category-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.tab {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.tab.active {
  background: linear-gradient(135deg, rgba(99, 179, 237, 0.2), rgba(183, 148, 244, 0.15));
  border-color: rgba(99, 179, 237, 0.4);
  color: var(--accent-blue);
  font-weight: 600;
  box-shadow: 0 0 16px rgba(99, 179, 237, 0.1);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 30px 8px 14px; /* extra right padding for the X */
  border-radius: var(--radius-xs);
  outline: none;
  transition: all var(--transition);
  width: 220px;
}
.global-search-input:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.1);
}
.global-search-input::placeholder {
  color: var(--text-muted);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition);
}
.clear-search-btn:hover {
  color: var(--text-primary);
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
}

.sort-select:hover, .sort-select:focus {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.score-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.score-filter input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* ===== OPPORTUNITY GRID ===== */
.opportunity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  flex: 1;
  align-content: start;
}

/* ===== OPPORTUNITY CARD ===== */
.opp-card {
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-left: 3px solid var(--cat-color, var(--emerald));
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: cardAppear 0.35s ease forwards;
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.opp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--cat-rgb, 52, 211, 153), 0.15) 0%, rgba(var(--cat-rgb, 52, 211, 153), 0.03) 40%, transparent 100%);
  opacity: 0.6;
  transition: opacity var(--transition);
  pointer-events: none;
}

.opp-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 0 24px rgba(52, 211, 153, 0.18);
}

.opp-card:hover::before { opacity: 1; }

.opp-card.is-new {
  border-color: rgba(104, 211, 145, 0.25);
}

.opp-card.is-new::after {
  content: 'NEW';
  position: absolute;
  top: 16px; right: 16px;
  background: var(--gradient-green);
  color: white;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 20px;
}

/* Card header */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.card-emoji {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-title-area {
  flex: 1;
  min-width: 0;
}

.mobile-break {
  display: none;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.card-source {
  font-size: 12px;
  color: var(--text-muted);
}

/* Score pill */
.score-pill {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: baseline;
}

/* Card body */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
}

/* Card info grid */
.card-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

.info-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-value.deadline-urgent { color: var(--accent-red); }
.info-value.deadline-soon { color: var(--accent-orange); }

/* Why care section */
.why-care {
  background: rgba(99, 179, 237, 0.05);
  border: 1px solid rgba(99, 179, 237, 0.15);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
}

.why-care-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.why-care-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.why-care-item {
  font-size: 13px;
  color: var(--text-secondary);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.why-care-item::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 11px;
  margin-top: 1px;
}

/* Score bar at bottom */
.score-bar-container {
  margin-top: 4px;
}

.score-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.score-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* ===== PAGE FOOTER ===== */
.page-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #0f1624;
  border: 1px solid rgba(99, 179, 237, 0.2);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 179, 237, 0.08);
  animation: modalSlide 0.25s ease;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

/* Modal content */
.modal-opp-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-emoji { font-size: 40px; }

.modal-opp-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
  padding-right: 48px;
}

.modal-source {
  font-size: 13px;
  color: var(--accent-blue);
  text-decoration: none;
}

.modal-source:hover { text-decoration: underline; }

.modal-score-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.modal-score-big {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.modal-score-desc {
  flex: 1;
}

.modal-score-grade {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-score-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
}

.modal-score-bar-fill {
  height: 100%;
  border-radius: 8px;
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-detail-item {
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.modal-detail-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-why-care {
  background: rgba(99, 179, 237, 0.06);
  border: 1px solid rgba(99, 179, 237, 0.15);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 24px;
}

.modal-why-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.modal-why-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-why-item {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-why-item::before {
  content: '→';
  color: var(--accent-blue);
  flex-shrink: 0;
  font-weight: 700;
}

.modal-cta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-primary {
  flex: 1;
  padding: 14px 24px;
  background: var(--gradient-blue);
  border: none;
  border-radius: var(--radius-xs);
  color: white;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 179, 237, 0.3);
}

.btn-secondary-sm {
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1a2436;
  border: 1px solid rgba(104, 211, 145, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.hide {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translate(-50%, 20px); }
}

/* ===== SPLASH SCREEN ===== */
.splash-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.splash-particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  background: rgba(96, 165, 250, 0.5);
  border-radius: 50%;
  animation: splashFloat var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0px) scale(1); opacity: 0.3; }
  50% { transform: translateY(-30px) scale(1.5); opacity: 0.8; }
}

.splash-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: splashPulse 3s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
}

.splash-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: splashIconEntry 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0);
  filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.4));
  z-index: 1;
}

@keyframes splashIconEntry {
  to { opacity: 1; transform: scale(1); }
}

.splash-welcome {
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
  text-align: center;
  max-width: 85%;
  animation: splashFadeUp 0.8s ease forwards;
  animation-delay: 0.4s;
  opacity: 0;
  z-index: 1;
}

.splash-brand {
  font-size: 48px;
  font-weight: 800;
  color: white;
  margin: 0;
  letter-spacing: -1px;
  animation: splashFadeUp 0.8s ease forwards;
  animation-delay: 0.7s;
  opacity: 0;
  z-index: 1;
}

.splash-brand-iq {
  background: linear-gradient(135deg, #34d399, #10b981, #0d9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  margin-top: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: splashFadeUp 0.8s ease forwards;
  animation-delay: 1s;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.5s ease;
}

@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root { --sidebar-width: 240px; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100vw;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: block;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
  }

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

  .header-title {
    gap: 8px;
  }

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

  .top-header {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: 4px;
  }

  .header-left {
    position: static;
    justify-content: center;
    width: 100%;
    padding: 0 50px;
  }

  .sidebar-toggle {
    position: absolute !important;
    left: 0;
    top: 4px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #headerProfileContainer {
    position: absolute !important;
    right: 0;
    top: 4px;
  }

  .header-right {
    position: static !important;
    align-items: center !important;
    width: 100%;
    margin-top: 0;
  }

  .page-title {
    text-align: center;
    flex-grow: 0 !important;
  }

  .mobile-break {
    display: block;
  }

  .updated-text {
    display: none;
  }

  .header-stats {
    justify-content: center;
    width: 100%;
  }

  .filter-controls {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 12px;
    margin-top: 8px;
  }
  .search-wrapper {
    width: 100%;
  }
  .global-search-input {
    width: 100%;
  }

  .sort-select {
    flex: 1;
    width: auto;
  }

  .opportunity-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.clear-source-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  color: var(--accent-red, #ef4444);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px 10px;
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: all 0.2s;
}

.clear-source-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

.opp-card {
  word-wrap: break-word;
  overflow-wrap: break-word;
}


/* ABOUT MODAL */
.about-us-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.about-us-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.about-modal-content {
  max-width: 600px;
}
.about-modal-content h2 {
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--text-primary);
}
.about-modal-content h3 {
  font-size: 16px;
  margin-bottom: 8px;
  margin-top: 24px;
  color: var(--accent-blue);
}
.about-modal-content p,
.about-modal-content li {
  line-height: 1.6;
  color: var(--text-secondary);
  font-size: 14px;
}
.about-modal-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Wishlist Button */
.wishlist-btn {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s, background 0.2s;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wishlist-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.6);
}
.wishlist-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  transition: all 0.2s;
  pointer-events: none;
}
.wishlist-btn.saved svg {
  fill: #fc8181;
  stroke: #fc8181;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
  padding-bottom: 40px;
  width: 100%;
}

.page-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-blue);
  background: var(--bg-tertiary);
}

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

.page-info {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================================
   TAG FILTERS
   ============================================================ */
.tab, .tag {
  font-weight: 700 !important;
  color: #ffffff !important;
}

/* ============================================================
   LOADING OVERLAY (post-login)
   ============================================================ */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  background: rgba(6, 13, 10, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.loading-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 20px;
}

.loading-overlay-content h3 {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.loading-overlay-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.loading-overlay-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: overlaySpinnerRotate 0.8s linear infinite;
}

@keyframes overlaySpinnerRotate {
  100% { transform: rotate(360deg); }
}

/* Custom Additions */
@media (min-width: 1024px) {
  .main-content {
    max-width: 1280px !important;
    margin: 0 auto !important;
    width: 100% !important;
    padding-left: 56px !important;
    padding-right: 56px !important;
  }
  .opportunity-grid {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .page-subtitle {
    text-align: center;
  }
  .page-title {
    text-align: center;
  }
  .title-container {
    width: 100%;
    text-align: center;
    grid-column: 2;
  }
  .header-left {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    width: 100%;
    min-height: 60px;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
  }
  .sidebar-toggle {
    grid-column: 1;
    position: static;
    transform: none;
    margin: 0;
    padding: 10px 12px;
  }
}
