/* Image Cropper Specific Interactive Styles */
.cropper-stage {
  position: relative;
  width: 100%;
  height: 520px;
  background: #070a12;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.cropper-canvas-box {
  position: relative;
  display: inline-block;
  max-width: 95%;
  max-height: 95%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

#source-canvas {
  display: block;
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

/* Crop Box Overlay */
.crop-box {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  cursor: move;
  touch-action: none;
}

.crop-box.circle-mode, .crop-box.shape-circle {
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
}

.crop-box.shape-roundrect {
  border-radius: 26px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
}

.shape-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  display: none;
}

.shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.btn-shape {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-shape:hover, .btn-shape.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* Rule of Thirds Grid */
.crop-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.crop-grid-line {
  border: 0.5px dashed rgba(255, 255, 255, 0.35);
}

/* Crop Handles */
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #6366f1;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  touch-action: none;
}

.crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.crop-handle.n  { top: -7px; left: calc(50% - 7px); cursor: ns-resize; }
.crop-handle.s  { bottom: -7px; left: calc(50% - 7px); cursor: ns-resize; }
.crop-handle.w  { top: calc(50% - 7px); left: -7px; cursor: ew-resize; }
.crop-handle.e  { top: calc(50% - 7px); right: -7px; cursor: ew-resize; }

.dimension-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #38bdf8;
  pointer-events: none;
  z-index: 30;
}

/* Preset Pill Buttons */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-preset:hover, .btn-preset.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.live-preview-box {
  background: #0b0f19;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#preview-canvas {
  max-width: 100%;
  max-height: 150px;
  border-radius: 4px;
}

/* Preset Chips Bar */
.preset-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--brand-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.preset-chip.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Aspect Ratio Calculator Card */
.calc-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-row span:first-child {
  color: var(--text-secondary);
}

.calc-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #38bdf8;
}

.calc-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* Sensor & Print Grids */
.sensor-print-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.btn-mini-preset {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-mini-preset:hover, .btn-mini-preset.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.btn-mini-preset strong {
  color: #fff;
  font-size: 0.78rem;
}
