/* =========================================================
   19. QUESTION OVERLAY PANEL
   ========================================================= */

.bb-question-panel {
  position: absolute;
  z-index: 7000;

  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);

  width: 740px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.bb-question-panel.is-open {
  z-index: 7000;
}

.bb-question-panel::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);

  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 18px solid #fff;
}

.bb-question-panel-inner {
  position: relative;
  padding: 28px 36px 30px 36px;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

.bb-question-panel-close {
  position: absolute;
  top: 16px;
  right: 22px;

  background: transparent;
  border: none;
  color: #222;

  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.bb-question-panel-title {
  margin-bottom: 22px;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #222;
}

.bb-question-panel-rule {
  height: 1px;
  margin: 0 0 18px 0;
  background: #cfcfcf;
}

.bb-question-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 38px;
  margin-bottom: 24px;
}

.bb-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  color: #222;
}

.bb-legend-current,
.bb-legend-unanswered,
.bb-legend-review {
  display: inline-block;
}

/* current marker */
.bb-legend-current {
  position: relative;
  width: 18px;
  height: 18px;
  border: 3px solid #222;
  border-radius: 50%;
}

.bb-legend-current::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);

  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #222;
}

/* unanswered */
.bb-legend-unanswered {
  width: 22px;
  height: 22px;
  border: 2px dashed #333;
}

/* review */
.bb-legend-review {
  position: relative;
  width: 0;
  height: 0;
  border-left: 10px solid #cc3b52;
  border-right: 10px solid #cc3b52;
  border-top: 0 solid transparent;
  border-bottom: 18px solid transparent;
}

.bb-legend-review::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 18px;
  width: 20px;
  height: 6px;
  background: #cc3b52;
}

.bb-question-grid {
  display: grid;
  grid-template-columns: repeat(7, 46px);
  justify-content: center;
  gap: 22px;
  padding: 18px 0 30px 0;
}

.bb-question-box {
  width: 46px;
  height: 46px;

  background: #fff;
  color: #3a53d4;
  border: 1.5px dashed #333;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.bb-question-box.bb-answered {
  background: #3a53d4;
  color: #fff;
  border: 1.5px solid #3a53d4;
}

.bb-question-box.bb-current {
  position: relative;
}

.bb-question-box.bb-current::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);

  width: 14px;
  height: 14px;
  box-sizing: border-box;

  background: #fff;
  border: 3px solid #222;
  border-radius: 50%;
}

.bb-question-box.bb-current::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);

  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 7px solid #222;
}

.bb-question-panel-footer {
  display: flex;
  justify-content: center;
}

.bb-review-page-btn {
  min-width: 235px;
  padding: 14px 28px;

  background: #fff;
  color: #3553d8;
  border: 1.8px solid #3553d8;
  border-radius: 999px;

  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

/* =========================================================
   21. QUESTION PANEL GRID / DYNAMIC STATE
   ========================================================= */

.bb-question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 44px));
  gap: 18px 22px;
  justify-content: start;
}

.bb-question-grid-item {
  position: relative;
  width: 44px;
  height: 44px;
  border: 2px dashed #666;
  background: #fff;
  color: #3553d8;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.bb-question-grid-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bb-question-grid-item.is-answered {
  background: #3553d8;
  border-color: #3553d8;
  color: #fff;
}

.bb-question-grid-item.is-review .bb-question-grid-flag {
  position: absolute !important;
  top: -8px !important;
  right: -6px !important;
  left: auto !important;
  transform: none !important;

  width: 12px !important;
  height: 14px !important;

  background: #c83b52 !important;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%) !important;
  z-index: 3 !important;
}

.bb-question-grid-item.is-current .bb-question-grid-current {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 18px;
}

.bb-question-grid-item.is-current .bb-question-grid-current::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 16px;
  transform: translateX(-50%);
  border: 3px solid #2b2b2b;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
}

.bb-question-grid-item.is-current .bb-question-grid-current::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 13px solid #2b2b2b;
}

.bb-question-grid-item.is-current.is-answered .bb-question-grid-current::before {
  background: #fff;
}

.bb-question-grid-item.is-current.is-review .bb-question-grid-flag {
  z-index: 4 !important;
}

/* =========================================================
   QUESTION PANEL LEGEND – sync with grid markers
   ========================================================= */

:root {
  /* tekst legende */
  --bb-qp-legend-text-size: 20px;
  --bb-qp-legend-gap: 10px;
  --bb-qp-legend-label-offset-y: 0px;

  /* Current */
  --bb-qp-legend-current-circle: 14px;
  --bb-qp-legend-current-pointer-w: 15px;
  --bb-qp-legend-current-pointer-h: 12px;
  --bb-qp-legend-current-total-w: 10px;
  --bb-qp-legend-current-total-h: 22px;
  --bb-qp-legend-current-offset-y: -1.5px;

  /* Unanswered */
  --bb-qp-legend-unanswered-size: 20px;
  --bb-qp-legend-unanswered-offset-y: -2px;

  /* For Review */
  --bb-qp-legend-review-w: 16px;
  --bb-qp-legend-review-h: 20px;
  --bb-qp-legend-review-offset-y: -1px;
}

/* mala kontrola za pomeranje teksta u odnosu na ikonicu */
.bb-legend-item {
  position: relative;
}

.bb-legend-item > span:last-child,
.bb-legend-item {
  top: var(--bb-qp-legend-label-offset-y);
}

/* reset zajednički */
.bb-legend-current,
.bb-legend-unanswered,
.bb-legend-review {
  position: relative !important;
  display: inline-block !important;
  flex: 0 0 auto !important;
  vertical-align: middle !important;
}

/* ---------------------------------------------------------
   A) CURRENT u legendi = isti marker kao iznad aktivnog pitanja
   --------------------------------------------------------- */

.bb-legend-current {
  width: var(--bb-qp-legend-current-total-w) !important;
  height: var(--bb-qp-legend-current-total-h) !important;
  top: var(--bb-qp-legend-current-offset-y) !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
}

.bb-legend-current::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;

  width: var(--bb-qp-legend-current-circle) !important;
  height: var(--bb-qp-legend-current-circle) !important;
  box-sizing: border-box !important;

  border: 3px solid #2b2b2b !important;
  border-radius: 50% !important;
  background: #fff !important;
}

.bb-legend-current::after {
  content: "" !important;
  position: absolute !important;
  top: 9px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;

  width: 0 !important;
  height: 0 !important;
  border-left: calc(var(--bb-qp-legend-current-pointer-w) / 2) solid transparent !important;
  border-right: calc(var(--bb-qp-legend-current-pointer-w) / 2) solid transparent !important;
  border-top: var(--bb-qp-legend-current-pointer-h) solid #2b2b2b !important;
}


/* ---------------------------------------------------------
   UNANSWERED
   --------------------------------------------------------- */

.bb-legend-unanswered {
  width: var(--bb-qp-legend-unanswered-size) !important;
  height: var(--bb-qp-legend-unanswered-size) !important;
  top: var(--bb-qp-legend-unanswered-offset-y) !important;
  box-sizing: border-box !important;
  border: 2px dashed #666 !important;
  background: #fff !important;
}

/* ---------------------------------------------------------
   FOR REVIEW
   --------------------------------------------------------- */

.bb-legend-review {
  width: var(--bb-qp-legend-review-w) !important;
  height: var(--bb-qp-legend-review-h) !important;
  top: var(--bb-qp-legend-review-offset-y) !important;
  background: #c83b52 !important;
  border: none !important;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%) !important;
}

.bb-legend-review::before,
.bb-legend-review::after {
  content: none !important;
}