/* ============================================================
   Recruiter Hub — Public Stylesheet
   All selectors are namespaced with .rhub- to prevent conflicts
   with the theme. Brand colour is injected via inline <style>
   based on rhub_settings.company.brand_color.
   ============================================================ */

:root {
  --rhub-brand:       #1C5D5A;
  --rhub-brand-light: #e8f5f4;
  --rhub-brand-dark:  #134340;
  --rhub-text:        #1a1a2e;
  --rhub-muted:       #6b7280;
  --rhub-border:      #e5e7eb;
  --rhub-bg:          #f9fafb;
  --rhub-white:       #ffffff;
  --rhub-radius:      8px;
  --rhub-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --rhub-shadow-lg:   0 10px 25px rgba(0,0,0,.1);
  --rhub-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Base reset (scoped) ──────────────────────────────────── */
.rhub-wrap * { box-sizing: border-box; }
.rhub-wrap { font-family: var(--rhub-font); color: var(--rhub-text); line-height: 1.6; }

/* ── Career page hero ─────────────────────────────────────── */
.rhub-career-hero {
  background: linear-gradient(135deg, var(--rhub-brand) 0%, var(--rhub-brand-dark) 100%);
  color: #fff;
  padding: 64px 24px;
  text-align: center;
  border-radius: var(--rhub-radius);
  margin-bottom: 32px;
}
.rhub-career-hero h1 { font-size: 2.2rem; margin: 0 0 12px; font-weight: 700; }
.rhub-career-hero p  { font-size: 1.1rem; opacity: .88; max-width: 560px; margin: 0 auto 24px; }
.rhub-company-logo   { max-height: 60px; margin-bottom: 20px; }

/* ── Search & filters ─────────────────────────────────────── */
.rhub-search-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--rhub-white);
  padding: 16px;
  border-radius: var(--rhub-radius);
  box-shadow: var(--rhub-shadow);
  margin-bottom: 28px;
}
.rhub-search-bar input[type="search"],
.rhub-search-bar select {
  flex: 1 1 180px;
  padding: 10px 14px;
  border: 1px solid var(--rhub-border);
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.rhub-search-bar input[type="search"]:focus,
.rhub-search-bar select:focus { border-color: var(--rhub-brand); }
.rhub-search-bar button {
  padding: 10px 22px;
  background: var(--rhub-brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  transition: background .2s;
}
.rhub-search-bar button:hover { background: var(--rhub-brand-dark); }

/* ── Job listing cards ────────────────────────────────────── */
.rhub-job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.rhub-job-list { display: flex; flex-direction: column; gap: 14px; }

.rhub-job-card {
  background: var(--rhub-white);
  border: 1px solid var(--rhub-border);
  border-radius: var(--rhub-radius);
  padding: 22px 24px;
  box-shadow: var(--rhub-shadow);
  transition: box-shadow .2s, transform .15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.rhub-job-card:hover { box-shadow: var(--rhub-shadow-lg); transform: translateY(-2px); text-decoration: none; }
.rhub-job-card--featured { border-left: 4px solid var(--rhub-brand); }

.rhub-job-card__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.rhub-job-card__title  { font-size: 1.1rem; font-weight: 700; margin: 0 0 4px; color: var(--rhub-text); }
.rhub-job-card__dept   { color: var(--rhub-muted); font-size: .875rem; }
.rhub-job-card__meta   { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.rhub-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--rhub-brand-light);
  color: var(--rhub-brand-dark);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
}
.rhub-tag--remote  { background: #e0f2fe; color: #0369a1; }
.rhub-tag--type    { background: #f3e8ff; color: #6d28d9; }
.rhub-tag--salary  { background: #dcfce7; color: #166534; }

.rhub-job-card__footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.rhub-job-card__deadline { font-size: .8rem; color: var(--rhub-muted); }
.rhub-btn-apply {
  padding: 8px 20px;
  background: var(--rhub-brand);
  color: #fff;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.rhub-btn-apply:hover { background: var(--rhub-brand-dark); color: #fff; text-decoration: none; }

/* ── Single job detail ────────────────────────────────────── */
.rhub-job-detail { max-width: 780px; margin: 0 auto; }
.rhub-job-detail__header {
  background: var(--rhub-brand);
  color: #fff;
  padding: 36px 32px;
  border-radius: var(--rhub-radius) var(--rhub-radius) 0 0;
}
.rhub-job-detail__header h1 { font-size: 1.8rem; margin: 0 0 10px; }
.rhub-job-detail__body { background: var(--rhub-white); border: 1px solid var(--rhub-border); border-top: none; padding: 32px; border-radius: 0 0 var(--rhub-radius) var(--rhub-radius); }
.rhub-job-detail__section h2 { font-size: 1.1rem; font-weight: 700; color: var(--rhub-brand); border-bottom: 1px solid var(--rhub-border); padding-bottom: 6px; margin-bottom: 12px; }

/* ── Application form ─────────────────────────────────────── */
.rhub-apply-form-wrap {
  background: var(--rhub-white);
  border: 1px solid var(--rhub-border);
  border-radius: var(--rhub-radius);
  padding: 32px;
  margin-top: 24px;
}
.rhub-apply-form-wrap h2 { margin-top: 0; }
.rhub-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .rhub-form-row { grid-template-columns: 1fr; } }

.rhub-field { margin-bottom: 18px; }
.rhub-field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.rhub-field input[type="text"],
.rhub-field input[type="email"],
.rhub-field input[type="tel"],
.rhub-field input[type="number"],
.rhub-field input[type="date"],
.rhub-field input[type="file"],
.rhub-field select,
.rhub-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rhub-border);
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.rhub-field input:focus,
.rhub-field select:focus,
.rhub-field textarea:focus {
  border-color: var(--rhub-brand);
  box-shadow: 0 0 0 3px rgba(28,93,90,.12);
}
.rhub-required { color: #dc2626; }

.rhub-upload-zone {
  border: 2px dashed var(--rhub-border);
  border-radius: var(--rhub-radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.rhub-upload-zone:hover, .rhub-upload-zone.drag-over {
  border-color: var(--rhub-brand);
  background: var(--rhub-brand-light);
}
.rhub-upload-zone p { margin: 6px 0; color: var(--rhub-muted); font-size: .9rem; }

.rhub-btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--rhub-brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  margin-top: 8px;
}
.rhub-btn-submit:hover:not(:disabled) { background: var(--rhub-brand-dark); }
.rhub-btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.rhub-form-notice {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: .9rem;
  margin-bottom: 16px;
}
.rhub-form-notice--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.rhub-form-notice--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Auth forms ───────────────────────────────────────────── */
.rhub-auth-wrap {
  max-width: 440px;
  margin: 40px auto;
  background: var(--rhub-white);
  border: 1px solid var(--rhub-border);
  border-radius: var(--rhub-radius);
  padding: 36px 32px;
  box-shadow: var(--rhub-shadow-lg);
}
.rhub-auth-wrap h2 { margin-top: 0; text-align: center; }
.rhub-auth-switch  { text-align: center; margin-top: 16px; font-size: .9rem; }

/* ── Candidate dashboard ──────────────────────────────────── */
.rhub-dashboard { max-width: 900px; margin: 0 auto; }
.rhub-dashboard-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--rhub-border); margin-bottom: 24px; }
.rhub-dashboard-tab {
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  font-weight: 600;
  font-size: .9rem;
  color: var(--rhub-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  transition: color .2s;
}
.rhub-dashboard-tab.active, .rhub-dashboard-tab:hover {
  color: var(--rhub-brand);
  border-color: var(--rhub-border);
  background: var(--rhub-white);
}
.rhub-dashboard-panel { display: none; }
.rhub-dashboard-panel.active { display: block; }

.rhub-application-card {
  background: var(--rhub-white);
  border: 1px solid var(--rhub-border);
  border-radius: var(--rhub-radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.rhub-application-card__info { flex: 1; }
.rhub-application-card__title { font-weight: 700; font-size: 1rem; margin: 0 0 4px; }
.rhub-application-card__meta  { font-size: .85rem; color: var(--rhub-muted); }

.rhub-stage-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.rhub-stage-pill--applied      { background: #eff6ff; color: #1d4ed8; }
.rhub-stage-pill--shortlisted  { background: #fef3c7; color: #92400e; }
.rhub-stage-pill--interviewing { background: #f0fdf4; color: #166534; }
.rhub-stage-pill--offer        { background: #f3e8ff; color: #6d28d9; }
.rhub-stage-pill--hired        { background: #dcfce7; color: #14532d; }
.rhub-stage-pill--rejected     { background: #fee2e2; color: #991b1b; }

/* ── Messaging thread ─────────────────────────────────────── */
.rhub-message-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  background: var(--rhub-bg);
  border-radius: 6px;
  margin-bottom: 12px;
}
.rhub-message-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.5;
}
.rhub-message-bubble--own {
  align-self: flex-end;
  background: var(--rhub-brand);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.rhub-message-bubble--other {
  align-self: flex-start;
  background: var(--rhub-white);
  border: 1px solid var(--rhub-border);
  border-bottom-left-radius: 3px;
}
.rhub-message-meta { font-size: .75rem; margin-top: 4px; opacity: .7; }

/* ── Company benefits ─────────────────────────────────────── */
.rhub-benefits-section { background: var(--rhub-brand-light); border-radius: var(--rhub-radius); padding: 28px; margin: 32px 0; }
.rhub-benefits-section h2 { color: var(--rhub-brand-dark); margin-top: 0; }
.rhub-benefits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.rhub-benefit-item { background: #fff; padding: 16px; border-radius: 8px; font-size: .9rem; box-shadow: var(--rhub-shadow); }

/* ── Empty states ─────────────────────────────────────────── */
.rhub-empty-state { text-align: center; padding: 60px 20px; color: var(--rhub-muted); }
.rhub-empty-state svg, .rhub-empty-state .rhub-empty-icon { font-size: 3rem; margin-bottom: 16px; display: block; }
.rhub-empty-state h3 { font-size: 1.2rem; color: var(--rhub-text); margin-bottom: 8px; }

/* ── Spinner ──────────────────────────────────────────────── */
.rhub-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rhub-spin .6s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes rhub-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .rhub-career-hero { padding: 40px 16px; }
  .rhub-career-hero h1 { font-size: 1.6rem; }
  .rhub-apply-form-wrap { padding: 20px; }
  .rhub-dashboard-tabs { overflow-x: auto; }
}
