﻿/* Photo Comparison Slider Maker Specific Styling */

.dual-dropzone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

@media (max-width: 640px) {
  .dual-dropzone-grid {
    grid-template-columns: 1fr;
  }
}

.dual-drop-card {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background: var(--bg-surface);
  transition: all var(--transition-fast);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 220px;
}

.dual-drop-card:hover,
.dual-drop-card.dragover {
  border-color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-2px);
}

.dual-drop-card.has-image {
  border-style: solid;
  border-color: var(--border-subtle);
  padding: 12px;
}

.drop-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
}

.dual-drop-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: none;
}

.dual-drop-card.has-image .dual-drop-thumb {
  display: block;
}

.dual-drop-card.has-image .drop-prompt-content {
  display: none;
}

.dual-card-actions {
  display: none;
  margin-top: 10px;
  gap: 8px;
  width: 100%;
}

.dual-drop-card.has-image .dual-card-actions {
  display: flex;
}

/* Interactive Slider Preview Container */
.slider-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background: #000;
}

.slider-img-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slider-img-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.layer-before {
  z-index: 2;
  clip-path: inset(0 50% 0 0); /* Default 50% horizontal split */
}

.layer-after {
  z-index: 1;
}

/* Draggable divider handle */
.slider-divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #ffffff;
  z-index: 5;
  cursor: ew-resize;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  touch-action: none;
}

.slider-divider-line.vertical-mode {
  top: 50%;
  left: 0;
  right: 0;
  bottom: auto;
  width: auto;
  height: 3px;
  cursor: ns-resize;
  transform: translateY(-50%);
}

.slider-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid rgba(15, 23, 42, 0.8);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: grab;
  transition: transform 0.15s ease;
}

.slider-handle-knob:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.1);
}

.floating-pill-badge {
  position: absolute;
  z-index: 4;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 20px;
  pointer-events: none;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.badge-pos-before {
  top: 16px;
  left: 16px;
}

.badge-pos-after {
  top: 16px;
  right: 16px;
}

/* Modal for Embed Code */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.code-box {
  width: 100%;
  height: 200px;
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 12px;
  resize: vertical;
  outline: none;
  margin-bottom: 16px;
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary-action:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.08);
}

/* Sample Comparisons Quick Selection Bar */
.sample-comparisons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
}

.sample-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sample-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-demo-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sample-demo-btn:hover {
  border-color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  transform: translateY(-1px);
}

.sample-demo-btn:active {
  transform: scale(0.97);
}

/* Custom Size Numeric Input Fields */
.text-input-field {
  width: 100%;
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  padding: 8px 10px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.text-input-field:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Enhanced Smooth Slider Styles */
.slider-preview-wrap {
  cursor: ew-resize;
  transition: aspect-ratio 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-preview-wrap.vertical-active {
  cursor: ns-resize;
}

.slider-img-layer img {
  will-change: object-fit;
  transition: object-fit 0.15s ease;
}

.slider-handle-knob {
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.slider-handle-knob svg {
  display: block;
  pointer-events: none;
}

/* ==========================================================================
   WORKSPACE & ACTIVE SCREEN STABILITY EXTENSIONS
   ========================================================================== */

#active-screen {
  display: none;
  flex-direction: column;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.viewport-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-surface-elevated, #1e293b);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 10px 16px;
  gap: 12px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

#viewport-container.canvas-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  box-sizing: border-box;
  overflow: hidden;
}

.slider-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 960px;
  max-height: 72vh;
  margin: 0 auto;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background: #000;
  box-sizing: border-box;
}

.slider-preview-wrap.is-dragging {
  cursor: grabbing !important;
}

.slider-img-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slider-img-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}