/*
 * ZHR Quiz – Styles (v1.4)
 *
 * This stylesheet defines the appearance of the five‑dimensional quiz
 * for the WordPress site pojutrze.zhr.pl. It utilises neutral grey
 * backgrounds and a dark green accent (#02544a) to align with the
 * site’s branding. Theme variables provided by WordPress (prefixed
 * --wp--) are used when available, with sensible fallbacks. The
 * quiz comprises a start screen, question screens with a progress
 * indicator showing percentage complete, and a single result card
 * tinted by an accent derived from the matching role’s cord. A
 * motivational message appears below the result.
 */

/* Base font and colour inheritance */
#zhr-quiz, .zhr-quiz {
  font-family: "Dual", var(--wp--preset--font-family--system, system-ui,
    -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", Helvetica, Arial);
  color: var(--zhr-fg, var(--wp--preset--color--contrast, #0f172a));
}

/* Root custom properties with fallbacks. The default accent (#02544a) matches
   pojutrze.zhr.pl. Theme variables override where defined. */
:root {
  --zhr-accent: #02544a;
  --zhr-muted: var(--wp--preset--color--muted, #6b7280);
  --zhr-fg: var(--wp--preset--color--contrast, #0f172a);
  --zhr-surface: var(--wp--preset--color--base, #f3f4f6);
  --zhr-surface-2: var(--wp--preset--color--subtle-background, #eef2f7);
  --zhr-border: var(--wp--custom--color--border, #e5e7eb);
}

/* Dark mode overrides: swap surfaces and borders for darker tones */
@media (prefers-color-scheme: dark) {
  :root {
    --zhr-fg: #e5e7eb;
    --zhr-surface: #1f2937;
    --zhr-surface-2: #111827;
    --zhr-border: #374151;
    --zhr-muted: #9ca3af;
  }
}

/* Quiz container styling */
.zhr-quiz {
  background: var(--zhr-surface);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--zhr-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  box-sizing: border-box;
}

/* Progress bar container: percentage text and bar */
.zhrq-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.zhrq-progress {
  flex: 1;
  height: 6px;
  background: var(--zhr-surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.zhrq-bar {
  height: 100%;
  width: 0%;
  background: var(--zhr-accent);
  transition: width 0.25s ease;
}
.zhrq-progress-text {
  font-size: 12px;
  color: var(--zhr-muted);
  white-space: nowrap;
}

/* Introductory screen */
.zhrq-intro {
  text-align: left;
}
.zhrq-intro-title {
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  margin-bottom: 8px;
}
.zhrq-intro-desc {
  font-size: 14px;
  color: var(--zhr-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.zhrq-start {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  background: var(--zhr-accent);
  color: #f0fdf4;
  transition: filter 0.15s ease;
}
.zhrq-start:hover {
  filter: brightness(1.05);
}

/* Question presentation */
.zhrq-question {
  min-height: 96px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}
.zhrq-qmeta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--zhr-muted);
  font-weight: 400;
}

/* Buttons for answers */
.zhrq-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.zhrq-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--zhr-border);
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.04s ease, filter 0.15s ease;
}
.zhrq-no {
  background: var(--zhr-surface-2);
  color: var(--zhr-fg);
}
.zhrq-no:hover {
  filter: brightness(0.98);
}
.zhrq-yes {
  background: var(--zhr-accent);
  color: #f0fdf4;
  border-color: transparent;
}
.zhrq-yes:hover {
  filter: brightness(1.05);
}
.zhrq-btn:active {
  transform: translateY(1px);
}
.zhrq-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Result area */
.zhrq-result {
  margin-top: 16px;
  border-top: 1px solid var(--zhr-border);
  padding-top: 16px;
}

/* Card for the single match. Dynamic accent is provided via --zhr-accent-dyn inline style */
.zhrq-match {
  --accent: var(--zhr-accent-dyn, var(--zhr-accent));
  position: relative;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.02)),
    var(--zhr-surface);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--zhr-border));
  border-radius: 16px;
  padding: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}
.zhrq-match::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  pointer-events: none;
  background:
    radial-gradient(120px 60px at 14% 0%, color-mix(in srgb, var(--accent) 18%, transparent) 0, transparent 70%),
    radial-gradient(160px 80px at 90% 100%, color-mix(in srgb, var(--accent) 12%, transparent) 0, transparent 75%);
}
.zhrq-match-label {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--zhr-muted);
  margin-bottom: 6px;
}
.zhrq-match-name {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  line-height: 1.15;
}
.zhrq-match-sznur {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 10%, var(--zhr-fg));
  background: color-mix(in srgb, var(--accent) 12%, var(--zhr-surface));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--zhr-border));
}

/* Motivational message below result */
.zhrq-message {
  margin-top: 10px;
  font-size: 12px;
  color: var(--zhr-muted);
  line-height: 1.5;
}

/* Utility classes */
.zhrq-note {
  font-size: 12px;
  color: var(--zhr-muted);
}
.zhrq-chip {
  background: var(--zhr-surface-2);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
}