/**
 * Shirt Preview Styles
 * Apple-level visual preview with smooth animations
 */

/* ===== PREVIEW CONTAINER ===== */
.ssc-preview-container {
  position: sticky;
  top: calc(var(--ssc-stepper-offset, 80px) + var(--ssc-space-4));
  max-width: 480px;
  margin: 0 auto;
  z-index: 10;
}

.ssc-preview-wrapper {
  background: var(--ssc-surface, #ffffff);
  border-radius: var(--ssc-rounded-2xl);
  box-shadow: var(--ssc-shadow-xl);
  padding: var(--ssc-space-6);
  border: 1px solid var(--ssc-border);
}

/* ===== PREVIEW STAGE ===== */
.ssc-preview-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: var(--ssc-rounded-xl);
  overflow: hidden;
  transition: transform var(--ssc-transition-slow);
}

.ssc-preview-stage.ssc-preview-updating {
  animation: previewPulse 0.6s ease-out;
}

@keyframes previewPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ===== SHIRT BASE ===== */
.ssc-shirt-base {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ssc-space-8);
}

.ssc-shirt-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
  transition: all var(--ssc-transition-slow);
}

/* Shirt body elements */
.ssc-shirt-torso,
.ssc-shirt-sleeve-left,
.ssc-shirt-sleeve-right {
  transition: fill var(--ssc-transition-base), opacity var(--ssc-transition-base);
}

/* Highlight effect */
.ssc-highlight {
  fill: var(--ssc-primary) !important;
  opacity: 0.2 !important;
  animation: highlightPulse 1.5s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% { opacity: 0.2 !important; }
  50% { opacity: 0.35 !important; }
}

/* ===== FABRIC OVERLAY ===== */
.ssc-fabric-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.8;
}

.ssc-fabric-texture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 500"><path d="M 100 100 L 100 450 L 300 450 L 300 100 Z M 100 100 L 50 150 L 70 200 L 100 180 Z M 300 100 L 350 150 L 330 200 L 300 180 Z"/></svg>');
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
}

/* ===== CUSTOMIZATION MARKERS ===== */
.ssc-customization-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ssc-marker {
  position: absolute;
  background: white;
  border: 2px solid var(--ssc-primary);
  border-radius: var(--ssc-rounded-lg);
  padding: var(--ssc-space-2) var(--ssc-space-3);
  box-shadow: var(--ssc-shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--ssc-space-2);
  font-size: var(--ssc-text-sm);
  font-weight: var(--ssc-font-medium);
  color: var(--ssc-gray-700);
  pointer-events: auto;
  cursor: pointer;
  transition: all var(--ssc-transition-fast);
  opacity: 0;
  transform: scale(0.8);
}

.ssc-marker.ssc-marker-active {
  opacity: 1;
  transform: scale(1);
}

.ssc-marker:hover {
  transform: scale(1.05);
  box-shadow: var(--ssc-shadow-xl);
  border-color: var(--ssc-primary);
}

.ssc-marker-pulse {
  animation: markerPulse 0.6s ease-out;
}

@keyframes markerPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(11, 93, 59, 0.2); }
  100% { transform: scale(1); }
}

/* Marker positions */
.ssc-marker-collar {
  top: 15%;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
}

.ssc-marker-collar.ssc-marker-active {
  transform: translateX(-50%) scale(1);
}

.ssc-marker-cuff {
  top: 35%;
  left: 10%;
}

.ssc-marker-pocket {
  top: 40%;
  left: 20%;
}

.ssc-marker-monogram {
  top: 30%;
  left: 30%;
}

.ssc-marker-icon {
  font-size: 18px;
  line-height: 1;
}

.ssc-marker-label {
  white-space: nowrap;
  font-size: var(--ssc-text-xs);
  font-weight: var(--ssc-font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== PREVIEW CONTROLS ===== */
.ssc-preview-controls {
  display: flex;
  justify-content: center;
  gap: var(--ssc-space-2);
  margin-top: var(--ssc-space-4);
  padding-top: var(--ssc-space-4);
  border-top: 1px solid var(--ssc-border);
}

.ssc-preview-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--ssc-rounded-lg);
  border: 1px solid var(--ssc-border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ssc-transition-fast);
  font-size: 18px;
}

.ssc-preview-btn:hover {
  background: var(--ssc-border);
  border-color: var(--ssc-primary);
  transform: translateY(-2px);
  box-shadow: var(--ssc-shadow-md);
}

.ssc-preview-btn:active {
  transform: translateY(0);
}

/* ===== ZOOM FUNCTIONALITY ===== */
.ssc-preview-stage.ssc-zoomed {
  transform: scale(1.5);
  cursor: move;
}

.ssc-preview-stage.ssc-zoomed .ssc-shirt-svg {
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
}

/* ===== LOADING STATE ===== */
.ssc-preview-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--ssc-space-4);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.ssc-preview-loading p {
  font-size: var(--ssc-text-sm);
  color: var(--ssc-gray-600);
  margin: 0;
}

/* ===== INFO PANEL ===== */
.ssc-preview-info {
  margin-top: var(--ssc-space-6);
  padding-top: var(--ssc-space-4);
  border-top: 1px solid var(--ssc-border);
}

.ssc-preview-title {
  font-size: var(--ssc-text-lg);
  font-weight: var(--ssc-font-semibold);
  color: var(--ssc-gray-900);
  margin-bottom: var(--ssc-space-4);
}

.ssc-preview-details {
  display: flex;
  flex-direction: column;
  gap: var(--ssc-space-3);
}

.ssc-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--ssc-text-sm);
  padding: var(--ssc-space-2) 0;
}

.ssc-detail-label {
  color: var(--ssc-gray-600);
  font-weight: var(--ssc-font-medium);
}

.ssc-detail-value {
  color: var(--ssc-gray-900);
  font-weight: var(--ssc-font-semibold);
  transition: all var(--ssc-transition-fast);
}

.ssc-detail-value.ssc-value-updated {
  color: var(--ssc-primary);
  transform: scale(1.05);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .ssc-preview-container {
    position: relative;
    top: auto;
    max-width: 100%;
    margin-bottom: var(--ssc-space-8);
  }
}

@media (max-width: 768px) {
  .ssc-preview-wrapper {
    padding: var(--ssc-space-4);
  }

  .ssc-marker {
    padding: var(--ssc-space-1) var(--ssc-space-2);
    font-size: var(--ssc-text-xs);
  }

  .ssc-marker-icon {
    font-size: 14px;
  }

  .ssc-marker-label {
    display: none;
  }

  .ssc-preview-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .ssc-preview-controls,
  .ssc-customization-markers {
    display: none !important;
  }
}
