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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ─── Colors ────────────────────────────────────────── */
:root {
  --blue:    #2563eb;
  --navy:    #0f172a;
  --gray:    #64748b;
  --border:  #e2e8f0;
  --bg:      #f8fafc;
  --card:    #ffffff;
  --green:   #059669;
  --amber:   #d97706;
  --red:     #dc2626;
  --banner:  #eff6ff;
  --radius-card:   12px;
  --radius-btn:    8px;
  --radius-pill:   20px;
  --shadow-card:   0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover:  0 4px 12px rgba(0,0,0,0.10);
}

/* ─── Topbar ────────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo .dark  { color: #0f172a; }
.logo .amber { color: #f59e0b; }

/* ─── Search Bar ────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 640px;
}

.search-bar input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  color: var(--navy);
  background: var(--bg);
  transition: border-color 0.15s;
  min-width: 0;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}

.search-bar input::placeholder { color: #94a3b8; }

.btn-search {
  height: 42px;
  padding: 0 20px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn-search:hover  { background: #1d4ed8; }
.btn-search:active { transform: scale(0.97); }

/* ─── Homepage ──────────────────────────────────────── */
.home-body { background: #fff; }

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  padding: 60px 24px 40px;
  text-align: center;
  background: #fff;
}

.home-inner {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-logo {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}
.home-logo .dark  { color: #0f172a; }
.home-logo .amber { color: #f59e0b; }

.home-tagline {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.home-sub {
  font-size: 0.95rem;
  color: var(--gray);
  margin-bottom: 28px;
}

.home-search {
  width: 100%;
  max-width: 520px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.home-search input {
  height: 52px;
  font-size: 1rem;
  background: #fff;
  flex: 1;
  min-width: 150px;
}

.home-search-btn {
  height: 52px;
  padding: 0 28px;
  background: var(--navy) !important;
  font-size: 1rem;
}
.home-search-btn:hover { background: #1e293b !important; }

.example-pills { margin-bottom: 48px; }

.home-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 28px 0 0;
  border-top: 1px solid var(--border);
  width: 100%;
}

.home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.home-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
}

.home-stat-label {
  font-size: 0.82rem;
  color: var(--gray);
}

.home-footer {
  text-align: center;
  padding: 16px 24px;
  font-size: 0.82rem;
  color: var(--gray);
  border-top: 1px solid var(--border);
  background: #fff;
}

.example-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pill {
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  color: var(--gray);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pill:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--banner);
}

/* ─── Results Layout ────────────────────────────────── */
.results-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: calc(100vh - 65px);
}

.results-left {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
}

.results-right {
  overflow-y: auto;
  height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
  background: var(--bg);
}

/* ─── Filters & Banner ──────────────────────────────── */
.filters-bar {
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-pill {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: var(--gray);
  background: #fff;
  transition: all 0.15s;
}
.filter-pill:hover  { border-color: var(--blue); color: var(--blue); }
.filter-pill.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.algo-banner {
  background: var(--banner);
  border-bottom: 1px solid #bfdbfe;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: #1e40af;
}

.results-meta {
  padding: 12px 16px 8px;
  font-size: 0.85rem;
  color: var(--gray);
  background: var(--bg);
}

/* ─── Job Cards ─────────────────────────────────────── */
.cards-list {
  padding: 8px 12px 24px;
}

.job-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-card);
}
.job-card:hover  { border-color: var(--blue); box-shadow: var(--shadow-hover); }
.job-card.active { border-color: var(--blue); box-shadow: 0 0 0 3px #bfdbfe; }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.company-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 2px;
}
.job-card:hover .card-title { color: var(--blue); }

.card-company { font-size: 0.82rem; color: var(--gray); }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 10px;
  align-items: center;
}

.source-tag {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.72rem;
  color: var(--gray);
  font-weight: 500;
}

.salary-text {
  font-size: 0.82rem;
  color: #059669;
  font-weight: 600;
}
.salary-text.none { color: var(--gray); font-weight: 400; }

/* ─── Odds Bar ──────────────────────────────────────── */
.odds-section { margin-bottom: 10px; }

.odds-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.odds-label { font-size: 0.75rem; color: var(--gray); font-weight: 500; }
.odds-text  { font-size: 0.78rem; font-weight: 700; }
.odds-text.strong { color: var(--green); }
.odds-text.good   { color: var(--green); }
.odds-text.mod    { color: var(--amber); }
.odds-text.comp   { color: var(--red);   }

.odds-bar-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 5px;
}

.odds-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.odds-bar-fill.strong { background: var(--green); }
.odds-bar-fill.good   { background: var(--green); opacity: 0.8; }
.odds-bar-fill.mod    { background: var(--amber); }
.odds-bar-fill.comp   { background: var(--red);   }

.odds-detail {
  font-size: 0.73rem;
  color: var(--gray);
}

/* ─── Card Footer ───────────────────────────────────── */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.response-badge {
  font-size: 0.75rem;
  font-weight: 500;
}
.response-badge.guaranteed { color: var(--green); }
.response-badge.direct     { color: var(--gray);  }

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

.btn-save {
  height: 32px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: #fff;
  font-size: 0.78rem;
  color: var(--gray);
  transition: all 0.15s;
}
.btn-save:hover { border-color: var(--blue); color: var(--blue); }
.btn-save.saved { border-color: var(--blue); color: var(--blue); background: var(--banner); }

.btn-apply {
  height: 32px;
  padding: 0 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-apply:hover { background: #1d4ed8; }

/* ─── Section Divider ───────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  margin: 8px 0;
}
.section-divider span {
  font-size: 0.75rem;
  color: var(--gray);
  white-space: nowrap;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Detail Panel ──────────────────────────────────── */
.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray);
  text-align: center;
  padding: 48px;
}
.detail-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.detail-empty p    { font-size: 0.9rem; max-width: 220px; }

.detail-panel {
  padding: 28px;
}

.detail-header {
  margin-bottom: 20px;
}

.detail-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.25;
}

.detail-company-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--gray);
  margin-bottom: 4px;
}

.detail-salary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 20px;
}
.detail-salary.none { color: var(--gray); font-weight: 400; }

.odds-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}
.odds-box.mod  { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-color: #fcd34d; }
.odds-box.comp { background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%); border-color: #fca5a5; }

.odds-box-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.odds-box-title.strong, .odds-box-title.good { color: var(--green); }
.odds-box-title.mod  { color: var(--amber); }
.odds-box-title.comp { color: var(--red);   }

.odds-box-why {
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.5;
}

.odds-box .odds-bar-track { margin-top: 10px; height: 8px; }

.detail-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.btn-apply-full {
  flex: 1;
  height: 44px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 700;
  transition: background 0.15s;
}
.btn-apply-full:hover { background: #1d4ed8; }

.btn-save-full {
  height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: #fff;
  font-size: 0.88rem;
  color: var(--gray);
  transition: all 0.15s;
}
.btn-save-full:hover { border-color: var(--blue); color: var(--blue); }

.view-source-link {
  font-size: 0.8rem;
  color: var(--blue);
  margin-bottom: 24px;
  display: inline-block;
}
.view-source-link:hover { text-decoration: underline; }

.detail-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 20px;
}

.detail-desc-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  margin-bottom: 12px;
}

.detail-desc {
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.7;
}
.detail-desc h1, .detail-desc h2, .detail-desc h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 16px 0 6px;
  color: var(--navy);
}
.detail-desc ul, .detail-desc ol { padding-left: 20px; margin: 8px 0; }
.detail-desc li { margin-bottom: 4px; }
.detail-desc p  { margin-bottom: 10px; }
.detail-desc strong { font-weight: 600; color: var(--navy); }

/* ─── Skeleton Loading ──────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0;  }
}

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}

.skeleton-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.skeleton-line  { height: 12px; margin-bottom: 8px; }
.skeleton-title { width: 75%; }
.skeleton-sub   { width: 45%; }
.skeleton-full  { width: 100%; }
.skeleton-half  { width: 50%; }
.skeleton-bar   { height: 6px; width: 100%; margin-top: 12px; }
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ─── Error & Empty States ──────────────────────────── */
.state-message {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray);
}
.state-message .icon { font-size: 2rem; margin-bottom: 12px; }
.state-message h3    { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.state-message p     { font-size: 0.88rem; }

/* ─── Mobile Overlay ────────────────────────────────── */
.mobile-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 200;
  overflow-y: auto;
}
.mobile-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border: none;
  width: 100%;
  text-align: left;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .results-layout {
    grid-template-columns: 1fr;
  }

  .results-right { display: none; }
  .results-left  { height: auto; position: static; border-right: none; }

  .mobile-detail-overlay { display: none; }
  .mobile-detail-overlay.open { display: block; }

  .topbar { padding: 10px 12px; gap: 10px; }

  .home-tagline { font-size: 1.3rem; }
  .home-logo    { font-size: 2.4rem; }

  .filters-bar { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding: 10px 12px; }
  .filter-pill { white-space: nowrap; flex-shrink: 0; }
}

@media (max-width: 480px) {
  .home-search { flex-direction: column; }
  .home-search input, .home-search-btn { width: 100%; }
  .home-stats { gap: 20px; }
}

/* ─── Feedback Section ──────────────────────────────── */
.feedback-section {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

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

.feedback-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
}

.feedback-rated {
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 500;
}

.feedback-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-fb {
  flex: 1;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray);
  transition: all 0.15s;
}
.btn-fb:hover            { border-color: var(--blue); color: var(--blue); }
.btn-fb.up.active        { border-color: var(--green); color: var(--green); background: #f0fdf4; }
.btn-fb.down.active      { border-color: var(--red);   color: var(--red);   background: #fff1f2; }

.feedback-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.feedback-reason-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  font-size: 0.78rem;
  color: var(--gray);
  transition: all 0.15s;
}
.feedback-reason-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--banner); }

/* ─── Feedback Toast ────────────────────────────────── */
.feedback-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy);
  color: #fff;
  padding: 10px 22px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}
.feedback-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
