/* Photobooth: Section styles, camera card, and live strip template */

.photobooth-section {
  background: var(--bg-primary);
  padding: 80px 0;
}

.photobooth-container {
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: start;
}

/* KOLOM KIRI: KAMERA & BINGKAI */
.photobooth-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.camera-view {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0a0a0a;
  position: relative;
  border: 1px solid var(--border);
}

.camera-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: none;
}

.camera-view canvas {
  display: none;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  text-align: center;
  padding: 24px;
}

.camera-placeholder svg {
  color: var(--text-secondary);
}

.camera-placeholder p {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.camera-placeholder.hidden {
  display: none;
}

/* ── Flash Overlay ── */
.flash-overlay {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.flash-overlay.flash {
  animation: cameraFlash 0.35s ease-out;
}

@keyframes cameraFlash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

/* ── Countdown Overlay ── */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  transition: opacity 0.2s ease;
}

.countdown-overlay.active {
  opacity: 1;
}

.countdown-number {
  font-family: var(--font-serif);
  font-size: 5.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 4px 24px rgba(0,0,0,0.4);
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ── Status Bar & Dots ── */
.photo-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
}

.photo-counter {
  display: flex;
  gap: 8px;
  align-items: center;
}

.counter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--transition-base);
}

.counter-dot.captured {
  background: #10B981;
  transform: scale(1.15);
}

.counter-dot.active {
  background: var(--accent);
  transform: scale(1.25);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.2);
}

.photo-step-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── Kontrol Kamera ── */
.camera-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-camera {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-xl);
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn-camera:hover:not(:disabled) {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-camera:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-capture {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.btn-capture:hover:not(:disabled) {
  background: #333;
  border-color: #333;
}

[data-theme="dark"] .btn-capture:hover:not(:disabled) {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #141413;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
}

/* PILIHAN BINGKAI DENGAN PREVIEW */
.frame-selector-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.frame-selector-header {
  margin-bottom: 16px;
}

.frame-selector-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.frame-selector-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 300;
}

.frame-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.frame-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
  user-select: none;
}

.frame-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.frame-card.active {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

/* ── Swatch Miniature Preview ── */
.frame-swatch {
  width: 38px;
  height: 52px;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.swatch-strip {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.swatch-photo {
  display: block;
  width: 100%;
  height: 18px;
  border-radius: 2px;
}

/* Minimalis Swatch */
.frame-swatch-minimal {
  background: #FFFFFF;
  border: 1px solid #D8D8D4;
}
.frame-swatch-minimal .swatch-photo {
  background: #E8ECEF;
  border: 1px solid #D8D8D4;
}

/* Vintage Swatch */
.frame-swatch-vintage {
  background: #F5EFE6;
  border: 1px solid #C8BCAC;
}
.frame-swatch-vintage .swatch-photo {
  background: #D8CCA8;
  border: 1px solid #C4B498;
}

/* Lembut Swatch */
.frame-swatch-soft {
  background: #EEF3F7;
  border: 1px solid #BED0DF;
}
.frame-swatch-soft .swatch-photo {
  background: #C4D7E8;
  border: 1px solid #AFC8DC;
}

/* Monokrom Swatch */
.frame-swatch-monochrome {
  background: #1C1C1C;
  border: 1px solid #383838;
}
.frame-swatch-monochrome .swatch-photo {
  background: #3A3A3A;
  border: 1px solid #4D4D4D;
}

.frame-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.frame-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.frame-card-desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 300;
}

.frame-card-check {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.frame-card.active .frame-card-check {
  opacity: 1;
}

/* KOLOM KANAN: LIVE STRIP PREVIEW */
.photobooth-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
}

.live-strip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.live-strip-header {
  text-align: center;
  width: 100%;
}

.live-strip-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.live-strip-status {
  display: block;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ── TEMPLATE STRIP FISIK LIVE ── */
.photo-strip-template {
  width: 250px;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
  position: relative;
}

/* ── Gaya Bingkai Live Strip ── */
/* Minimalis */
.photo-strip-template.frame-minimal {
  background: #FFFFFF;
  border: 1px solid #E8E8E4;
  color: #1A1A1A;
}

/* Vintage */
.photo-strip-template.frame-vintage {
  background: #F5EFE6;
  border: 1px solid #D4C9B8;
  color: #5C4F3D;
}
.photo-strip-template.frame-vintage .slot-photo {
  filter: sepia(30%) contrast(95%) brightness(105%);
}

/* Lembut (Soft) */
.photo-strip-template.frame-soft {
  background: #EEF3F7;
  border: 1px solid #D0DCE8;
  color: #4A5568;
}
.photo-strip-template.frame-soft .slot-photo {
  filter: brightness(105%) contrast(95%) saturate(90%);
}

/* Monokrom */
.photo-strip-template.frame-monochrome {
  background: #181818;
  border: 1px solid #333333;
  color: #EAEAEA;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}
.photo-strip-template.frame-monochrome .slot-photo {
  filter: grayscale(100%);
}

/* ── Slot Foto Individual ── */
.strip-slot {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-strip-template.frame-monochrome .strip-slot {
  background: rgba(255, 255, 255, 0.04);
}

.slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  border: 1.5px dashed rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  color: rgba(0, 0, 0, 0.35);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.photo-strip-template.frame-monochrome .slot-placeholder {
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.35);
}

.strip-slot.active-slot .slot-placeholder {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(180, 83, 9, 0.04);
}

.slot-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
  animation: photoDropIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes photoDropIn {
  0% {
    opacity: 0;
    transform: scaleX(-1) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scaleX(-1) scale(1);
  }
}

/* ── Tombol Ulangi Per Slot Foto ── */
.slot-retake-btn {
  position: absolute;
  bottom: 7px;
  right: 7px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.72);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.88;
  transition: all 0.2s ease;
}

.slot-retake-btn:hover {
  opacity: 1;
  background: rgba(20, 20, 20, 0.92);
  transform: translateY(-1px);
}

/* ── Strip Footer ── */
.strip-footer {
  text-align: center;
  padding: 8px 0 2px;
  margin-top: 4px;
}

.strip-brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
}

.strip-tagline {
  font-size: 0.65rem;
  opacity: 0.65;
  margin-top: 2px;
  font-weight: 300;
}

.strip-date {
  font-size: 0.6rem;
  opacity: 0.5;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* ── Layer Stiker Doodle Minimalis (Live Preview) ── */
.strip-doodles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}

.doodle-item {
  position: absolute;
  pointer-events: none;
  user-select: none;
  animation: doodlePopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes doodlePopIn {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

/* Doodle Tape Kertas (Washi Tape) */
.doodle-tape-top {
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  width: 68px;
  height: 18px;
  background: rgba(235, 224, 198, 0.82);
  border-left: 1.5px dashed rgba(160, 145, 118, 0.45);
  border-right: 1.5px dashed rgba(160, 145, 118, 0.45);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.doodle-tape-corner-1 {
  top: 12px;
  left: 8px;
  width: 34px;
  height: 11px;
  transform: rotate(-32deg);
  background: rgba(235, 224, 198, 0.78);
  border-left: 1px dashed rgba(160, 145, 118, 0.4);
  border-right: 1px dashed rgba(160, 145, 118, 0.4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.doodle-tape-corner-2 {
  bottom: 66px;
  right: 8px;
  width: 34px;
  height: 11px;
  transform: rotate(-30deg);
  background: rgba(235, 224, 198, 0.78);
  border-left: 1px dashed rgba(160, 145, 118, 0.4);
  border-right: 1px dashed rgba(160, 145, 118, 0.4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ── Panel Kustomisasi Stiker & Pesan Pendek (Sebelum Simpan PNG) ── */
.strip-customizer {
  width: 100%;
  max-width: 265px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customizer-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customizer-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.sticker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sticker-pill {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.sticker-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.sticker-pill.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
  font-weight: 500;
}

.sticker-pill-icon {
  font-size: 0.78rem;
  line-height: 1;
}

.strip-caption-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.76rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.strip-caption-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 157, 175, 0.15);
}

.strip-caption-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ── Tombol Aksi Strip ── */
.strip-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 265px;
}

.btn-save-strip {
  width: 100%;
  justify-content: center;
}

.btn-save-strip:not(:disabled) {
  background: #10B981;
  border-color: #10B981;
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 4px 22px rgba(16, 185, 129, 0.55); }
}

/* RESPONSIF */
@media (max-width: 860px) {
  .photobooth-section {
    padding: 56px 0;
  }

  .photobooth-container {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 560px;
    margin: 0 auto;
  }

  .photobooth-right {
    position: static;
  }

  .photo-strip-template {
    width: 220px;
  }
}

@media (max-width: 600px) {
  .photobooth-section {
    padding: 44px 0;
  }

  .photobooth-container {
    gap: 18px;
    padding: 0;
  }

  .camera-card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
    gap: 14px;
  }

  .camera-view {
    max-width: 380px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
  }

  .camera-placeholder {
    padding: 16px;
    gap: 8px;
  }

  .camera-placeholder svg {
    width: 36px;
    height: 36px;
  }

  .camera-placeholder p {
    font-size: 0.82rem;
  }

  .countdown-number {
    font-size: 3.5rem;
  }

  .photo-status-bar {
    padding: 4px 2px;
  }

  .counter-dot {
    width: 8px;
    height: 8px;
  }

  .photo-step-label {
    font-size: 0.76rem;
  }

  .camera-controls {
    gap: 8px;
  }

  .btn-camera {
    padding: 9px 18px;
    font-size: 0.82rem;
    gap: 6px;
  }

  .frame-selector-box {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .frame-selector-header {
    margin-bottom: 12px;
  }

  .frame-selector-title {
    font-size: 0.96rem;
  }

  .frame-selector-hint {
    font-size: 0.72rem;
  }

  /* Tetap 2 kolom rapi di HP, jangan 1 kolom raksasa */
  .frame-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .frame-card {
    padding: 8px 10px;
    gap: 8px;
    border-radius: var(--radius-sm);
  }

  .frame-swatch {
    width: 26px;
    height: 36px;
    padding: 2px;
  }

  .swatch-photo {
    height: 12px;
  }

  .frame-card-name {
    font-size: 0.76rem;
  }

  .frame-card-desc {
    font-size: 0.64rem;
  }

  .frame-card-check {
    font-size: 0.72rem;
  }

  /* Kolom Kanan: Live Strip Card di HP dibuat ramping dan proporsional */
  .live-strip-card {
    padding: 18px 14px 16px;
    border-radius: var(--radius-md);
    gap: 14px;
  }

  .live-strip-label {
    font-size: 0.96rem;
  }

  .live-strip-status {
    font-size: 0.72rem;
  }

  /* Strip foto ramping ala photobooth otentik Jepang/Korea */
  .photo-strip-template {
    width: 175px;
    padding: 10px 10px 6px;
    gap: 6px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  }

  .strip-slot {
    border-radius: 4px;
  }

  .slot-placeholder {
    gap: 4px;
    font-size: 0.65rem;
    border-width: 1px;
  }

  .slot-placeholder svg {
    width: 16px;
    height: 16px;
  }

  .strip-footer {
    padding: 4px 0 0;
    margin-top: 2px;
  }

  .strip-brand {
    font-size: 0.78rem;
  }

  .strip-tagline {
    font-size: 0.58rem;
    margin-top: 1px;
  }

  .strip-date {
    font-size: 0.52rem;
    margin-top: 1px;
  }

  .strip-customizer {
    max-width: 240px;
    padding: 10px 12px;
    gap: 8px;
  }

  .strip-controls {
    max-width: 240px;
    gap: 8px;
  }

  .btn-save-strip {
    padding: 9px 16px;
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  .photo-strip-template {
    width: 160px;
    padding: 8px 8px 6px;
  }

  .strip-customizer,
  .strip-controls {
    max-width: 220px;
  }

  .frame-card {
    padding: 6px 8px;
    gap: 6px;
  }

  .frame-swatch {
    width: 22px;
    height: 32px;
  }
}
