/*
 * Agentic Job Search - Clean Light/Dark Theme
 * Simple, unified theming system with no conflicts
 */

/* ===== CSS VARIABLES & DESIGN TOKENS ===== */
:root {
  /* Brand Colors */
  --brand: #8d16f5;
  --brand-600: #7a14e0;
  --brand-700: #6b12c7;
  
  /* Light Mode (Default) */
  --bg: #FFFFFF;          /* page background */
  --surface: #FFFFFF;     /* cards, hero background */
  --text: #111827;        /* primary text */
  --text-dim: #4B5563;    /* secondary text */
  --border: #E5E7EB;      /* borders */
  
  /* Layout */
  --container: 1160px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 24px rgba(17,24,39,.06);
  
  /* Typography */
  --h1: clamp(34px, 5vw, 44px);
  --h2: clamp(22px, 3vw, 28px);
  --lead: 18px;
  
  /* Spacing */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  --spacing-xxxl: 72px;
}

/* Dark Mode */
html[data-theme="dark"] {
  --bg: #121212;
  --surface: #1E1E1E;
  --text: #F9FAFB;
  --text-dim: #9CA3AF;
  --border: #2C2C2C;
}

/* ===== BASE STYLES ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial;
  line-height: 1.6;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

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

/* Header theming */
html[data-theme="light"] .site-header {
  background: #FFFFFF;
}

html[data-theme="dark"] .site-header {
  background: #1E1E1E;
}

/* Header text colors for light mode */
html[data-theme="light"] .site-header .brand-wordmark {
  color: #111827;
}

/* Header text colors for dark mode */
html[data-theme="dark"] .site-header .brand-wordmark {
  color: #F9FAFB;
}

/* ===== FLOATING THEME TOGGLE ===== */
#themeToggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--brand);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Icon colors for different themes */
html[data-theme="light"] #themeToggle {
  color: #000000; /* Black icon in light mode */
}

html[data-theme="dark"] #themeToggle {
  color: #FFFFFF; /* White icon in dark mode */
}

#themeToggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  background: var(--brand-600);
}

#themeToggle:active {
  transform: translateY(0);
}

/* Hide the old theme toggle in header */
.site-header #themeToggle {
  display: none;
}

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

.brand-wordmark {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand-700);
  color: #fff;
}

.button.primary:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
}

.button.ghost {
  background: transparent;
  border-color: var(--border);
}

.button-compact {
  padding: 8px 12px;
  font-size: 14px;
}

/* ===== HERO SECTION ===== */
.hero {
  background: var(--surface);
  padding: var(--spacing-xxxl) 0 var(--spacing-xxl);
  border-bottom: 1px solid var(--border);
}

.hero-content h1 {
  font-size: 64px !important;
  font-weight: 900 !important;
  line-height: 0.9 !important;
  text-align: left !important;
  margin-bottom: var(--spacing-lg);
  letter-spacing: -0.03em !important;
}

/* Ensure hero background changes with theme */
html[data-theme="light"] .hero {
  background: #FFFFFF;
}

html[data-theme="dark"] .hero {
  background: #1E1E1E;
}

/* Hero text colors for light mode */
html[data-theme="light"] .hero-content h1 {
  color: #111827;
}

html[data-theme="light"] .hero-content .lead {
  color: #4B5563;
}

html[data-theme="light"] .status-indicator {
  color: #4B5563;
}

html[data-theme="light"] .brand-wordmark {
  color: #111827;
}

html[data-theme="light"] .button.ghost {
  color: #111827;
}

/* Hero text colors for dark mode */
html[data-theme="dark"] .hero-content h1 {
  color: #F9FAFB;
}

html[data-theme="dark"] .hero-content .lead {
  color: #9CA3AF;
}

html[data-theme="dark"] .status-indicator {
  color: #9CA3AF;
}

html[data-theme="dark"] .brand-wordmark {
  color: #F9FAFB;
}

html[data-theme="dark"] .button.ghost {
  color: #F9FAFB;
}

/* Video placeholder theming */
html[data-theme="light"] .video-placeholder {
  background: #F9FAFB;
}

html[data-theme="dark"] .video-placeholder {
  background: #121212;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.hero-content {
  text-align: left;
}


.hero-content .lead {
  font-size: var(--lead);
  color: var(--text-dim);
  margin: 0 0 var(--spacing-lg);
  line-height: 1.6;
  text-align: left;
}

.hero-content .button {
  margin-bottom: var(--spacing-md);
  text-align: left;
  display: block;
  width: fit-content;
}

.hero-content .button.primary {
  background: var(--brand) !important;
  color: white !important;
  padding: 12px 20px !important;
  display: inline-block;
  border-radius: 8px !important;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
}

.hero-visual {
  position: relative;
}

.video-placeholder {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.play-button {
  width: 64px;
  height: 64px;
  background: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.play-button:hover {
  background: var(--brand-600);
  transform: scale(1.05);
}

.video-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.video-overlay h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.video-overlay p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  color: var(--text-dim);
}

/* ===== TRUST SIGNALS ===== */
.trust-signals {
  padding: var(--spacing-xxl) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.trust-grid {
  display: flex;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  justify-content: center;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
}

.reviews {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.rating {
  font-weight: 600;
  color: var(--text);
}

.stars {
  color: #fbbf24;
  font-size: 16px;
}

.review-count {
  color: var(--text-dim);
  font-size: 14px;
}

/* ===== STATS SECTION ===== */
.stats-strip {
  background: var(--bg);
  padding: var(--spacing-xxl) 0;
  border-bottom: 1px solid var(--border);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.stat-card {
  background: var(--surface);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Dark mode stats cards */
html[data-theme="dark"] .stat-card {
  background: #1E1E1E !important;
  border: 1px solid #374151 !important;
}

html[data-theme="dark"] .stat-label {
  color: #F9FAFB !important;
}

.stat-number {
  color: var(--brand) !important;
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
}

/* ===== BENEFITS SECTION ===== */
.benefits {
  padding: var(--spacing-xxxl) 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.benefits h2 {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
  color: var(--text);
  font-size: var(--h2);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
}

.benefit-card {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.benefit-icon {
  width: 48px;
  height: 48px;
  color: var(--brand);
  margin: 0 auto var(--spacing-md);
  display: block;
}

.benefit-card h3 {
  color: var(--text);
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
}

.benefit-card p {
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

/* ===== HOW IT WORKS SECTION ===== */
.how-it-works {
  padding: var(--spacing-xxxl) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.how-it-works h2 {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
  color: var(--text);
  font-size: var(--h2);
}

.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-xxl);
  align-items: center;
}

.step-card {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step-number {
  width: 64px;
  height: 64px;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto var(--spacing-md);
}

.step-card h3 {
  color: var(--text);
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.step-card p {
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
  padding: var(--spacing-xxl) 0;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .trust-grid {
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
  }
  
  .stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .how-it-works-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
}

/* ===== LEGACY COMPATIBILITY ===== */
/* Keep existing IDs and classes working */
#appMain {
  /* Main content area */
}

#searchSection {
  /* Search section */
}

#uploadArea {
  /* Upload area */
}

#fileInput {
  /* File input */
}

#progressFill {
  /* Progress bar */
}

#skillsOverlay,
#companyOverlay {
  /* Overlay modals */
}

#jobGrid {
  /* Job grid */
}

#companyFilter,
#skillsFilter {
  /* Filter inputs */
}

/* Overlay styles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
}

.overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--spacing-xl);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* Job card styles */
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow);
}

.skill-tag {
  display: inline-block;
  background: var(--brand);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px;
}

.meta-item {
  color: var(--text-dim);
  font-size: 14px;
}

.loading {
  color: var(--text-dim);
  text-align: center;
  padding: var(--spacing-xl);
}

.error {
  color: #ef4444;
  text-align: center;
  padding: var(--spacing-xl);
}
