/* ============================================================
   EthioTalent — Design System
   Ethiopian-inspired colors: Deep Green + Gold
   ============================================================ */

/* ── Custom Properties ──────────────────────────────────── */
:root {
  --color-primary:       #1B4332;
  --color-primary-dark:  #0d2b20;
  --color-primary-light: #2d6a4f;
  --color-accent:        #D4A017;
  --color-accent-dark:   #b8870e;
  --color-accent-light:  #f0c048;

  --color-surface:    #ffffff;
  --color-bg:         #F8F9FA;
  --color-bg-alt:     #EEF2EE;
  --color-border:     #E2E8E4;
  --color-text:       #1A1A2E;
  --color-muted:      #6B7280;
  --color-muted-lt:   #9CA3AF;

  --color-danger:     #DC2626;
  --color-danger-bg:  #FEF2F2;
  --color-success:    #16A34A;
  --color-success-bg: #F0FDF4;
  --color-warning:    #D97706;
  --color-warning-bg: #FFFBEB;
  --color-info:       #2563EB;
  --color-info-bg:    #EFF6FF;

  --font-sans:   system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ethiopic: 'Noto Sans Ethiopic', var(--font-sans);

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.12);

  --transition: 150ms ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; }
main { flex: 1; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-text);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p  { margin-bottom: 1rem; }

.text-muted   { color: var(--color-muted); }
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .75rem; }
.text-lg      { font-size: 1.125rem; }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }

/* ── Layout Utilities ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px)  { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.section      { padding: 3rem 0; }
.section-sm   { padding: 1.5rem 0; }
.section-lg   { padding: 5rem 0; }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }

.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-4  { padding: 1rem; }
.p-6  { padding: 1.5rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.w-full  { width: 100%; }
.max-w-md { max-width: 480px; }
.max-w-lg { max-width: 640px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.hidden        { display: none !important; }
.block         { display: block; }
.inline-block  { display: inline-block; }
.overflow-hidden { overflow: hidden; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded       { border-radius: var(--radius-md); }
.rounded-full  { border-radius: var(--radius-full); }
.bg-white      { background: var(--color-surface); }
.bg-primary    { background: var(--color-primary); }
.border        { border: 1px solid var(--color-border); }
.shadow        { box-shadow: var(--shadow-md); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none !important;
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  line-height: 1.4;
}
.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-primary-dark);
}
.btn-accent:hover {
  background: var(--color-accent-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-bg-alt);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm { padding: .375rem .875rem; font-size: .8125rem; min-height: 36px; }
.btn-lg { padding: .875rem 1.75rem; font-size: 1.0625rem; }
.btn-full { width: 100%; }
.btn-icon { padding: .5rem; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .375rem;
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: .9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}
.form-control::placeholder { color: var(--color-muted-lt); }
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,.12);
}

.job-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  align-items: start;
}

.job-form-grid .form-group {
  margin-bottom: 0;
}

.job-form-grid .full-width {
  grid-column: 1 / -1;
}

.job-create-form {
  display: grid;
  gap: 1.25rem;
}

.form-section {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.02);
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--color-border);
}

.section-kicker {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  font-weight: 700;
}

.form-section-header h3 {
  margin: .2rem 0 0;
  font-size: 1.05rem;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .75rem;
}

.mode-switch .form-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  min-height: 48px;
  font-weight: 500;
}

.mode-switch .form-check input {
  margin-top: 0;
}

.job-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .875rem;
  padding-top: .75rem;
  border-top: 1px solid var(--color-border);
}

.checkbox-group-box {
  padding: 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faf8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .8rem;
  align-items: center;
}

.checkbox-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  min-height: 56px;
  padding: .8rem .9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}

.checkbox-item:hover {
  border-color: rgba(27,67,50,.35);
  background: rgba(27,67,50,.02);
  transform: translateY(-1px);
}

.checkbox-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  margin: 0;
}

.checkbox-item span {
  font-size: .92rem;
  color: var(--color-text);
  line-height: 1.4;
  font-weight: 500;
  text-align: center;
}

@media (max-width: 640px) {
  .job-form-grid,
  .job-meta-grid {
    grid-template-columns: 1fr;
  }

  .form-section {
    padding: 1rem;
  }
}

.checkbox-item:has(input:checked) {
  background: rgba(27,67,50,.04);
  border-color: rgba(27,67,50,.35);
  box-shadow: 0 0 0 3px rgba(27,67,50,.08);
}

.form-hint {
  margin-top: .5rem;
  color: var(--color-muted);
  font-size: .8rem;
}
.form-control.is-invalid {
  border-color: var(--color-danger);
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-hint  { font-size: .8125rem; color: var(--color-muted); margin-top: .25rem; }
.form-error { font-size: .8125rem; color: var(--color-danger); margin-top: .25rem; }

.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input { width: 1rem; height: 1rem; cursor: pointer; accent-color: var(--color-primary); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary   { background: rgba(27,67,50,.1);  color: var(--color-primary); }
.badge-accent    { background: rgba(212,160,23,.15); color: #8a6500; }
.badge-success   { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger    { background: var(--color-danger-bg);  color: var(--color-danger); }
.badge-warning   { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-info      { background: var(--color-info-bg);    color: var(--color-info); }
.badge-muted     { background: #F3F4F6; color: var(--color-muted); }
.badge-dot::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: .875rem 1rem;
  border-radius: var(--radius-md);
  font-size: .9375rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.alert-success { background: var(--color-success-bg); color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: var(--color-danger-bg);  color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--color-warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--color-info-bg);    color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body  { padding: 1.25rem; }
.card-header{ padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border); font-weight: 600; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-bg); font-weight: 600; font-size: .8125rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-bg); }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 .75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--color-text);
  transition: all var(--transition);
  text-decoration: none !important;
}
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-bg-alt); }
.pagination .active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .375rem;
  font-size: .875rem;
  color: var(--color-muted);
  padding: .75rem 0;
}
.breadcrumb a { color: var(--color-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb-sep { color: var(--color-muted-lt); }
.breadcrumb .current { color: var(--color-text); font-weight: 500; }

/* ── Divider ────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 1.5rem 0; }

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-muted);
}
.empty-state svg { width: 4rem; height: 4rem; margin: 0 auto 1rem; opacity: .4; }
.empty-state h3  { color: var(--color-text); margin-bottom: .5rem; }

/* ── Loading spinner ────────────────────────────────────── */
.spinner {
  width: 1.5rem; height: 1.5rem;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ARIA live region ───────────────────────────────────── */
#live-region {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Skip link ──────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 9999;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { top: 0; }

/* ── Focus ring ─────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
