/* ═══════════════════════════════════════════════════════════════
   DocuMentor v4 — css/crop.css
   Perspective Crop Overlay, Handles, Loupe Glass, & Actions Bar
   ═══════════════════════════════════════════════════════════════ */

/* Perspective Crop Overlay */
#crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#crop-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#crop-poly {
  fill: rgba(34, 197, 94, 0.15);
  stroke: var(--accent);
  stroke-width: 2px;
  stroke-dasharray: 4 4;
}

.crop-quad-line {
  stroke: var(--accent);
  stroke-width: 2px;
}

.p-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0,0,0,0.6);
  pointer-events: all;
  cursor: grab;
  z-index: 25;
  transform: translate(-50%, -50%);
}
.p-crop-handle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.p-crop-handle:active {
  cursor: grabbing;
  background: var(--accent);
}

/* Loupe Magnifier */
#crop-loupe {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  overflow: hidden;
  pointer-events: none;
  z-index: 40;
  background: #fff;
  transform: translate(-50%, -50%);
}

#loupe-canvas {
  width: 120px;
  height: 120px;
  display: block;
}

.loupe-crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.loupe-crosshair::before, .loupe-crosshair::after {
  content: '';
  position: absolute;
  background: var(--accent);
}
.loupe-crosshair::before {
  top: 50%; left: 0; right: 0; height: 1px;
  transform: translateY(-50%);
}
.loupe-crosshair::after {
  left: 50%; top: 0; bottom: 0; width: 1px;
  transform: translateX(-50%);
}

.crop-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  pointer-events: all;
  z-index: 80;
  background: rgba(18, 18, 21, 0.9);
  backdrop-filter: blur(12px);
  padding: 8px 16px;
  border-radius: var(--r2) var(--r2) 0 0;
  border: 1px solid var(--border2);
  border-bottom: none;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

@media (min-width: 769px) {
  .crop-actions {
    position: absolute;
    bottom: 14px;
    left: calc(50% + 135px);
    transform: translateX(-50%);
    border-radius: 24px;
    border-bottom: 1px solid var(--border2);
    padding: 6px 14px;
  }
}
