/* ==========================================================================
   NEDA Slide Marker — toolbar & canvas styles
   ========================================================================== */

/* ---- Canvas overlay ---- */
#neda-marker-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  pointer-events: none;
  /* Cursor set dynamically by JS (crosshair / none for eraser) */
  touch-action: none;
}

/* ---- Toolbar ---- */
#neda-marker-toolbar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(30, 30, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 10px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s ease;
}

/* ---- Separator ---- */
.neda-marker-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 4px;
  border-radius: 0.5px;
}

/* ---- Base button ---- */
.neda-marker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 7px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  flex-shrink: 0;
  position: relative;
}

.neda-marker-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.neda-marker-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.neda-marker-btn:active {
  background: rgba(255, 255, 255, 0.18);
}

/* Active tool / toggle */
.neda-marker-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}

/* ---- Close button ---- */
.neda-marker-close:hover {
  background: rgba(220, 53, 69, 0.45);
  color: #fff;
}

/* ---- Minimise button ---- */
.neda-marker-minimize svg {
  width: 15px;
  height: 15px;
}

/* ---- Mode button ---- */
.neda-marker-mode {
  display: flex;
  align-items: center;
  gap: 4px;
  width: auto;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-family: system-ui, -apple-system, sans-serif;
}

.neda-marker-mode svg {
  width: 15px;
  height: 15px;
}

.neda-marker-mode-label {
  white-space: nowrap;
}

/* ---- Color swatches ---- */
.neda-marker-color {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.neda-marker-color:hover {
  transform: scale(1.15);
}

.neda-marker-color.active {
  border-color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.neda-marker-color-swatch {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.neda-marker-color--white .neda-marker-color-swatch {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.45),
              0 1px 2px rgba(0, 0, 0, 0.25);
}

.neda-marker-color--white.active {
  border-color: rgba(255, 255, 255, 0.9);
}

/* ---- Width buttons ---- */
.neda-marker-width svg {
  width: 22px;
  height: 18px;
}

/* ---- Margin slider ---- */
.neda-marker-margin-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.neda-marker-margin-wrap svg {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.neda-marker-margin-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  outline: none;
  cursor: pointer;
}

.neda-marker-margin-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.neda-marker-margin-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.neda-marker-margin-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
}

/* ---- Minimised floating toggle ---- */
#neda-marker-minimized-toggle {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 50;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: rgba(30, 30, 30, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 3px 12px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

#neda-marker-minimized-toggle:hover {
  background: rgba(40, 40, 40, 0.92);
  color: #fff;
  transform: scale(1.08);
}

#neda-marker-minimized-toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* ---- On lecture pages in presentation mode:
         move toolbar above the "Press Esc to exit" hint ---- */
body.presentation-mode #neda-marker-toolbar {
  bottom: 52px;
}

body.presentation-mode #neda-marker-minimized-toggle {
  right: max(12px, calc(var(--neda-preso-margin-half, 7.5%) - 20px));
}

/* ---- Print: hide everything ---- */
@media print {
  .preso-exit,
  #neda-marker-canvas,
  #neda-marker-toolbar,
  #neda-marker-minimized-toggle,
  #neda-marker-eraser-indicator {
    display: none !important;
  }
}
