/* ==========================================================================
   ViewMix Living Gift Studio — Luxury Photo Block & Single-Page Print Gifts
   ========================================================================== */

:root {
  --gift-bg: #0b0f17;
  --gift-surface: #131a26;
  --gift-surface-elevated: #1a2333;
  --gift-border: rgba(255, 255, 255, 0.08);
  --gift-border-gold: rgba(212, 175, 55, 0.35);
  --gift-gold: #d4af37;
  --gift-gold-glow: rgba(212, 175, 55, 0.25);
  --gift-gold-text: #f5e7b2;
  --gift-text: #f8fafc;
  --gift-text-muted: #94a3b8;
  --gift-accent: #38bdf8;
  --gift-wood-oak: #c89d66;
  --gift-wood-dark: #4a3319;
  --gift-wood-white: #e8e3d9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Assistant', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--gift-bg);
  color: var(--gift-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* Header */
.gift-header {
  height: 64px;
  background: rgba(19, 26, 38, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gift-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.gift-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gift-brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4af37 0%, #aa8214 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px var(--gift-gold-glow);
}

.gift-brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #ffffff 0%, #f5e7b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gift-brand-subtitle {
  font-size: 12px;
  color: var(--gift-gold);
  font-weight: 600;
  margin-top: -2px;
}

.gift-title-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--gift-border);
  border-radius: 8px;
  padding: 7px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  min-width: 200px;
  outline: none;
  transition: all 0.2s ease;
}

.gift-title-input:focus {
  border-color: var(--gift-gold);
  background: rgba(255, 255, 255, 0.08);
}

.gift-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-gift-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--gift-border);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-gift-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-gift-primary {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  border-color: rgba(212, 175, 55, 0.4);
  color: #0b0f17;
  font-weight: 700;
}

.btn-gift-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px var(--gift-gold-glow);
}

/* Main Layout */
.gift-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  height: calc(100vh - 64px);
}

/* Stage / Viewport */
.gift-stage-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #162030 0%, #0b0f17 100%);
  position: relative;
  overflow: hidden;
  padding: 30px;
}

/* View Mode Switcher (Front / Back / 3D Perspective) */
.stage-view-switcher {
  position: absolute;
  top: 20px;
  display: flex;
  background: rgba(19, 26, 38, 0.85);
  backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--gift-border);
  gap: 4px;
  z-index: 20;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.view-switch-btn {
  background: transparent;
  border: none;
  color: var(--gift-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.view-switch-btn.active {
  background: var(--gift-gold);
  color: #0b0f17;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--gift-gold-glow);
}

/* Product Stand / Desk Surface Shadow */
.desk-surface-shadow {
  position: absolute;
  width: 440px;
  height: 50px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
  bottom: 60px;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Realistic 3D Block Container */
.block-3d-wrapper {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  transform-style: preserve-3d;
}

.block-3d-wrapper.perspective-3d {
  transform: rotateX(8deg) rotateY(-14deg) scale(0.95);
}

.block-3d-wrapper.is-flipped {
  transform: rotateY(180deg);
}

.block-3d-wrapper.perspective-3d.is-flipped {
  transform: rotateX(8deg) rotateY(166deg) scale(0.95);
}

/* Wood Block Side Thickness (3D Edge) */
.block-side-edge {
  position: absolute;
  top: 0;
  right: -24px;
  width: 24px;
  height: 100%;
  background: linear-gradient(90deg, #966735 0%, #6d471d 100%);
  transform-origin: left center;
  transform: rotateY(90deg);
  border-radius: 0 2px 2px 0;
  display: none;
}

.block-3d-wrapper.perspective-3d .block-side-edge {
  display: block;
}

/* Product Canvas Surfaces (Front & Back) */
.product-surface {
  position: relative;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  transition: all 0.3s ease;
}

/* Wood Frame finishes */
.finish-oak {
  border: 14px solid #c89d66;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25), 0 16px 40px rgba(0, 0, 0, 0.5);
}

.finish-walnut {
  border: 14px solid #4a3319;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.5);
}

.finish-white {
  border: 14px solid #f1eee9;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15), 0 16px 40px rgba(0, 0, 0, 0.5);
}

.finish-acrylic {
  border: 8px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 20px 48px rgba(56, 189, 248, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.4);
}

.finish-borderless {
  border: none;
}

/* Front Surface Artwork */
.surface-front {
  width: 400px;
  height: 400px;
  position: relative;
}

.front-photo-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}

.front-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.front-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: #94a3b8;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  background: #1e293b;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.front-empty-placeholder:hover {
  background: #24334a;
  border-color: var(--gift-gold);
  color: #fff;
}

/* Floating Caption on Front */
.front-caption-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  text-align: center;
  color: #fff;
  font-family: 'Assistant', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  cursor: move;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.front-caption-overlay:hover {
  background: rgba(0, 0, 0, 0.35);
  outline: 1px dashed rgba(255, 255, 255, 0.5);
}

/* AR Print Indicator Pill */
.front-ar-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--gift-gold);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gift-gold-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Back Surface (QR & Laser-Engraved Instructions) */
.surface-back {
  width: 400px;
  height: 400px;
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateY(180deg);
  background: #fdfbf7;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.08);
}

.back-sticker-card {
  width: 100%;
  max-width: 280px;
  border: 1.5px solid #d4af37;
  border-radius: 12px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.12);
}

.back-qr-box {
  width: 130px;
  height: 130px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.back-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.back-instructions {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin-top: 4px;
}

/* Live Video Player on Product (Interactive Simulator) */
.surface-video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 10;
}

.surface-video-player.is-playing {
  display: block;
}

.btn-play-preview-trigger {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--gift-gold);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 15;
  opacity: 0;
}

.front-photo-container:hover .btn-play-preview-trigger {
  opacity: 1;
}

.btn-play-preview-trigger:hover {
  transform: scale(1.1);
  background: var(--gift-gold);
  color: #0b0f17;
}

/* Sidebar / Studio Controls */
.gift-sidebar {
  width: 420px;
  background: var(--gift-surface);
  border-right: 1px solid var(--gift-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sidebar Navigation Tabs */
.sidebar-tabs-nav {
  display: flex;
  background: rgba(11, 15, 23, 0.6);
  border-bottom: 1px solid var(--gift-border);
  overflow-x: auto;
}

.sidebar-tab-btn {
  flex: 1;
  padding: 12px 10px;
  background: transparent;
  border: none;
  color: var(--gift-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sidebar-tab-btn:hover {
  color: #fff;
}

.sidebar-tab-btn.active {
  color: var(--gift-gold-text);
  border-bottom-color: var(--gift-gold);
  background: rgba(212, 175, 55, 0.08);
}

.tab-icon {
  font-size: 17px;
}

/* Tab Panes */
.sidebar-tab-panes {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-pane.active {
  display: flex;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gift-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Product Cards Grid */
.product-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-card-option {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--gift-border);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.product-card-option:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.product-card-option.active {
  border-color: var(--gift-gold);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 4px 12px var(--gift-gold-glow);
}

.product-card-icon {
  font-size: 26px;
}

.product-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.product-card-dims {
  font-size: 11px;
  color: var(--gift-text-muted);
}

/* Finish Swatches */
.finish-swatches-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.finish-swatch-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--gift-border);
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.finish-swatch-btn.active {
  border-color: var(--gift-gold);
  background: rgba(212, 175, 55, 0.15);
}

.finish-sample-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Media Upload Cards */
.media-upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.media-upload-dropzone:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--gift-gold);
}

.media-upload-dropzone.has-media {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.upload-icon {
  font-size: 30px;
}

.upload-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.upload-sublabel {
  font-size: 11px;
  color: var(--gift-text-muted);
}

/* Inputs & Form Controls */
.gift-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gift-text-muted);
}

.gift-text-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--gift-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.gift-text-input:focus {
  border-color: var(--gift-gold);
  background: rgba(255, 255, 255, 0.08);
}

.font-select-input {
  width: 100%;
  background: #1a2333;
  border: 1px solid var(--gift-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

/* Export Bottom Bar */
.gift-footer-bar {
  background: rgba(19, 26, 38, 0.95);
  border-top: 1px solid var(--gift-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-info-text {
  font-size: 12px;
  color: var(--gift-text-muted);
}

.btn-export-full {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-export-full:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* Toast Message */
.gift-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  border: 1px solid var(--gift-gold);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.gift-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Inner Frame Styles */
.front-photo-container.inner-frame-gold::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 2.5px solid #d4af37;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45), inset 0 0 10px rgba(212, 175, 55, 0.25);
  border-radius: 4px;
  z-index: 5;
}

.front-photo-container.inner-frame-white-inset::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 3px solid #ffffff;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  z-index: 5;
}

/* YouTube Simulator Iframe Container */
.surface-youtube-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  background: #000;
  overflow: hidden;
}

.surface-youtube-container.is-playing {
  display: block;
}

.surface-youtube-container iframe {
  border: none;
}

