/* =========================================================
   RW HIGHLIGHTS HEADER
   ========================================================= */

.bb-rw-tool-btn {
  position: relative;
  display: grid;
  grid-template-rows: 28px 22px;
  justify-items: center;
  align-items: start;

  min-width: 88px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;

  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  transform: none;
}

.bb-rw-tool-btn-label {
  grid-row: 2;
  display: block;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  margin: 0;
  padding: 0;
}

.bb-rw-highlights-toggle .bb-rw-tool-btn-label {
  font-size: 18px; /* vel. fonta */
  font-weight: 600;
  line-height: 1.05;
  position: relative;
  top: -1px;  /*podigni naziv Higlights & Notes */
}

.bb-rw-highlights-toggle {
  width: 150px;
  margin-top: 0.5px;
  text-decoration: none;
  justify-items: center;
}

.bb-rw-highlights-icon {
  grid-row: 1;
  display: block;
  width: auto;
  height: 22px;
  max-width: 40px;
  object-fit: contain;
  margin: 0;
  justify-self: center;
  align-self: end;
  margin-left: auto;
  margin-right: auto;
  transform: translateY(-10px);
}

.bb-rw-tool-icon {
  grid-row: 1;
  display: block;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  margin: 0;
  transform: translateY(-9px);
}

.bb-rw-highlights-toggle.is-on .bb-rw-tool-btn-label {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

body.bb-rw-highlights-on .bb-passage,
body.bb-rw-highlights-on .bb-question {
  cursor: text;
}

/* --- tooltip for Highlights & Notes --- */
.bb-tool-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  display: none;

  width: 200px;              /* uzi panel */
  min-width: 200px;
  padding: 20px 14px;
  border-radius: 12px;

  background: #595959;
  color: #fff;
  font-size: 19px;           /* oko 20% vece */
  font-weight: 400;          /* samo prvi red ce biti bold */
  line-height: 1.32;
  text-align: left;

  z-index: 3000;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.bb-tool-tooltip strong {
  font-weight: 700;
}

.bb-tool-tooltip::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #595959;
}

.bb-rw-highlights-toggle:hover .bb-tool-tooltip,
.bb-rw-highlights-toggle:focus-visible .bb-tool-tooltip {
  display: block;
}

/* =========================================================
   RW HIGHLIGHTS TOOLBAR + COLORS
   ========================================================= */

.bb-rw-highlights-toolbar {
  position: absolute;
  z-index: 7000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cfcfcf;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.bb-rw-highlights-toolbar[hidden] {
  display: none !important;
}

.bb-rw-highlights-toolbar::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  z-index: 7001;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #ffffff;
}

.bb-rw-highlight-color,
.bb-rw-icon-btn {
  width: 46px;
  height: 46px;
  border: 2px solid #9c9c9c;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.bb-rw-highlight-color[data-color="yellow"] {
  background: #f7e36d;
}

.bb-rw-highlight-color[data-color="blue"] {
  background: #dbeef9;
}

.bb-rw-highlight-color[data-color="magenta"] {
  background: #ead4e6;
}

.bb-rw-highlight-color.is-active {
  box-shadow: inset 0 0 0 2px #c78e00;
}

.bb-rw-highlight-color.is-active::after {
  content: "💧";
  font-size: 13px;
  line-height: 1;
}

.bb-rw-icon-btn img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.bb-rw-highlight-divider {
  width: 1px;
  height: 28px;
  background: #d4d4d4;
}

/* --- U toggle --- */

.bb-rw-underline-wrap {
  position: relative;
}

.bb-rw-underline-toggle {
  min-width: 58px;
  height: 46px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bb-rw-u-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.bb-rw-u-stack--menu {
  min-width: 34px;
}

.bb-rw-u-char {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.bb-rw-u-line {
  display: block;
  width: 28px;
  border-bottom-width: 2px;
  border-bottom-color: #333;
  border-bottom-style: solid;
  line-height: 0;
}

.bb-rw-u-line-solid {
  border-bottom-style: solid;
}

.bb-rw-u-line-dashed {
  border-bottom-style: dashed;
}

.bb-rw-u-line-dotted {
  border-bottom-style: dotted;
}

.bb-rw-underline-caret {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}

.bb-rw-underline-toggle.is-open .bb-rw-underline-caret {
  transform: rotate(180deg);
}

/* --- U dropdown --- */

.bb-rw-underline-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 88px;
  background: #f2f2f2;
  border: 1px solid #d2d2d2;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  padding: 6px 0;
  z-index: 5100;
}

.bb-rw-underline-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}

.bb-rw-underline-item:hover,
.bb-rw-underline-item.is-active {
  background: #dcecff;
}

.bb-rw-underline-item-none {
  text-align: left;
  font-size: 15px;
  padding-left: 18px;
}

/* --- applied highlight styles --- */

.bb-rw-highlight {
  border-radius: 2px;
  padding: 0 1px;
}

.bb-rw-highlight-yellow {
  background: #f7e36d;
}

.bb-rw-highlight-blue {
  background: #dbeef9;
}

.bb-rw-highlight-magenta {
  background: #ead4e6;
}

.bb-rw-underline-solid {
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.bb-rw-underline-dashed {
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.bb-rw-underline-dotted {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.bb-rw-highlight-has-note {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* =========================================================
   RW toolbar fine tuning
   ========================================================= */

/* --- color circles: normal / hover / active --- */

.bb-rw-highlight-color {
  border: 2px solid #9c9c9c;
  transition: background-color 0.15s ease, border-width 0.15s ease, border-color 0.15s ease;
}

.bb-rw-highlight-color:hover,
.bb-rw-highlight-color:focus-visible {
  border-width: 4px;
}

.bb-rw-highlight-color[data-color="yellow"]:hover,
.bb-rw-highlight-color[data-color="yellow"]:focus-visible {
  background: #ead25a;
}

.bb-rw-highlight-color[data-color="blue"]:hover,
.bb-rw-highlight-color[data-color="blue"]:focus-visible {
  background: #c3e2f0;
}

.bb-rw-highlight-color[data-color="magenta"]:hover,
.bb-rw-highlight-color[data-color="magenta"]:focus-visible {
  background: #dfbfd5;
}

.bb-rw-highlight-color.is-active {
  border-width: 4px;
  border-color: #9a7b00;
  box-shadow: none;
}

/* --- delete / note circles: hover like color circles --- */

.bb-rw-icon-btn {
  border: 2px solid #9c9c9c;
  transition: background-color 0.15s ease, border-width 0.15s ease, border-color 0.15s ease;
}

.bb-rw-icon-btn:hover,
.bb-rw-icon-btn:focus-visible {
  border-width: 4px;
  background: #efefef;
}

/* --- underline toggle --- */

.bb-rw-underline-toggle {
  min-width: 62px;
  gap: 8px;
}

/* U + lines stack */
.bb-rw-u-stack {
  gap: 4px;   /* veci razmak nego ranije */
}

.bb-rw-u-char {
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

/* linije ispod U */
.bb-rw-u-line {
  width: 30px;
  border-bottom-width: 2px;
}

/* caret da bude vidljiv kao "V" */
.bb-rw-underline-caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  font-size: 0;              /* sakriva tekstualni znak */
  line-height: 0;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 0.2s ease;
  margin-top: -2px;
}

.bb-rw-underline-toggle.is-open .bb-rw-underline-caret {
  transform: rotate(-135deg);
  margin-top: 2px;
}

/* --- underline menu --- */

.bb-rw-underline-menu {
  min-width: 90px;
}

.bb-rw-underline-item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 10px;
}

.bb-rw-underline-item.is-active,
.bb-rw-underline-item:hover {
  background: #dcecff;
}

/* None: centrirano i vece */
.bb-rw-underline-item-none {
  justify-content: center;
  text-align: center;
  padding-left: 0;
  font-size: 21px;   /* ~40% vece od 15px */
  line-height: 1.1;
}

/* menu U primeri da lepo legnu */
.bb-rw-u-stack--menu {
  min-width: 34px;
  gap: 4px;
}

/* --- note marker remains for later logic --- */
.bb-rw-highlight-has-note {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* =========================================================
   RW highlight cursor
   ========================================================= */

body.bb-rw-highlights-on .bb-passage,
body.bb-rw-highlights-on .bb-passage *,
body.bb-rw-highlights-on .bb-question,
body.bb-rw-highlights-on .bb-question * {
  cursor: url("../figures/assets/highlight-cursor.svg") 6 16, text !important;
}

.bb-rw-underline-item-none {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 10px 0 !important;
  margin: 0 !important;
  text-align: center !important;
  font-size: 21px !important;
  line-height: 1.1 !important;
}

.bb-rw-underline-item-none {
  transform: translateX(1px);
}
 