/* Accessibility Widget Styles - NKS Research & Technology */

#nks-a11y-widget {
  position: fixed;
  top: 70px;
  right: 0;
  z-index: 2147483647;
  pointer-events: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

#nks-a11y-widget,
#nks-a11y-widget * {
  box-sizing: border-box !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
  font-weight: 400 !important;
  text-transform: none !important;
}

#nks-a11y-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.3s ease;
  flex-shrink: 0;
  outline: none;
  position: relative;
}

#nks-a11y-toggle-btn:hover {
  border-color: #e8a838;
  color: #e8a838;
}

#nks-a11y-toggle-btn.nks-active {
  border-color: #e8a838;
  color: #e8a838;
}

#nks-a11y-toggle-btn svg {
  width: 18px !important;
  height: 18px !important;
  fill: currentColor;
  pointer-events: none;
  flex-shrink: 0;
}

#nks-a11y-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 292px;
  background: #0d0d0d;
  border: 1px solid #252525;
  border-radius: 14px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  transform-origin: top right;
  transform: scale(0.94) translateY(-10px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.18s ease,
              visibility 0s linear 0.22s;
  pointer-events: none;
  visibility: hidden;
}

#nks-a11y-panel.nks-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.18s ease,
              visibility 0s linear 0s;
}

.nks-a11y-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #141414;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}

.nks-a11y-hdr-title {
  color: #fff;
  font-size: 13px !important;
  font-weight: 600 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nks-a11y-hdr-title svg {
  width: 16px !important;
  height: 16px !important;
  fill: #e8a838;
}

.nks-a11y-hdr-close {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
  background: transparent;
  color: #777;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  outline: none;
  padding: 0;
  flex-shrink: 0;
}

.nks-a11y-hdr-close:hover {
  background: #2a2a2a;
  border-color: #383838;
  color: #fff;
}

.nks-a11y-hdr-close svg {
  width: 13px !important;
  height: 13px !important;
  fill: currentColor;
}

.nks-a11y-body {
  max-height: 62vh;
  overflow-y: auto;
  padding: 4px 0 0;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}

.nks-a11y-body::-webkit-scrollbar { width: 3px; }
.nks-a11y-body::-webkit-scrollbar-track { background: transparent; }
.nks-a11y-body::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

.nks-a11y-grp-lbl {
  padding: 10px 16px 3px;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  color: #505050;
  text-transform: uppercase !important;
  user-select: none;
}

.nks-a11y-divider {
  height: 1px;
  background: #1e1e1e;
  margin: 4px 16px;
}

.nks-a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  gap: 10px;
  transition: background 0.1s;
}

.nks-a11y-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.nks-a11y-row-lbl {
  color: #b8b5af;
  font-size: 13px !important;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  min-width: 0;
}

.nks-a11y-row-lbl svg {
  width: 15px !important;
  height: 15px !important;
  fill: #4a4a4a;
  flex-shrink: 0;
}

.nks-a11y-stepper {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.nks-a11y-st-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #242424;
  background: #1c1c1c;
  color: #888;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  outline: none;
  padding: 0;
  user-select: none;
  flex-shrink: 0;
}

.nks-a11y-st-btn:hover:not(:disabled) {
  background: #242424;
  border-color: #333;
  color: #fff;
}

.nks-a11y-st-btn:active:not(:disabled) {
  background: #2a2a2a;
}

.nks-a11y-st-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed !important;
}

.nks-a11y-st-val {
  min-width: 34px;
  text-align: center;
  color: #888;
  font-size: 12px !important;
  font-weight: 500 !important;
  user-select: none;
  transition: color 0.15s;
}

.nks-a11y-st-val.nks-active {
  color: #e8a838;
  font-weight: 600 !important;
}

.nks-a11y-switch {
  position: relative;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
  cursor: pointer !important;
}

.nks-a11y-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.nks-a11y-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: #252525;
  cursor: pointer !important;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid #303030;
}

.nks-a11y-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #484848;
  transition: transform 0.2s ease, background 0.2s;
}

.nks-a11y-switch input:checked + .nks-a11y-switch-track {
  background: #b8860b;
  border-color: #e8a838;
}

.nks-a11y-switch input:checked + .nks-a11y-switch-track::after {
  transform: translateX(17px);
  background: #ffffff;
}

.nks-a11y-ftr {
  padding: 10px 16px 12px;
  border-top: 1px solid #1e1e1e;
}

.nks-a11y-reset-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid #222;
  background: transparent;
  color: #555;
  cursor: pointer !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  outline: none;
  text-align: center;
  letter-spacing: 0.02em !important;
}

.nks-a11y-reset-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #999;
  border-color: #2e2e2e;
}

/* Accessibility effects */
html.acc-bold body *:not(#nks-a11y-widget):not(#nks-a11y-widget *):not(#listen-tray):not(#listen-tray *) {
  font-weight: bold !important;
}

html.acc-big-cursor,
html.acc-big-cursor *:not(#nks-a11y-widget):not(#nks-a11y-widget *) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 2 L8 40 L19 29 L26 46 L32 43 L25 26 L40 26 Z' fill='white' stroke='black' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 8 2, auto !important;
}

html.acc-high-contrast body {
  background: #000000 !important;
  color: #ffffff !important;
}

html.acc-high-contrast body * {
  border-color: #ffffff !important;
}

html.acc-high-contrast a {
  color: #ffff00 !important;
}

html.acc-hide-images body img,
html.acc-hide-images body video,
html.acc-hide-images body picture {
  visibility: hidden !important;
  opacity: 0 !important;
}

html.acc-stop-anim *:not(#nks-a11y-widget):not(#nks-a11y-widget *),
html.acc-stop-anim *:not(#nks-a11y-widget):not(#nks-a11y-widget *)::before,
html.acc-stop-anim *:not(#nks-a11y-widget):not(#nks-a11y-widget *)::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0ms !important;
}

#nks-a11y-reading-line {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #e8a838 8%, #fff 50%, #e8a838 92%, transparent 100%);
  z-index: 2147483645;
  pointer-events: none;
  border-radius: 2px;
  transform: translateY(-1px);
}

html.acc-reading-line #nks-a11y-reading-line {
  display: block;
}

#nks-a11y-mask-top,
#nks-a11y-mask-bottom {
  display: none;
  position: fixed;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.68);
  z-index: 2147483644;
  pointer-events: none;
}

#nks-a11y-mask-top { top: 0; height: 0; }
#nks-a11y-mask-bottom { bottom: 0; height: 0; }

html.acc-reading-mask #nks-a11y-mask-top,
html.acc-reading-mask #nks-a11y-mask-bottom {
  display: block;
}

/* Listen Tray Styles */
.listen-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.listen-nav-btn:hover {
  border-color: #e8a838;
  color: #e8a838;
}

.listen-nav-btn.active {
  border-color: #e8a838;
  color: #e8a838;
}

.listen-nav-btn.active::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e8a838;
}

.listen-nav-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

#listen-tray {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  background: #0d0d0d;
  border: 1px solid #252525;
  border-radius: 14px;
  box-shadow: 0 16px 56px rgba(0,0,0,0.75);
  z-index: 9997;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: top right;
  transform: scale(0.94) translateY(-10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s ease, visibility 0s linear 0.22s;
}

#listen-tray.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s ease, visibility 0s linear 0s;
}

.listen-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #222;
}

.listen-tray-title {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
}

.listen-tray-close {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #333;
  background: transparent;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.listen-tray-close:hover {
  border-color: #e8a838;
  color: #fff;
}

.listen-tray-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.listen-tray-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.listen-status {
  font-family: 'Open Sans', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
}

.listen-status-sub {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  color: #888;
  margin-bottom: 16px;
}

.listen-tray-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
  margin-bottom: 20px;
}

.listen-tray-waves span {
  display: block;
  width: 4px;
  border-radius: 3px;
  background: #e8a838;
  transition: opacity 0.2s;
}

.listen-tray-waves.playing span {
  animation: trayWave 0.9s ease-in-out infinite;
}

.listen-tray-waves.paused span {
  animation: none;
  height: 4px !important;
  opacity: 0.35;
}

.listen-tray-waves.idle span {
  height: 4px !important;
  opacity: 0.18;
  animation: none;
}

.listen-tray-waves span:nth-child(1) { animation-delay: 0.00s; }
.listen-tray-waves span:nth-child(2) { animation-delay: 0.10s; }
.listen-tray-waves span:nth-child(3) { animation-delay: 0.20s; }
.listen-tray-waves span:nth-child(4) { animation-delay: 0.05s; }
.listen-tray-waves span:nth-child(5) { animation-delay: 0.15s; }
.listen-tray-waves span:nth-child(6) { animation-delay: 0.08s; }
.listen-tray-waves span:nth-child(7) { animation-delay: 0.18s; }
.listen-tray-waves span:nth-child(8) { animation-delay: 0.03s; }

@keyframes trayWave {
  0%, 100% { height: 5px; opacity: 0.4; }
  50% { height: 36px; opacity: 1; }
}

.listen-divider {
  height: 1px;
  background: #222;
  margin: 16px 0;
}

.listen-section-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 12px;
}

.listen-ctrl-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.listen-ctrl-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.listen-ctrl-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  color: #888;
}

.listen-ctrl-value {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  min-width: 36px;
  text-align: right;
}

.listen-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: #333;
  outline: none;
  cursor: pointer;
}

.listen-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8a838;
  cursor: pointer;
  border: 2px solid #0d0d0d;
  box-shadow: 0 0 0 1px #e8a838;
}

.listen-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8a838;
  cursor: pointer;
  border: 2px solid #0d0d0d;
  box-shadow: 0 0 0 1px #e8a838;
}

.listen-tray-footer {
  padding: 16px 20px;
  border-top: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.listen-tray-btn {
  width: 100%;
  padding: 10px 0;
  border-radius: 4px;
  border: 1px solid #333;
  background: transparent;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  transition: all 0.2s;
  letter-spacing: 0.04em;
}

.listen-tray-btn:hover {
  border-color: #e8a838;
  color: #e8a838;
}

.listen-tray-btn.primary {
  background: #e8a838;
  border-color: #e8a838;
  color: #000;
}

.listen-tray-btn.primary:hover {
  opacity: 0.85;
}

@media (max-width: 768px) {
  #nks-a11y-panel,
  #listen-tray {
    width: calc(100vw - 20px);
    max-width: 300px;
  }
}
