/* =========================================================
   Widget Aksesibilitas BSJLJ - Gaya UserWay Eksak
   ========================================================= */

:root {
  --bsjlj-uw-blue: #004bff;
  --bsjlj-uw-blue-dark: #0037cc;
  --bsjlj-uw-text: #2c2d30;
  --bsjlj-uw-muted: #6b7280;
  --bsjlj-uw-border: #e5e7eb;
  --bsjlj-uw-bg: #ffffff;
  --bsjlj-uw-bg-soft: #f4f6f8;
  --bsjlj-uw-shadow: 0 12px 38px rgba(0, 0, 0, 0.16);
}

/* Position Configurations */
html.bsjlj-uw-pos-left #bsjlj-uw-button {
  left: 24px !important;
  right: auto !important;
}
html.bsjlj-uw-pos-left #bsjlj-uw-panel {
  left: 24px !important;
  right: auto !important;
}

html.bsjlj-uw-pos-right #bsjlj-uw-button {
  right: 24px !important;
  left: auto !important;
}
html.bsjlj-uw-pos-right #bsjlj-uw-panel {
  right: 24px !important;
  left: auto !important;
}

html.bsjlj-uw-pos-hidden #bsjlj-uw-button {
  display: none !important;
}

/* Tombol bulat pojok kanan atas */
#bsjlj-uw-button {
  position: fixed !important;
  right: 24px;
  top: 24px;
  bottom: auto !important;
  width: 58px !important;
  height: 58px !important;
  z-index: 2147483646 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--bsjlj-uw-blue) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 75, 255, .32) !important;
  cursor: pointer !important;
  outline: none !important;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

#bsjlj-uw-button:hover,
#bsjlj-uw-button:focus-visible {
  background: var(--bsjlj-uw-blue-dark) !important;
  transform: scale(1.04) !important;
  box-shadow: 0 10px 28px rgba(0, 75, 255, .42) !important;
}

#bsjlj-uw-button svg {
  width: 52px !important;
  height: 52px !important;
  fill: currentColor !important;
  pointer-events: none !important;
}

/* Panel utama */
#bsjlj-uw-panel {
  position: fixed !important;
  right: 24px;
  top: 94px;
  bottom: auto !important;
  width: 400px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 118px) !important;
  z-index: 2147483646 !important;
  display: none !important;
  overflow: hidden !important;
  border: 1px solid rgba(0, 0, 0, .06) !important;
  border-radius: 24px !important;
  background: var(--bsjlj-uw-bg) !important;
  color: var(--bsjlj-uw-text) !important;
  box-shadow: var(--bsjlj-uw-shadow) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  letter-spacing: normal !important;
  transition: width 0.2s ease !important;
}

#bsjlj-uw-panel.bsjlj-uw-open {
  display: block !important;
  animation: bsjljUwPop .18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes bsjljUwPop {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#bsjlj-uw-panel,
#bsjlj-uw-panel * {
  box-sizing: border-box !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  text-transform: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* Header */
#bsjlj-uw-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 56px !important;
  padding: 14px 20px !important;
  background: var(--bsjlj-uw-blue) !important;
  color: #fff !important;
}

#bsjlj-uw-title {
  margin: 0 !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

/* Body */
#bsjlj-uw-body {
  max-height: calc(100vh - 180px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 20px 20px 16px !important;
  background: var(--bsjlj-uw-bg-soft) !important;
}

/* Scrollbar styling */
#bsjlj-uw-body::-webkit-scrollbar { width: 6px !important; }
#bsjlj-uw-body::-webkit-scrollbar-track { background: var(--bsjlj-uw-bg-soft) !important; }
#bsjlj-uw-body::-webkit-scrollbar-thumb { background: #d1d5db !important; border-radius: 8px !important; }

/* Tombol "Cara Kerja UserWay" */
#bsjlj-uw-how-it-works {
  width: 100% !important;
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--bsjlj-uw-blue) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0, 75, 255, .18) !important;
  margin-bottom: 16px !important;
  transition: background-color 0.2s, transform 0.15s !important;
}

#bsjlj-uw-how-it-works:hover {
  background: var(--bsjlj-uw-blue-dark) !important;
}

#bsjlj-uw-how-it-works:active {
  transform: scale(0.985) !important;
}

.bsjlj-uw-play-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.2) !important;
  padding: 4px !important;
}

.bsjlj-uw-play-icon svg {
  width: 10px !important;
  height: 10px !important;
  fill: #fff !important;
}

/* Baris Widget kebesaran */
#bsjlj-uw-oversized-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 2px 4px 16px !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: var(--bsjlj-uw-text) !important;
  border-bottom: 1px solid var(--bsjlj-uw-border) !important;
  margin-bottom: 16px !important;
}

/* iOS Toggle Switch */
.bsjlj-uw-switch {
  position: relative !important;
  display: inline-block !important;
  width: 46px !important;
  height: 24px !important;
}

.bsjlj-uw-switch input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.bsjlj-uw-slider {
  position: absolute !important;
  cursor: pointer !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background-color: #d1d5db !important;
  transition: .25s !important;
  border-radius: 24px !important;
}

.bsjlj-uw-slider:before {
  position: absolute !important;
  content: "" !important;
  height: 18px !important;
  width: 18px !important;
  left: 3px !important;
  bottom: 3px !important;
  background-color: white !important;
  transition: .25s !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

.bsjlj-uw-switch input:checked + .bsjlj-uw-slider {
  background-color: var(--bsjlj-uw-blue) !important;
}

.bsjlj-uw-switch input:checked + .bsjlj-uw-slider:before {
  transform: translateX(22px) !important;
}

/* Grid Kartu */
#bsjlj-uw-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

/* Desain Kartu */
.bsjlj-uw-card {
  min-height: 110px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 16px 10px !important;
  margin: 0 !important;
  border: 1px solid var(--bsjlj-uw-border) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  color: var(--bsjlj-uw-text) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
  cursor: pointer !important;
  outline: none !important;
  position: relative !important;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background-color .15s ease !important;
}

.bsjlj-uw-card:hover,
.bsjlj-uw-card:focus-visible {
  border-color: #b3caff !important;
  box-shadow: 0 4px 12px rgba(0, 75, 255, .05) !important;
}

.bsjlj-uw-card:active {
  transform: scale(.975) !important;
}

/* Indikator aktif dengan border biru tebal dan bg lembut */
.bsjlj-uw-card.bsjlj-uw-active {
  border: 2px solid var(--bsjlj-uw-blue) !important;
  background-color: #f5f8ff !important;
  box-shadow: 0 4px 14px rgba(0, 75, 255, 0.08) !important;
}

.bsjlj-uw-card.bsjlj-uw-active .bsjlj-uw-card-icon {
  color: var(--bsjlj-uw-blue) !important;
}

.bsjlj-uw-card.bsjlj-uw-active .bsjlj-uw-card-label {
  color: var(--bsjlj-uw-blue) !important;
}

.bsjlj-uw-card-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  color: #111827 !important;
  transition: color 0.15s ease !important;
}

.bsjlj-uw-card-icon svg {
  width: 26px !important;
  height: 26px !important;
}

.bsjlj-uw-card-label {
  color: var(--bsjlj-uw-text) !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  transition: color 0.15s ease !important;
}

/* Footer */
#bsjlj-uw-footer {
  margin-top: 18px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

#bsjlj-uw-reset {
  width: 100% !important;
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--bsjlj-uw-blue) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0, 75, 255, .18) !important;
  margin-bottom: 16px !important;
  transition: background-color 0.2s, transform 0.15s !important;
}

#bsjlj-uw-reset:hover,
#bsjlj-uw-reset:focus-visible {
  background: var(--bsjlj-uw-blue-dark) !important;
}

#bsjlj-uw-note {
  margin: 0 !important;
  color: var(--bsjlj-uw-muted) !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

/* Mode Oversized (Panel Besar) */
#bsjlj-uw-panel.bsjlj-uw-oversized {
  width: 460px !important;
}

#bsjlj-uw-panel.bsjlj-uw-oversized .bsjlj-uw-card {
  min-height: 124px !important;
  gap: 14px !important;
}

#bsjlj-uw-panel.bsjlj-uw-oversized .bsjlj-uw-card-label {
  font-size: 14.5px !important;
}

#bsjlj-uw-panel.bsjlj-uw-oversized .bsjlj-uw-card-icon svg {
  width: 30px !important;
  height: 30px !important;
}

#bsjlj-uw-panel.bsjlj-uw-oversized #bsjlj-uw-title {
  font-size: 16px !important;
}

/* Mode mobile responsif */
@media (max-width: 520px) {
  #bsjlj-uw-button {
    right: 16px !important;
    top: 16px !important;
    bottom: auto !important;
    width: 54px !important;
    height: 54px !important;
  }
  #bsjlj-uw-panel {
    left: 12px !important;
    right: 12px !important;
    top: 80px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 96px) !important;
    border-radius: 20px !important;
  }
  #bsjlj-uw-panel.bsjlj-uw-oversized {
    width: auto !important;
  }
  #bsjlj-uw-body {
    max-height: calc(100vh - 160px) !important;
    padding: 16px !important;
  }
  #bsjlj-uw-grid { gap: 10px !important; }
  .bsjlj-uw-card {
    min-height: 100px !important;
    padding: 12px 6px !important;
  }
}

@media (max-width: 360px) {
  #bsjlj-uw-grid { grid-template-columns: 1fr !important; }
}

/* Efek aksesibilitas ke halaman */
html.bsjlj-uw-bigger body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *) {
  font-size: 120% !important;
}

html.bsjlj-uw-spacing body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *) {
  letter-spacing: 0.15em !important;
  word-spacing: 0.3em !important;
}

html.bsjlj-uw-links a:not(#bsjlj-uw-panel a) {
  outline: 2px dashed var(--bsjlj-uw-blue) !important;
  outline-offset: 4px !important;
  text-decoration: underline !important;
  font-weight: 800 !important;
}

html.bsjlj-uw-bigcursor,
html.bsjlj-uw-bigcursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M0,0 L0,22 L6,16 L12,28 L16,26 L10,14 L18,14 Z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E"), auto !important;
}

html.bsjlj-uw-hideimages body img,
html.bsjlj-uw-hideimages body picture,
html.bsjlj-uw-hideimages body svg:not(#bsjlj-uw-panel svg):not(#bsjlj-uw-button svg),
html.bsjlj-uw-hideimages body [style*="background-image"] {
  visibility: hidden !important;
}

html.bsjlj-uw-contrast body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

html.bsjlj-uw-contrast body a:not(#bsjlj-uw-panel a) {
  color: #ffff00 !important;
}

html.bsjlj-uw-paused *,
html.bsjlj-uw-paused *::before,
html.bsjlj-uw-paused *::after {
  animation-play-state: paused !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.bsjlj-uw-dyslexia body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *) {
  font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
}

html.bsjlj-uw-tooltips [title] {
  cursor: help !important;
  border-bottom: 2px dotted var(--bsjlj-uw-blue) !important;
}

html.bsjlj-uw-lineheight body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *) {
  line-height: 2.0 !important;
}

html.bsjlj-uw-align body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *) {
  text-align: justify !important;
}

html.bsjlj-uw-saturation body > *:not(#bsjlj-uw-panel):not(#bsjlj-uw-button):not(#bsjlj-uw-reading-guide):not(#bsjlj-widget-host) {
    filter: saturate(200%) !important;
}

html.bsjlj-uw-saturation #bsjlj-uw-button,
html.bsjlj-uw-sahtml.bsjlj-uw-saturation body > *:not(#bsjlj-uw-panel):not(#bsjlj-uw-button):not(#bsjlj-uw-reading-guide) {
  filter: saturate(200%) !important;
}turation #bsjlj-uw-panel,
html.bsjlj-uw-saturation #bsjlj-uw-panel *,
html.bsjlj-uw-saturation #bsjlj-uw-reading-guide {
  filter: none !important;
}

/* Proteksi panel dari mode kontras tinggi agar tidak rusak tampilannya */
html.bsjlj-uw-contrast #bsjlj-uw-panel,
html.bsjlj-uw-contrast #bsjlj-uw-panel * {
  filter: none !important;
}

/* Close button styling */
#bsjlj-uw-close {
  background: transparent !important;
  border: 0 !important;
  color: #fff !important;
  cursor: pointer !important;
  padding: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: background-color 0.2s !important;
}
#bsjlj-uw-close:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}
#bsjlj-uw-close svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
}

/* Badge for Ramah Disleksia */
.bsjlj-uw-badge {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  background: #10b981 !important; /* emerald/green badge */
  color: #ffffff !important;
  width: 15px !important; 
  height: 15px !important; 
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 9px !important;
  font-weight: bold !important;
  font-family: sans-serif !important;
  border: 1px solid #ffffff !important;
}

/* Collapsible Position / Hide Menu */
.bsjlj-uw-position-menu {
  margin-top: 14px !important;
  width: 100% !important;
}
.bsjlj-uw-position-header {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  background: transparent !important;
  border: 0 !important;
  padding: 8px 4px !important;
  color: var(--bsjlj-uw-text) !important;
  font-weight: 700 !important;
  font-size: 14.5px !important;
  cursor: pointer !important;
  outline: none !important;
}
.bsjlj-uw-position-header svg.gear {
  color: var(--bsjlj-uw-blue) !important;
  width: 18px !important;
  height: 18px !important;
}
.bsjlj-uw-position-header svg.chevron {
  margin-left: auto !important;
  width: 14px !important;
  height: 14px !important;
  transition: transform 0.2s ease !important;
  stroke: var(--bsjlj-uw-text) !important;
}
.bsjlj-uw-position-menu.open svg.chevron {
  transform: rotate(180deg) !important;
}
.bsjlj-uw-position-options {
  display: none !important;
  background: #ffffff !important;
  border: 1px solid var(--bsjlj-uw-border) !important;
  border-radius: 16px !important;
  padding: 8px 16px !important;
  margin-top: 6px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
}
.bsjlj-uw-position-menu.open .bsjlj-uw-position-options {
  display: block !important;
}
.bsjlj-uw-position-option {
  display: flex !important;
  align-items: center !important; 
  justify-content: space-between !important;
  padding: 10px 0 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--bsjlj-uw-text) !important;
  cursor: pointer !important;
}
.bsjlj-uw-position-option:not(:last-child) {
  border-bottom: 1px solid var(--bsjlj-uw-border) !important;
}
.bsjlj-uw-position-option input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  accent-color: var(--bsjlj-uw-blue) !important;
  cursor: pointer !important;
}

/* Reading Guide Line */
#bsjlj-uw-reading-guide {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  height: 14px !important;
  background: rgba(0, 75, 255, 0.28) !important;
  border-top: 1px solid rgba(0, 75, 255, 0.6) !important;
  border-bottom: 1px solid rgba(0, 75, 255, 0.6) !important;
  pointer-events: none !important;
  z-index: 2147483645 !important;
  display: none !important;
}
html.bsjlj-uw-readingguide #bsjlj-uw-reading-guide {
  display: block !important;
}

/* Color Blindness Filter */
html.bsjlj-uw-colorblind body > *:not(#bsjlj-uw-panel):not(#bsjlj-uw-button):not(#bsjlj-widget-host):not(#bsjlj-uw-reading-guide) {
  filter: contrast(125%) saturate(145%) hue-rotate(12deg) !important;
}

html.bsjlj-uw-colorblind #bsjlj-uw-button,
html.bsjlj-uw-colorblind #bsjlj-uw-panel,
html.bsjlj-uw-colorblind #bsjlj-uw-panel *,
html.bsjlj-uw-colorblind #bsjlj-uw-reading-guide {
  filter: none !important;
}

/* High Visibility Focus Outline */
html.bsjlj-uw-highfocus body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *):not(#bsjlj-widget-host *):focus,
html.bsjlj-uw-highfocus body :not(#bsjlj-uw-panel):not(#bsjlj-uw-panel *):not(#bsjlj-uw-button):not(#bsjlj-uw-button *):not(#bsjlj-widget-host *):focus-visible {
  outline: 4px solid #f59e0b !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.35) !important;
}
/* PATCH: kunci widget aksesibilitas agar tidak ikut efek filter halaman */
#bsjlj-uw-button,
#bsjlj-uw-panel,
#bsjlj-uw-reading-guide {
    filter: none !important;
    transform: none !important;
    position: fixed !important;
    z-index: 2147483646 !important;
}

html.bsjlj-uw-saturation #bsjlj-uw-button,
html.bsjlj-uw-saturation #bsjlj-uw-panel,
html.bsjlj-uw-saturation #bsjlj-uw-panel *,
html.bsjlj-uw-saturation #bsjlj-uw-reading-guide,
html.bsjlj-uw-colorblind #bsjlj-uw-button,
html.bsjlj-uw-colorblind #bsjlj-uw-panel,
html.bsjlj-uw-colorblind #bsjlj-uw-panel *,
html.bsjlj-uw-colorblind #bsjlj-uw-reading-guide {
    filter: none !important;
    transform: none !important;
}
