/* ============================================================
   🧱 base.css — Reset & globals (BOOTSTRAP-FIRST)
   Verhaaf DEF — 2025
============================================================ */

/* ------------------------------------------------------------
   🔄 Reset (veilig naast Bootstrap)
------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ------------------------------------------------------------
   🌍 HTML & Body
------------------------------------------------------------ */
html {
  -webkit-text-size-adjust: 100%; /* iOS zoom fix */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;

  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "Noto Sans", "Liberation Sans", sans-serif;

  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;

  color: #212529;              /* Bootstrap text kleur */
  background-color: #f6f7f9;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------
   🧠 Typografie helpers
------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #111827;
}

p {
  margin-bottom: 0.75rem;
}

small {
  color: #6b7280;
}

/* ------------------------------------------------------------
   🔗 Links
------------------------------------------------------------ */
a {
  color: #0d6efd;
  text-decoration: none;
}

a:hover {
  color: #0b5ed7;
  text-decoration: underline;
}

/* ------------------------------------------------------------
   🖱️ Buttons & inputs (Bootstrap blijft leidend)
------------------------------------------------------------ */
button {
  font-family: inherit;
}

input,
select,
textarea,
button {
  font-size: inherit;
}

/* ------------------------------------------------------------
   📱 Media defaults
------------------------------------------------------------ */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------------
   📦 Utility helpers (licht, optioneel)
------------------------------------------------------------ */
.hidden {
  display: none !important;
}

.text-muted {
  color: #6b7280 !important;
}

.fw-semibold {
  font-weight: 600 !important;
}

.w-sm-auto {
  width: 100%;
}

@media (min-width: 576px) {
  .w-sm-auto {
    width: auto;
  }
}

/* ------------------------------------------------------------
   🔔 Popup meldingen (alert replacement)
------------------------------------------------------------ */
.vf-popup-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  z-index: 1055; /* boven Bootstrap components */
  pointer-events: none;
}

.vf-popup-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  background: transparent;
  opacity: 0;
  transition: opacity 180ms ease;
}

.vf-popup {
  min-width: 280px;
  max-width: 92vw;
  padding: 18px 22px;
  border-radius: 16px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(6px);
}

.vf-popup-overlay--show {
  opacity: 1;
}

.vf-popup-overlay--hide {
  opacity: 0;
}

.vf-popup--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.vf-popup--hide {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.vf-popup--success {
  background: rgba(18, 128, 68, 0.85);
}

.vf-popup--error {
  background: rgba(176, 38, 38, 0.85);
}

/* ------------------------------------------------------------
   Coach live feedback
------------------------------------------------------------ */
.live-feedback {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #cfe2ff;
  border-left: 4px solid #0d6efd;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}

.live-feedback__label {
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e7f1ff;
  color: #084298;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.live-feedback__title {
  color: #1f2937;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.live-feedback__toggle {
  appearance: none;
  border: 1px solid #b6d4fe;
  border-radius: 6px;
  background: #ffffff;
  color: #084298;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  padding: 7px 10px;
}

.live-feedback__toggle:hover,
.live-feedback__toggle:focus {
  background: #e7f1ff;
  outline: none;
}

.live-feedback__details {
  grid-column: 2 / 4;
  display: grid;
  gap: 6px;
  padding-top: 2px;
  border-top: 1px solid rgba(13, 110, 253, 0.12);
}

.live-feedback.is-collapsed .live-feedback__details {
  display: none;
}

.live-feedback__text {
  color: #495057;
  font-size: 0.92rem;
  line-height: 1.35;
}

.live-feedback__trail {
  display: grid;
  gap: 4px;
}

.live-feedback__trail:empty {
  display: none;
}

.live-feedback__trail-item {
  display: grid;
  gap: 1px;
  padding-top: 5px;
  border-top: 1px solid rgba(13, 110, 253, 0.14);
}

.live-feedback__trail-item span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}

.live-feedback__trail-item small {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.25;
}

.live-feedback.is-success {
  border-color: #badbcc;
  border-left-color: #198754;
  background: #f6fbf8;
}

.live-feedback.is-success .live-feedback__label {
  background: #d1e7dd;
  color: #0f5132;
}

.live-feedback.is-warning {
  border-color: #ffecb5;
  border-left-color: #ffc107;
  background: #fffdf5;
}

.live-feedback.is-warning .live-feedback__label {
  background: #fff3cd;
  color: #664d03;
}

.live-feedback.is-danger {
  border-color: #f5c2c7;
  border-left-color: #dc3545;
  background: #fff8f8;
}

.live-feedback.is-danger .live-feedback__label {
  background: #f8d7da;
  color: #842029;
}

@media (max-width: 576px) {
  .live-feedback {
    top: 4px;
    grid-template-columns: 1fr auto;
  }

  .live-feedback__label,
  .live-feedback__details {
    grid-column: 1 / 3;
  }

  .live-feedback__label {
    width: max-content;
    min-width: 0;
  }
}
