/* App shell — navigation, forms, cards, tables */

/* ── Nav ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.app-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--fg);
  text-decoration: none;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--fg);
}

.nav-link-primary {
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.15s;
}

.nav-link-primary:hover {
  background: var(--accent-light);
  color: #fff;
}

/* ── Page Shell ── */
.app-main {
  min-height: calc(100vh - 120px);
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--fg-muted);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

.card + .card {
  margin-top: 16px;
}

/* ── Forms ── */
.form-section {
  max-width: 680px;
}

.form-grid {
  display: grid;
  gap: 20px;
}

.form-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.15s;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--fg-muted);
  opacity: 0.6;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--fg-muted);
  opacity: 0.7;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-secondary {
  background: var(--surface-light);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-gold {
  background: var(--gold);
  color: var(--bg);
}

.btn-gold:hover {
  opacity: 0.9;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

/* ── Alerts ── */
.alert {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 24px;
  border: 1px solid;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.alert-error {
  background: rgba(232, 87, 42, 0.1);
  border-color: rgba(232, 87, 42, 0.3);
  color: var(--accent-light);
}

.alert-info {
  background: var(--surface);
  border-color: var(--border);
  color: var(--fg-muted);
}

/* ── Match Cards ── */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 20px;
  align-items: start;
  transition: border-color 0.15s;
}

.match-card:hover {
  border-color: rgba(245, 240, 235, 0.2);
}

.match-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.score-high { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 2px solid rgba(34, 197, 94, 0.3); }
.score-mid  { background: rgba(212, 168, 83, 0.15); color: var(--gold); border: 2px solid rgba(212, 168, 83, 0.3); }
.score-low  { background: rgba(232, 87, 42, 0.1); color: var(--accent-light); border: 2px solid rgba(232, 87, 42, 0.2); }

.match-info h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.match-meta {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.match-reasoning {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.6;
  background: var(--surface-light);
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
}

.match-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

/* ── Skills / Tags ── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  padding: 4px 10px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.tag-accent {
  border-color: rgba(232, 87, 42, 0.3);
  color: var(--accent-light);
}

/* ── Job List ── */
.job-list {
  display: grid;
  gap: 16px;
}

.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.job-card:hover {
  border-color: rgba(245, 240, 235, 0.2);
}

.job-card-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.job-card-meta {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.salary-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
  padding: 4px 12px;
  background: var(--gold-muted);
  border-radius: 100px;
  white-space: nowrap;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--fg);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 24px;
}

/* ── Profile View ── */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: #fff;
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-item label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.detail-item span {
  font-size: 0.95rem;
  color: var(--fg);
}

/* ── Dashboard header ── */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.dashboard-header-text {}
.dashboard-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Spinner ── */
#run-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Job Filter Bar ── */
.job-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-field select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s;
}

.filter-field select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

/* ── Job Apply CTA ── */
.job-apply-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin-top: 8px;
}

.job-apply-cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* ── Footer ── */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
}

.app-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .match-card {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }

  .match-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
  }

  .dashboard-header {
    flex-direction: column;
  }

  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .job-card {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .app-main {
    padding: 32px 16px;
  }

  .card {
    padding: 20px;
  }

  .match-card {
    padding: 16px;
    gap: 12px;
  }
}
