/**
 * Pojo Accessibility Toolbar - Custom overrides
 * Hides original toggle, styles custom float button and close button.
 */

/* Hide the original plugin toggle button (keep in DOM) */
.pojo-a11y-toolbar-toggle {
  display: none !important;
}

/* Custom floating button - bottom-left (same in RTL/LTR) */
.pojo-a11y-float-btn {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 999999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s, box-shadow 0.2s;
}

.pojo-a11y-float-btn:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.pojo-a11y-float-btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.pojo-a11y-float-btn svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  pointer-events: none;
}

@media (max-width: 950px) {
  .pojo-a11y-float-btn {
    width: 40px;
    height: 40px;
    left: 10px;
    bottom: 10px;
  }

  .pojo-a11y-float-btn svg {
    width: 22px;
    height: 22px;
  }
}

/* Toolbar inner needs relative positioning for close button */
.pojo-a11y-toolbar-inner {
  position: relative;
}

/* Close button (X) inside toolbar - position via dir in next rules */
.pojo-a11y-toolbar-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: #000;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s, opacity 0.2s;
}

.pojo-a11y-toolbar-close:hover {
  background-color: #333;
}

.pojo-a11y-toolbar-close:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* LTR: close button on the right of the title row; add padding so title doesn't overlap */
[dir="ltr"] .pojo-a11y-toolbar-inner .pojo-a11y-toolbar-title {
  padding-right: 38px;
}

[dir="ltr"] .pojo-a11y-toolbar-close {
  position: absolute;
  right: 0;
  top: 0;
  margin-right: 0;
}

/* RTL: close button on the left of the title row; add padding so title doesn't overlap */
[dir="rtl"] .pojo-a11y-toolbar-inner .pojo-a11y-toolbar-title {
  padding-left: 38px;
}

[dir="rtl"] .pojo-a11y-toolbar-close {
  position: absolute;
  left: 0;
  top: 0;
  margin-left: 0;
}

/* Fallback for body class if dir not on html */
.rtl .pojo-a11y-toolbar-inner .pojo-a11y-toolbar-title {
  padding-left: 38px;
}

.rtl .pojo-a11y-toolbar-close {
  position: absolute;
  left: 0;
  top: 0;
  margin-left: 0;
}

.ltr .pojo-a11y-toolbar-inner .pojo-a11y-toolbar-title {
  padding-right: 38px;
}

.ltr .pojo-a11y-toolbar-close {
  position: absolute;
  right: 0;
  top: 0;
  margin-right: 0;
}
