/* --- WRAPPER: isolates all accessibility UI from page styles --- */
#bitaccess-wrapper {
  all: initial;
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 99999;
  font-family: Arial, sans-serif;
}

#bitaccess-wrapper *:not(.bitaccess-reset-wrapper):not(.bitaccess-row) {
  all: unset;
  display: initial;
  font-family: inherit;
  box-sizing: border-box;
}


/* --- BUTTON: floating trigger --- */
#bitaccess-wrapper #bitaccess-btn {
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 10000;
  padding: 10px 15px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* --- PANEL: UI menu --- */
#bitaccess-wrapper #bitaccess-panel {
  display: none;
  position: fixed;
  bottom: 60px;
  left: 15px;
  background: white;
  border: 1px solid #ccc;
  padding: 15px;
  z-index: 10000;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  border-radius: 8px;
  width: 240px;
}

#bitaccess-wrapper #bitaccess-panel.visible {
  display: block;
}

#bitaccess-wrapper #bitaccess-panel button {
  margin: 4px 2px;
  padding: 5px 8px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-block;
  width: 100%;
}

/* --- READING GUIDE: vertical tracking line --- */
body.readingGuide #readingGuideLine {
  position: fixed;
  height: 2px;
  background: red;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 9999;
}

/* --- FAKE BIG CURSOR: image follows mouse --- */
#fake-big-cursor {
  position: fixed;
  width: 48px;
  height: 48px;
  background: url('fake_cursor.png') no-repeat center center;
  background-size: contain;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-10px, -10px);
}

/* --- CSS fallback for big cursor (legacy browsers) --- */
body.bigCursor {
  cursor: url('/brj5/media/plg_system_bitaccessibility/cursor_good.cur'), auto !important;
}

/* --- OPTIONAL FEATURES --- */
body.dyslexia {
  font-family: 'OpenDyslexic', Arial, sans-serif !important;
}

body.underlineLinks a {
  text-decoration: underline !important;
}

/* --- GLOBAL FILTER OVERRIDES (UI Immunity) --- */
body.grayscale {
  filter: grayscale(100%);
}
body.invert {
  filter: invert(100%);
}

body.grayscale #bitaccess-wrapper,
body.invert #bitaccess-wrapper {
  filter: none !important;
}

/* Make modules, articles, and nav respect html font-size */
body, #t4-mainbody, .t4-content, .container, .row,
article, section, nav, main, aside, footer {
  font-size: inherit !important;
}

#bitaccess-wrapper #bitaccess-panel {
  display: none;
  position: fixed;
  bottom: 70px;
  left: 15px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 16px;
  width: 260px;
  z-index: 10000;
  transition: all 0.3s ease;
}

#bitaccess-wrapper #bitaccess-panel button {
  margin: 6px 0;
  padding: 8px 10px;
  font-size: 0.95rem;
  border-radius: 6px;
  background: #f7f7f7;
  border: 1px solid #ccc;
  width: 100%;
  transition: background 0.2s ease, transform 0.2s ease;
}

#bitaccess-wrapper #bitaccess-panel button:hover {
  background: #007bff;
  color: white;
  transform: translateY(-1px);
}

#bitaccess-wrapper #bitaccess-panel h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

#bitaccess-wrapper #bitaccess-btn {
  background: linear-gradient(145deg, #006ce0, #0053b3);
  color: #fff;
  font-weight: bold;
  border-radius: 50px;
  padding: 10px 16px;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: background 0.3s ease;
}

#bitaccess-wrapper #bitaccess-btn:hover {
  background: linear-gradient(145deg, #0053b3, #006ce0);
}

#bitaccess-wrapper #bitaccess-panel {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
#bitaccess-wrapper #bitaccess-panel.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.bitaccess-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.bitaccess-row button {
  flex: 1;
}

.bitaccess-active {
  background: #28a745 !important;
  color: white !important;
  font-weight: bold;
  border: 1px solid #218838;
}

.bitaccess-reset-wrapper {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ccc;
  text-align: center;
}

.bitaccess-reset {
  background: #dc3545;
  color: white;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  width: 100%;
  transition: background 0.2s ease;
}

.bitaccess-reset:hover {
  background: #bb2d3b;
}
