/* ══════════════════════════════���════════════════════════════
   Image Crop Modal
   ═══════════════════════════════════════════════════════════ */

.crop-modal-overlay {
  position: fixed; inset: 0; z-index: 10010;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: cropFadeIn .2s ease-out;
}
@keyframes cropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.crop-modal {
  width: 100%; max-width: 420px;
  background: var(--surface, #1a1d2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

.crop-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.crop-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text, #fff);
}
.crop-modal-close {
  background: none; border: none;
  color: var(--muted, rgba(255,255,255,.5));
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  line-height: 1; border-radius: 6px;
  transition: background .15s;
}
.crop-modal-close:hover { background: rgba(255,255,255,.06); }
.crop-modal-done {
  background: var(--accent, #7c9cff); color: var(--bg, #0a0d14);
  border: none; border-radius: 8px;
  padding: 7px 16px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: filter .15s;
}
.crop-modal-done:hover { filter: brightness(1.1); }

.crop-modal-body {
  padding: 20px;
}

/* Drop zone */
.crop-dropzone {
  width: 100%; height: 280px;
  border: 2px dashed var(--border, rgba(255,255,255,.12));
  border-radius: 16px;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
  background: rgba(0,0,0,.2);
}
.crop-dropzone.circle { border-radius: 50%; width: 260px; height: 260px; margin: 0 auto; }
.crop-dropzone.drag-over {
  border-color: var(--accent, #7c9cff);
  background: rgba(124,156,255,.08);
}

.crop-dropzone-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted, rgba(255,255,255,.5));
  text-align: center;
}
.crop-dropzone-prompt p { margin: 0; font-size: 14px; font-weight: 600; }
.crop-dropzone-prompt span { font-size: 12px; color: var(--muted, rgba(255,255,255,.35)); }

.crop-browse-btn {
  margin-top: 4px;
  background: var(--accent, #7c9cff); color: var(--bg, #0a0d14);
  border: none; border-radius: 8px;
  padding: 9px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: filter .15s;
}
.crop-browse-btn:hover { filter: brightness(1.1); }

/* Canvas (the image being positioned) */
.crop-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: grab; touch-action: none;
}

/* Crop frame overlay */
.crop-frame {
  position: absolute; inset: 0;
  pointer-events: none;
}
.crop-frame.circle {
  /* For circle, the dropzone is already circular — just a subtle ring */
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
}
.crop-frame.banner {
  /* Dark overlay with a transparent rectangle cut-out */
  border: none;
  box-shadow: inset 0 0 0 9999px rgba(0,0,0,.45);
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%,
    4% 15%, 4% 85%, 96% 85%, 96% 15%, 4% 15%
  );
  border-radius: 16px;
}

/* Scale controls */
.crop-controls {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 0 4px;
}
.crop-scale-label { display: flex; color: var(--muted, rgba(255,255,255,.4)); }
.crop-scale-slider {
  flex: 1; height: 4px; -webkit-appearance: none; appearance: none;
  background: var(--border, rgba(255,255,255,.1)); border-radius: 2px; outline: none;
}
.crop-scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  background: var(--accent, #7c9cff); border-radius: 50%;
  cursor: pointer; border: none;
}
.crop-scale-val {
  font-size: 12px; font-weight: 600; color: var(--muted, rgba(255,255,255,.5));
  min-width: 32px; text-align: right;
}

/* Hint text */
.crop-hint {
  text-align: center; margin: 10px 0 0;
  font-size: 12px; color: var(--muted, rgba(255,255,255,.4));
}
