/* Prism — custom styles layered on Tailwind */

/* ── Range inputs ──────────────────────────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #374151; /* gray-700 */
  outline: none;
  cursor: pointer;
  width: 100%;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #a78bfa; /* violet-400 */
  border: 2px solid #7c3aed; /* violet-600 */
  cursor: pointer;
  transition: background 0.15s;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #a78bfa;
  border: 2px solid #7c3aed;
  cursor: pointer;
}
input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.35);
}

/* ── Canvas container ──────────────────────────────────────────────────────── */
.canvas-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

#mainCanvas {
  max-width:  100%;
  max-height: 100%;
  display:    block;
  border-radius: 4px;
}

/* ── Crop overlay ──────────────────────────────────────────────────────────── */
.crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid rgba(255,255,255,0.9);
  /* Dark vignette outside box via inset box-shadow */
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.48),
    0 0 0 1.5px rgba(0,0,0,0.5);
  cursor: move;
  pointer-events: auto;
}

/* Rule of thirds grid lines */
.crop-box::before,
.crop-box::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.22);
}
.crop-box::before {
  left: 33.33%; right: 33.33%; top: 0; bottom: 0; width: 1px; margin: auto;
  box-shadow: 33px 0 0 rgba(255,255,255,0.22);
}
.crop-box::after {
  top: 33.33%; bottom: 33.33%; left: 0; right: 0; height: 1px; margin: auto;
  box-shadow: 0 33px 0 rgba(255,255,255,0.22);
}

/* Crop handles */
.crop-handle {
  position: absolute;
  width: 11px;
  height: 11px;
  background: #fff;
  border: 1.5px solid rgba(100,100,100,0.6);
  border-radius: 2px;
  pointer-events: auto;
}
.crop-handle.nw { top: -6px;  left: -6px;  cursor: nw-resize; }
.crop-handle.n  { top: -6px;  left: calc(50% - 5px); cursor: n-resize; }
.crop-handle.ne { top: -6px;  right: -6px; cursor: ne-resize; }
.crop-handle.e  { top: calc(50% - 5px); right: -6px; cursor: e-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.crop-handle.s  { bottom: -6px; left: calc(50% - 5px); cursor: s-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.w  { top: calc(50% - 5px); left: -6px; cursor: w-resize; }

/* ── Scrollbar (Webkit) ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }

/* ── Number inputs ─────────────────────────────────────────────────────────── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
}

/* ── Drop zone pulse animation ─────────────────────────────────────────────── */
@keyframes pulse-border {
  0%, 100% { border-color: rgba(139,92,246,0.4); }
  50%       { border-color: rgba(139,92,246,0.9); }
}
.drop-pulse {
  animation: pulse-border 2s ease-in-out infinite;
}
