/* Interactive profile / cover photo crop modal */
.image-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  color: #fff;
  isolation: isolate;
  pointer-events: auto;
}

.image-crop-overlay.hidden {
  display: none !important;
}

.image-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.image-crop-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.image-crop-header button {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  pointer-events: auto;
}

.image-crop-header button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-crop-header .image-crop-save {
  color: var(--jtb-yellow, #ffcc00);
}

.image-crop-stage-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
  min-height: 240px;
  z-index: 1;
}

.image-crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.image-crop-canvas.dragging {
  cursor: grabbing;
}

.image-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.image-crop-mask::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.image-crop-viewport {
  position: relative;
  z-index: 3;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.image-crop-viewport.circle {
  border-radius: 50%;
}

.image-crop-viewport.wide {
  border-radius: 8px;
}

.image-crop-controls {
  padding: 16px 20px 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.image-crop-controls label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.75);
}

.image-crop-zoom {
  width: 100%;
  accent-color: var(--jtb-yellow, #ffcc00);
  pointer-events: auto;
}

.image-crop-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* Hide profile chrome bleeding through during crop */
body.image-crop-open .profile-page-wrap,
body.image-crop-open .profile-cover,
body.image-crop-open .profile-avatar-wrap,
body.image-crop-open .photo-cam-wrap,
body.image-crop-open #topbar {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.image-crop-open .image-crop-overlay {
  visibility: visible !important;
}
