@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --ios-green: #34c759;
  --ios-green-glow: rgba(52, 199, 89, 0.45);
  --ios-red: #ff3b30;
  --ios-red-glow: rgba(255, 59, 48, 0.45);
  --ios-amber: #ff9500;
  --ios-amber-glow: rgba(255, 149, 0, 0.45);
  --ios-indigo: #5e5ce6;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Roboto, sans-serif;
  background-color: #16161a;
  color: #f5f5f7;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: -0.01em;
}

/* Custom refined scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Apple iOS 18 & FCPX Pro Studio Panels */
.ios-glass {
  background: rgba(24, 24, 30, 0.88);
  backdrop-filter: blur(35px) saturate(190%);
  -webkit-backdrop-filter: blur(35px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
}

.ios-pill {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* DYNAMIC ISLAND HEADER */
.dynamic-island {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  background: rgba(22, 22, 28, 0.92);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  padding: 6px 14px;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.9), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 95vw;
}

/* Live Presence Badge (Green Pulsing Dot) */
.live-indicator-dot {
  position: relative;
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border-radius: 9999px;
  box-shadow: 0 0 10px #22c55e;
}

.live-indicator-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  border: 1.5px solid #22c55e;
  animation: livePing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes livePing {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* 🌟 THE BIG 3 FCPX STUDIO DECISION BUTTONS (SOLID, HIGH-CONTRAST, TACTILE) 🌟 */
.ios-decision-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 680px;
}

.decision-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  cursor: pointer;
  flex: 1;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.decision-btn:active {
  transform: scale(0.94) !important;
}

/* 1. SELECT (Solid Pro Studio Emerald Green) */
.btn-select {
  background: #15803d;
  color: #ffffff;
  border-color: #22c55e;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45);
}

.btn-select:hover, .btn-select.active-decision {
  background: #16a34a;
  border-color: #4ade80;
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.65), 0 0 15px rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

/* 2. REJECT (Solid Pro Studio Crimson Red) */
.btn-reject {
  background: #b91c1c;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.btn-reject:hover, .btn-reject.active-decision {
  background: #dc2626;
  border-color: #f87171;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.65), 0 0 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* 3. DECIDE (Solid Pro Studio Golden Amber) */
.btn-maybe {
  background: #b45309;
  color: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
}

.btn-maybe:hover, .btn-maybe.active-decision {
  background: #d97706;
  border-color: #fbbf24;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.65), 0 0 15px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

/* SCREEN EDGE GLOW FLASH */
.screen-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.flash-select {
  box-shadow: inset 0 0 100px 30px rgba(52, 199, 89, 0.6);
  animation: flashPulse 0.32s ease-out forwards;
}

.flash-reject {
  box-shadow: inset 0 0 100px 30px rgba(255, 59, 48, 0.6);
  animation: flashPulse 0.32s ease-out forwards;
}

.flash-maybe {
  box-shadow: inset 0 0 100px 30px rgba(255, 149, 0, 0.6);
  animation: flashPulse 0.32s ease-out forwards;
}

@keyframes flashPulse {
  0% { opacity: 0; transform: scale(0.99); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* CENTER DYNAMIC POP BADGE STAMP */
.decision-pop-stamp {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  z-index: 45;
  pointer-events: none;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.12em;
  padding: 16px 36px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.decision-pop-stamp.active {
  animation: stampBurst 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stampBurst {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  35% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -65%) scale(1.05); opacity: 0; }
}

.stamp-select {
  background: rgba(36, 138, 61, 0.94);
  color: #ffffff;
  border: 2px solid #70e68c;
  box-shadow: 0 20px 50px rgba(52, 199, 89, 0.65);
}

.stamp-reject {
  background: rgba(201, 42, 42, 0.94);
  color: #ffffff;
  border: 2px solid #ff8a80;
  box-shadow: 0 20px 50px rgba(255, 59, 48, 0.65);
}

.stamp-maybe {
  background: rgba(184, 110, 0, 0.94);
  color: #ffffff;
  border: 2px solid #ffe082;
  box-shadow: 0 20px 50px rgba(255, 149, 0, 0.65);
}

/* Active photo badge on top-right of image */
.photo-decision-watermark {
  position: absolute;
  top: 80px;
  right: 24px;
  padding: 8px 18px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 25;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: none;
}

.photo-decision-watermark.selected {
  background: rgba(52, 199, 89, 0.9);
  color: #ffffff;
  border: 1.5px solid #70e68c;
}

.photo-decision-watermark.rejected {
  background: rgba(255, 59, 48, 0.9);
  color: #ffffff;
  border: 1.5px solid #ff8a80;
}

.photo-decision-watermark.maybe {
  background: rgba(255, 149, 0, 0.9);
  color: #ffffff;
  border: 1.5px solid #ffe082;
}

/* Main Display Viewport */
.image-canvas {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.active-image {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.25s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.95);
  border-radius: 6px;
}

/* Ambient luxury studio backdrop */
.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85vw;
  height: 85vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(94, 92, 230, 0.16) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

/* Filmstrip bar */
.filmstrip-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 14px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.filmstrip-thumb {
  position: relative;
  flex-shrink: 0;
  width: 74px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  scroll-snap-align: center;
  background: #12141f;
}

.filmstrip-thumb:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

.filmstrip-thumb.active {
  opacity: 1;
  border-color: #5e5ce6;
  box-shadow: 0 0 20px rgba(94, 92, 230, 0.6);
  transform: scale(1.08);
}

/* Thumb status badge dot */
.thumb-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  border: 1.5px solid #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  z-index: 2;
}

.thumb-badge.badge-select { background-color: var(--ios-green); }
.thumb-badge.badge-reject { background-color: var(--ios-red); }
.thumb-badge.badge-maybe { background-color: var(--ios-amber); }

/* Navigation buttons */
.nav-btn {
  background: rgba(14, 16, 26, 0.72);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
}

.nav-btn:active {
  transform: scale(0.93);
}

/* Auto-hide chrome */
.player-chrome {
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.player-chrome.hidden-chrome {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.player-chrome-top.hidden-chrome {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px);
}

.nav-cue-left.hidden-chrome {
  opacity: 0;
  pointer-events: none;
  transform: translate(-12px, -50%);
}

.nav-cue-right.hidden-chrome {
  opacity: 0;
  pointer-events: none;
  transform: translate(12px, -50%);
}

/* Filter pills */
.filter-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.filter-pill.active {
  color: #ffffff;
  background: #5e5ce6;
  border-color: #7d7aff;
  box-shadow: 0 0 14px rgba(94, 92, 230, 0.55);
}

/* 🌟 FCPX STUDIO MOBILE SAFE DOCK 🌟 */
.studio-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  background: rgba(20, 20, 26, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 10px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  padding-left: 12px;
  padding-right: 12px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
}

/* Floating Quick Download Button (Always 100% visible on canvas) */
.floating-quick-download {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 30;
  background: rgba(30, 30, 38, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-quick-download:hover {
  background: #2563eb;
  border-color: #60a5fa;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.floating-quick-download:active {
  transform: scale(0.95);
}

/* Progressive Zero-Lag Preview Rendering */
.progressive-preview-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

.progressive-preview-layer img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: blur(10px);
  transform: scale(1.02);
  transition: opacity 0.28s ease;
}

.progressive-preview-layer.hidden {
  opacity: 0;
  visibility: hidden;
}
