/* Specialized Tool Workbenches & Interactive Stages */

/* ========================================================
   1. PHOTO STUDIO & WORKBENCH STYLES
   ======================================================== */
.studio-workbench {
  position: relative;
  background: #06080e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.studio-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.studio-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: 
    linear-gradient(45deg, #090c14 25%, transparent 25%), 
    linear-gradient(-45deg, #090c14 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #090c14 75%), 
    linear-gradient(-45deg, transparent 75%, #090c14 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #05070c;
  overflow: auto;
  min-height: 420px;
}

/* Image-Fitted Crop Stage (Locked directly to rendered canvas bounds) */
.crop-stage {
  position: relative;
  display: inline-block;
  user-select: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
}

.crop-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 520px;
  border-radius: 2px;
}

/* Crop Box & Dimming Mask */
.crop-box {
  position: absolute;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.68);
  cursor: move;
  box-sizing: border-box;
  touch-action: none;
}

/* Live Crop Dimensions Badge */
.crop-badge {
  position: absolute;
  top: -28px;
  left: 0;
  background: rgba(8, 10, 16, 0.9);
  border: 1px solid var(--border-hover);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.3px;
  pointer-events: none;
  white-space: nowrap;
}

/* 3x3 Rule-of-Thirds Grid */
.crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  opacity: 0.85;
}

.crop-grid div {
  border: 1px dashed rgba(255, 255, 255, 0.28);
}

/* 8-Point Crop Handles (4 Corners + 4 Edges) */
.crop-handle {
  position: absolute;
  background: var(--accent);
  box-sizing: border-box;
  z-index: 10;
  touch-action: none;
}

/* Corner Handles: Sturdy Bracket Blocks */
.crop-handle.corner {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.crop-handle.handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* Edge Handles: Sleek Grip Bars */
.crop-handle.edge {
  background: #ffffff;
  border: 1px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.crop-handle.handle-n {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 8px;
  border-radius: 4px;
  cursor: ns-resize;
}

.crop-handle.handle-s {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 8px;
  border-radius: 4px;
  cursor: ns-resize;
}

.crop-handle.handle-w {
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
  width: 8px;
  height: 28px;
  border-radius: 4px;
  cursor: ew-resize;
}

.crop-handle.handle-e {
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
  width: 8px;
  height: 28px;
  border-radius: 4px;
  cursor: ew-resize;
}

/* ========================================================
   2. PASSPORT PHOTO MAKER STYLES
   ======================================================== */
.passport-workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.passport-canvas-wrapper {
  position: relative;
  width: 320px;
  height: 380px;
  margin: 0 auto;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #111520;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: var(--card-shadow);
}

.passport-canvas-wrapper:active {
  cursor: grabbing;
}

/* Biometric Oval Face Guide */
.biometric-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.biometric-oval {
  width: 190px;
  height: 250px;
  border: 2px dashed rgba(16, 185, 129, 0.7);
  border-radius: 50% 50% 48% 48%;
  position: relative;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.biometric-line-eyes {
  position: absolute;
  top: 45%;
  left: -15px;
  right: -15px;
  border-top: 1px dashed rgba(16, 185, 129, 0.5);
}

.biometric-line-chin {
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  border-top: 1px solid rgba(16, 185, 129, 0.6);
}

.passport-color-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.passport-color-pill:hover, .passport-color-pill.active {
  transform: scale(1.18);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Sheet Print Preview Container */
.sheet-preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.sheet-preview-canvas {
  max-width: 100%;
  height: auto;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

/* ========================================================
   3. PDF EDITOR WORKBENCH & ANNOTATIONS
   ======================================================== */
.pdf-editor-shell {
  display: flex;
  flex-direction: column;
  background: #080a10;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
  z-index: 20;
}

.pdf-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.pdf-tool-btn {
  height: 32px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.pdf-tool-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.pdf-tool-btn.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.pdf-canvas-stage {
  flex: 1;
  position: relative;
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
  background: #0a0d16;
  min-height: 600px;
}

.pdf-page-container {
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #ffffff;
  display: inline-block;
  user-select: none;
}

.pdf-annotation-box {
  position: absolute;
  cursor: move;
  box-sizing: border-box;
  z-index: 10;
  user-select: none;
}

.pdf-annotation-box.whiteout {
  background: #ffffff;
  border: 1px dashed #94a3b8;
}

.pdf-annotation-box.blackout {
  background: #000000;
  border: 1px dashed #64748b;
}

.pdf-annotation-box.highlight {
  background: rgba(250, 204, 21, 0.45);
  border: 1px dashed #eab308;
}

.pdf-annotation-box.signature-box {
  background: transparent;
  border: 1px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-annotation-box.selected {
  outline: 2px solid var(--accent);
}

.pdf-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid #ffffff;
  border-radius: 2px;
  cursor: nwse-resize;
  z-index: 20;
}

.pdf-delete-handle {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: #ffffff;
  font-size: 11px;
  border: 1px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
}

/* ========================================================
   4. CURRENCY CONVERTER REVOLUT-STYLE CARDS
   ======================================================== */
.curr-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition-fast);
}

.curr-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.curr-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.curr-amount-input {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  width: 100%;
}

.curr-swap-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -12px auto;
  z-index: 10;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
}

.curr-swap-btn:hover {
  transform: scale(1.12) rotate(180deg);
  border-color: var(--accent);
}

.curr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.curr-table th, .curr-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.curr-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .passport-workspace {
    grid-template-columns: 1fr;
  }
}
