/* © 2026 Barnefotballtrener.no. All rights reserved. */
/* onboarding.css — Onboarding wizard styles (v4) */

/* ═══════════════════════════════════════
   OVERLAY
   ═══════════════════════════════════════ */
.ob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: obFadeIn 0.25s ease-out;
  padding: 16px;
}

@keyframes obFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════
   CARD
   ═══════════════════════════════════════ */
.ob-card {
  background: var(--bg-card, #fff);
  border-radius: var(--radius-xl, 20px);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  animation: obSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

/* Scrollable content area (progress + header + body) */
.ob-card-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--text-300, #cbd5e1) transparent;
}

.ob-card-scroll::-webkit-scrollbar { width: 4px; }
.ob-card-scroll::-webkit-scrollbar-track { background: transparent; }
.ob-card-scroll::-webkit-scrollbar-thumb {
  background: var(--text-300, #cbd5e1);
  border-radius: 2px;
}

@keyframes obSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════
   SCROLL LOCK
   ═══════════════════════════════════════ */
body.ob-open {
  overflow: hidden !important;
}

/* ═══════════════════════════════════════
   HEADER
   ═══════════════════════════════════════ */
.ob-header {
  padding: 28px 28px 0;
  text-align: center;
}

.ob-emoji {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}

.ob-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-900, #0f172a);
  margin: 0 0 6px;
  line-height: 1.2;
}

.ob-subtitle {
  font-size: 14px;
  color: var(--text-500, #64748b);
  line-height: 1.45;
  margin: 0;
}

.ob-subtitle strong {
  color: var(--primary, #2563eb);
  font-weight: 700;
}

/* ═══════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════ */
.ob-progress {
  display: flex;
  gap: 8px;
  padding: 20px 28px 0;
  justify-content: center;
  align-items: center;
}

.ob-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border, #e2e8f0);
  transition: background 0.3s, transform 0.3s;
}

.ob-dot.active {
  background: var(--primary, #2563eb);
  transform: scale(1.2);
}

.ob-dot.done {
  background: var(--success, #059669);
}

.ob-step-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-400, #94a3b8);
  margin-left: 12px;
}

/* ═══════════════════════════════════════
   BODY + STEP TRANSITIONS
   ═══════════════════════════════════════ */
.ob-body {
  padding: 24px 28px;
  flex: 1;
  min-height: 0;
}

.ob-step-inner {
  animation: obStepIn 0.22s ease-out;
}

@keyframes obStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════ */
.ob-field {
  margin-bottom: 18px;
}

.ob-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-700, #334155);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.ob-input,
.ob-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  color: var(--text-800, #1e293b);
  background: var(--bg-card, #fff);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.ob-input:focus,
.ob-select:focus {
  border-color: var(--primary-light, #3b82f6);
  box-shadow: 0 0 0 3px var(--primary-glow, rgba(37, 99, 235, 0.15));
}

.ob-input:focus-visible,
.ob-select:focus-visible,
.ob-btn:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}

.ob-input::placeholder { color: var(--text-400, #94a3b8); }

.ob-input.ob-error {
  border-color: var(--error, #dc2626);
  box-shadow: 0 0 0 3px var(--error-dim, rgba(220, 38, 38, 0.1));
}

.ob-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.ob-format-hint {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--primary-dim, rgba(37,99,235,0.08));
  border-radius: var(--radius-sm, 8px);
  font-size: 13px;
  color: var(--primary, #2563eb);
  font-weight: 600;
  text-align: center;
}

.ob-format-hint.visible {
  display: block;
  animation: obFadeIn 0.2s ease-out;
}

/* ═══════════════════════════════════════
   SELECT ERROR STATE
   ═══════════════════════════════════════ */
.ob-select.ob-error {
  border-color: var(--error, #dc2626);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

/* ═══════════════════════════════════════
   TIP CARDS (Step 2 — guidance)
   ═══════════════════════════════════════ */
.ob-tip-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  margin-bottom: 10px;
  animation: obStepIn 0.25s ease-out both;
}

.ob-tip-card:nth-child(1) { animation-delay: 0ms; }
.ob-tip-card:nth-child(2) { animation-delay: 60ms; }
.ob-tip-card:nth-child(3) { animation-delay: 120ms; }
.ob-tip-card:nth-child(4) { animation-delay: 180ms; }

.ob-tip-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  padding-top: 1px;
}

.ob-tip-content {
  flex: 1;
  min-width: 0;
}

.ob-tip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-800, #1e293b);
  margin-bottom: 3px;
  line-height: 1.3;
}

.ob-tip-text {
  font-size: 12px;
  color: var(--text-500, #64748b);
  line-height: 1.45;
}

/* ═══════════════════════════════════════
   EXAMPLE NOTICE (Step 3)
   ═══════════════════════════════════════ */
.ob-example-notice {
  background: var(--warning-bg, #fffbeb);
  border: 1px solid var(--warning-border, #fde68a);
  border-radius: var(--radius-sm, 8px);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--warning-text, #92400e);
  margin-bottom: 14px;
  line-height: 1.45;
}

.ob-example-notice strong {
  color: var(--primary, #2563eb);
  font-weight: 700;
}

/* ═══════════════════════════════════════
   DEMO PLAN (Step 3)
   ═══════════════════════════════════════ */
.ob-demo-wrap {
  background: var(--bg, #f8fafc);
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
}

.ob-demo-header {
  padding: 12px 16px;
  background: var(--primary-dim, rgba(37,99,235,0.08));
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #2563eb);
}

.ob-period {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.ob-period:last-of-type {
  border-bottom: none;
}

.ob-period-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-500, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.ob-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ob-chip {
  padding: 5px 10px;
  border-radius: var(--radius-full, 999px);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  animation: obChipIn 0.2s ease-out both;
}

@keyframes obChipIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.ob-chip-field  { background: var(--success-dim, rgba(5,150,105,0.1)); color: var(--success, #059669); }
.ob-chip-bench  { background: var(--bg-card, #fff); color: var(--text-400, #94a3b8); border: 1px solid var(--border, #e2e8f0); }
.ob-chip-swapin { background: var(--primary-dim, rgba(37,99,235,0.1)); color: var(--primary, #2563eb); }
.ob-chip-keeper { background: var(--warning-dim, rgba(217,119,6,0.1)); color: var(--warning, #d97706); }

.ob-bench-label {
  font-size: 11px;
  color: var(--text-400, #94a3b8);
  font-weight: 600;
  margin-top: 6px;
  margin-bottom: 4px;
}

.ob-demo-footer {
  padding: 12px 16px;
  background: var(--success-dim, rgba(5,150,105,0.08));
  font-size: 13px;
  color: var(--success, #059669);
  font-weight: 600;
  text-align: center;
}

/* Chip legend */
.ob-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg, #f8fafc);
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #e2e8f0);
}

.ob-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-500, #64748b);
  font-weight: 500;
}

.ob-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ob-legend-dot.lg-field   { background: var(--success, #059669); }
.ob-legend-dot.lg-swapin  { background: var(--primary, #2563eb); }
.ob-legend-dot.lg-keeper  { background: var(--warning, #d97706); }
.ob-legend-dot.lg-bench   { background: var(--text-300, #cbd5e1); }

/* Minutes bars */
.ob-bars-section { margin-top: 16px; }

.ob-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.ob-bar-name {
  width: 70px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-700, #334155);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.ob-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border, #e2e8f0);
  border-radius: 4px;
  overflow: hidden;
}

.ob-bar-fill {
  height: 100%;
  background: var(--success, #059669);
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0;
}

.ob-bar-val {
  width: 40px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-500, #64748b);
  flex-shrink: 0;
}

/* Step 3 body: slightly less bottom padding since footer is fixed */
.ob-body-step3 {
  padding-bottom: 8px;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
/* Footer is always at bottom of card (outside scroll area) */
.ob-footer {
  padding: 16px 28px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.ob-btn {
  border: none;
  border-radius: var(--radius-md, 12px);
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ob-btn:active:not(:disabled) { transform: scale(0.97); }

.ob-btn-primary {
  background: var(--primary, #2563eb);
  color: #fff;
  flex: 1;
  text-align: center;
}

.ob-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.ob-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ob-btn-skip {
  background: transparent;
  color: var(--text-400, #94a3b8);
  padding: 13px 16px;
  font-weight: 500;
}
.ob-btn-skip:hover { color: var(--text-600, #475569); }

.ob-btn-back {
  background: transparent;
  color: var(--text-500, #64748b);
  padding: 13px 16px;
}
.ob-btn-back:hover { color: var(--text-700, #334155); }

.ob-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: obSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes obSpin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   EXIT ANIMATION
   ═══════════════════════════════════════ */
.ob-overlay.ob-closing {
  animation: obFadeOut 0.25s ease-in forwards;
  pointer-events: none;
}

.ob-overlay.ob-closing .ob-card {
  animation: obSlideDown 0.25s ease-in forwards;
}

@keyframes obFadeOut { to { opacity: 0; } }
@keyframes obSlideDown { to { transform: translateY(24px); opacity: 0; } }

/* ═══════════════════════════════════════
   CONFETTI
   ═══════════════════════════════════════ */
.ob-confetti {
  position: fixed;
  inset: 0;
  z-index: 10010;
  pointer-events: none;
}

/* ═══════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════ */
@media (max-width: 500px) {
  .ob-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .ob-card {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    min-height: 60dvh;
    border-radius: var(--radius-xl, 20px) var(--radius-xl, 20px) 0 0;
    animation: obSlideUpMobile 0.3s ease-out;
  }
  @keyframes obSlideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .ob-overlay.ob-closing .ob-card {
    animation: obSlideDownMobile 0.25s ease-in forwards;
  }
  @keyframes obSlideDownMobile {
    to { transform: translateY(100%); opacity: 0; }
  }
  .ob-header  { padding: 24px 20px 0; }
  .ob-body    { padding: 20px 20px; }
  .ob-footer  {
    padding: 14px 20px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .ob-progress { padding: 16px 20px 0; }
  .ob-emoji   { font-size: 36px; }
  .ob-title   { font-size: 20px; }
  .ob-bar-name { width: 55px; font-size: 11px; }
  .ob-legend  { gap: 8px; padding: 8px 10px; }

  /* Tip cards: tighter on mobile */
  .ob-tip-card {
    padding: 12px;
    gap: 10px;
  }
  .ob-tip-icon { font-size: 20px; width: 24px; }
  .ob-tip-title { font-size: 12.5px; }
  .ob-tip-text { font-size: 11.5px; }
}

/* ═══════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  .ob-overlay { background: rgba(0, 0, 0, 0.65); }
  .ob-card    { box-shadow: 0 24px 80px rgba(0,0,0,0.5); }
  .ob-card::-webkit-scrollbar-thumb { background: var(--text-600, #475569); }
  .ob-card-scroll::-webkit-scrollbar-thumb { background: var(--text-600, #475569); }
  .ob-card-scroll { scrollbar-color: var(--text-600, #475569) transparent; }
  .ob-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  }
  .ob-chip-bench { background: rgba(255,255,255,0.05); }
  .ob-legend     { background: rgba(255,255,255,0.03); }
  .ob-footer { border-top-color: var(--border-dark, rgba(255,255,255,0.08)); }
  .ob-example-notice {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
    color: var(--warning, #fbbf24);
  }
  .ob-tip-card {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.08);
  }
  .ob-tip-title { color: var(--text-200, #e2e8f0); }
}

/* ═══════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ob-card          { animation: none; }
  .ob-overlay.ob-closing .ob-card { animation: none; }
  .ob-bar-fill      { transition: none; }
  .ob-dot           { transition: none; }
  .ob-format-hint   { transition: none; }
  .ob-confetti      { display: none; }
  .ob-tip-card      { animation: none; }
}
