/* ═══════════════════════════════════════════════
   JobOns — Design system
   Inspiration : shadcn/ui + 21st.dev
   Font : Inter, palette zinc/neutre + accent bleu
═══════════════════════════════════════════════ */

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

:root {
  /* Colors */
  --bg:           #fafafa;
  --surface:      #ffffff;
  --border:       #e4e4e7;
  --border-hover: #a1a1aa;
  --text-primary: #09090b;
  --text-muted:   #71717a;
  --text-subtle:  #a1a1aa;

  --accent:       #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;

  /* Contrat badges */
  --cdd-bg:   #f0fdf4; --cdd-text:  #15803d; --cdd-border: #bbf7d0;
  --mis-bg:   #fefce8; --mis-text:  #a16207; --mis-border: #fef08a;
  --sai-bg:   #fff7ed; --sai-text:  #c2410c; --sai-border: #fed7aa;

  /* Source badges */
  --ft-bg:   #eff6ff; --ft-text: #2563eb;
  --az-bg:   #f0fdf4; --az-text: #15803d;
  --rss-bg:  #faf5ff; --rss-text: #7c3aed;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 12px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --shadow-md:  0 8px 24px rgba(0,0,0,.09), 0 2px 8px rgba(0,0,0,.05);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Icons ─────────────────────────── */
.icon-sm { width: 14px; height: 14px; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ═══════════════ HEADER ═══════════════ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.9);
}

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

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

.brand-logo {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.update-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.update-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

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

/* ═══════════════ HERO ═══════════════ */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 0 20px;
}

.hero-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
  overflow: hidden;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 16px; height: 16px;
  color: var(--text-subtle);
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  font-family: inherit;
  font-size: 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
}

#search-input::placeholder { color: var(--text-subtle); }

.search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}

.search-clear:hover { color: var(--text-primary); }

/* ═══════════════ FILTERS ═══════════════ */
.filters-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.filters-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.filter-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.filter-select {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  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 d='M2 4l4 4 4-4' stroke='%2371717a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color .15s;
  min-width: 140px;
}

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

.filter-reset {
  margin-left: auto;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: all .15s;
  align-self: flex-end;
}

.filter-reset:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: all .15s;
  align-self: flex-end;
}

.filter-refresh:hover {
  background: var(--accent);
  color: #fff;
}

.filter-refresh.spinning .icon-sm {
  animation: spin .6s linear infinite;
}

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

/* ═══════════════ MAIN CONTENT ═══════════════ */
.main-content { padding: 28px 0 48px; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-sub { font-size: 13.5px; }

/* ═══════════════ JOBS GRID ═══════════════ */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ── Job Card ── */
.job-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}

.job-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* ── Card header ── */
.card-header { display: flex; flex-direction: column; gap: 6px; }

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  flex: 1;
}

.job-company {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Badges ── */
.badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: .2px;
  white-space: nowrap;
}

.badge-cdd  { background: var(--cdd-bg);  color: var(--cdd-text);  border: 1px solid var(--cdd-border); }
.badge-mis  { background: var(--mis-bg);  color: var(--mis-text);  border: 1px solid var(--mis-border); }
.badge-sai  { background: var(--sai-bg);  color: var(--sai-text);  border: 1px solid var(--sai-border); }

/* ── Description ── */
.job-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

/* ── Card footer ── */
.card-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-secteur {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 20px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}

.source-france_travail { background: var(--ft-bg); color: var(--ft-text); }
.source-adzuna         { background: var(--az-bg); color: var(--az-text); }
.source-jobijoba,
.source-hellowork      { background: var(--rss-bg); color: var(--rss-text); }

.job-date {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-left: auto;
}

.btn-voir {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}

.btn-voir:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ═══════════════ FOOTER ═══════════════ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}

.site-footer p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer-copy { color: var(--text-subtle) !important; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 640px) {
  .header-inner    { height: auto; padding: 12px 0; flex-direction: column; align-items: flex-start; gap: 8px; }
  .brand-tagline   { display: none; }
  .update-badge    { font-size: 11px; }
  .filters-inner   { gap: 8px; }
  .filter-select   { min-width: 120px; }
  .filter-reset    { margin-left: 0; }
  .jobs-grid       { grid-template-columns: 1fr; }
  .card-actions    { flex-direction: row; justify-content: space-between; }
}
