/* FranjaJobb custom styles — extends oat.ink */
:root {
  --size-content-3: clamp(16rem, 65ch, 100%);
}

.hidden {
  display: none;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}

/* Constrain readable content and forms, but not tables/grids */
main > * {
  max-width: var(--size-content-3);
}

main > .row,
main > .table-container {
  max-width: none;
}

/* Scrollable table wrapper for mobile */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Date color coding: freshness gradient */
.date-fresh { color: var(--success, #2a7d2e); }
.date-recent { color: var(--warning, #b58105); }
.date-aging { color: var(--text-muted, #888); }
.date-stale { color: var(--danger, #c53030); }
.date-urgent { color: var(--danger, #c53030); font-weight: bold; }

.job-description {
  line-height: 1.6;
}

/* Stats cards */
.stat-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

/* Nav spacing */
nav {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

nav .hstack {
  justify-content: space-between;
  align-items: center;
}

nav a.strong {
  font-weight: bold;
  font-size: 1.1rem;
  text-decoration: none;
}

/* Inline form (e.g., logout in nav bar) */
.inline-form {
  display: inline;
  margin: 0;
}

/* Responsive checkbox grid (e.g., location selection) */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.25rem;
}

/* Denser grid for municipality lists */
.location-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* Normal-weight label (checkbox labels) */
.label-normal {
  font-weight: normal;
}

/* Hierarchical location selector */
#location-selector {
  max-width: 28rem;
}

.location-county {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.25rem;
}

.location-county-header {
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.location-county-label {
  flex: 1;
  cursor: pointer;
  margin: 0;
}

.location-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.location-toggle:hover {
  color: var(--text);
}

.location-count {
  font-weight: normal;
  font-size: 0.85rem;
}

.location-municipalities {
  padding: 0.25rem 0.75rem 0.5rem 1.75rem;
  border-top: 1px solid var(--border);
}

.location-municipalities.hidden {
  display: none;
}

/* Pre-formatted text with inherited font (cover letters) */
.pre-wrap {
  white-space: pre-wrap;
  font-family: inherit;
}

/* Skeleton width variants (CSP-safe, no inline styles) */
.skeleton.w-90 {
  width: 90%;
}
.skeleton.w-85 {
  width: 85%;
}
.skeleton.w-75 {
  width: 75%;
}
.skeleton.w-60 {
  width: 60%;
}

/* Cover letter length slider */
.length-slider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.length-slider input[type="range"] {
  flex: 1;
}

.length-label-left,
.length-label-right {
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Notification threshold slider */
[data-field]:has(#min_relevance_score) {
  max-width: 24rem;
}

.threshold-slider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.threshold-slider input[type="range"] {
  flex: 1;
}

.threshold-label-left,
.threshold-label-right {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.threshold-tick-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0 2px;
  margin-top: -0.25em;
}

/* Monospace editor (admin prompt textarea) */
.mono-editor {
  font-family: monospace;
  white-space: pre;
}

/* Pipeline progress */
.pipeline-progress {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.pipeline-progress.hidden {
  display: none;
}

.pipeline-phase {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.pipeline-phase:last-child {
  border-bottom: none;
}

.pipeline-phase-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

.pipeline-phase.current .pipeline-phase-status {
  color: var(--accent, var(--link));
}

.pipeline-phase.done .pipeline-phase-status {
  color: var(--success, green);
}

.pipeline-detail {
  width: 100%;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-error {
  color: var(--danger, red);
  font-size: 0.9rem;
}

/* Admin pipeline status flowchart */
.pipeline-user-row {
  max-width: none;
}

.pipeline-row-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.pipeline-row-meta {
  font-size: 0.85rem;
}

.pipeline-flowchart {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: var(--space-2) 0;
}

.pipeline-connector {
  width: 2rem;
  min-width: 1.5rem;
  height: 2px;
  background: var(--border);
  align-self: center;
  margin-top: -1rem;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5rem;
  gap: 0.25rem;
}

.pipeline-node-circle {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface, #f5f5f5);
  transition: all 0.3s ease;
}

.pipeline-node.active .pipeline-node-circle {
  border-color: var(--success, #2a7d2e);
  background: var(--success, #2a7d2e);
  box-shadow: 0 0 8px rgba(42, 125, 46, 0.4);
  animation: pulse-node 1.5s ease-in-out infinite;
}

.pipeline-node.done .pipeline-node-circle {
  border-color: var(--success, #2a7d2e);
  background: var(--success, #2a7d2e);
}

.pipeline-node.error .pipeline-node-circle {
  border-color: var(--danger, #c53030);
  background: var(--danger, #c53030);
}

@keyframes pulse-node {
  0%, 100% { box-shadow: 0 0 4px rgba(42, 125, 46, 0.3); }
  50% { box-shadow: 0 0 12px rgba(42, 125, 46, 0.6); }
}

.pipeline-node-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pipeline-node-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.pipeline-live-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.2em;
}

.pipeline-live-detail:empty {
  display: none;
}

/* Wave footer */
.wave-footer {
  margin-top: var(--space-16);
  padding-bottom: var(--space-8);
  overflow: hidden;
  line-height: 0;
}

.wave-footer canvas {
  display: block;
  width: 100%;
  height: 60px;
  opacity: 0.8;
}
