/*
 * GençTek AI Photo Booth — Premium Light Kiosk
 * Palette: White (#fff) · Off-white (#f8f8f8) · Black (#111) · Red (#e63946)
 * Font: Inter
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-card: #fafafa;
  --text: #111111;
  --text-secondary: #666666;
  --red: #e63946;
  --red-soft: rgba(230, 57, 70, 0.08);
  --red-glow: rgba(230, 57, 70, 0.25);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.10);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100vw; height: 100vh;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  cursor: none;
  -webkit-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
}

/* ── Ambient Background ──────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(230,57,70,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(230,57,70,0.03) 0%, transparent 60%),
    var(--bg);
  pointer-events: none;
}

/* ── Virtual Cursor ──────────────────────────────── */
#gesture-feedback {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
}
.gesture-cursor {
  position: absolute;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border: 2.5px solid var(--text);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s, transform 0.12s var(--ease);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.04);
}
.gesture-cursor::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--red);
  border-radius: 50%;
}
.gesture-cursor.pinched {
  transform: scale(0.5);
  border-color: var(--red);
  box-shadow: 0 0 16px var(--red-glow);
}

/* ── HUD ─────────────────────────────────────────── */
.hud {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  padding: 8px 22px;
  border-radius: 100px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 13px; color: var(--text-secondary);
  z-index: 9990;
}
.hud-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ccc;
  transition: all 0.3s;
}

/* ── Screens ─────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
  transform: translateY(12px);
  z-index: 10;
}
.screen.active {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}

/* ── Hover (gesture) ─────────────────────────────── */
.hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 0 0 2px var(--red), var(--shadow-md) !important;
  transition: all 0.15s ease !important;
}

/* ═══════════════════════════════════════════════════
   IDLE SCREEN
   ═══════════════════════════════════════════════════ */
#screen-idle {
  align-items: center;
  padding: 0 8%;
}
.idle-content {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  z-index: 2;
}
.idle-badge {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 20px;
}
.idle-title {
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 20px;
}
.idle-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 44px;
}

/* Start Button */
.start-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 1.1rem; font-weight: 600;
  padding: 16px 36px;
  border: none; border-radius: var(--radius-sm);
  cursor: none;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(230,57,70,0.25);
}
.start-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* Visual grid on the right */
.idle-visual {
  flex: 0 0 42%;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.grid-cell {
  width: 130px; height: 130px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem;
  box-shadow: var(--shadow-sm);
  animation: cellFloat 5s ease-in-out infinite alternate;
  animation-delay: var(--delay);
  transition: transform 0.3s var(--ease);
}
@keyframes cellFloat {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* ═══════════════════════════════════════════════════
   THEME SELECTION
   ═══════════════════════════════════════════════════ */
#screen-theme {
  flex-direction: column;
  padding: 40px 60px;
  background: var(--bg);
}
.screen-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 36px;
}
.screen-top h2 {
  font-size: 2rem; font-weight: 700; color: var(--text);
}

.nav-btn {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem; font-weight: 500;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: none;
  transition: all 0.25s var(--ease);
}

.theme-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-content: center;
}
.theme-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: none;
  transition: all 0.3s var(--ease);
  box-shadow: var(--shadow-sm);
}
.theme-card-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 14px;
}
.theme-card-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.theme-card.selected {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.12), var(--shadow-md);
}

/* ═══════════════════════════════════════════════════
   CAMERA PREVIEW
   ═══════════════════════════════════════════════════ */
#screen-camera {
  padding: 40px;
  gap: 28px;
  background: var(--bg);
}
.cam-view {
  flex: 0 0 65%;
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.cam-feed {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.cam-corners { position: absolute; inset: 14px; pointer-events: none; }
.c {
  position: absolute;
  width: 28px; height: 28px;
  border-color: var(--red);
  border-style: solid;
  opacity: 0.6;
}
.c.tl { top:0; left:0; border-width: 2px 0 0 2px; }
.c.tr { top:0; right:0; border-width: 2px 2px 0 0; }
.c.bl { bottom:0; left:0; border-width: 0 0 2px 2px; }
.c.br { bottom:0; right:0; border-width: 0 2px 2px 0; }

.cam-label {
  position: absolute; top: 20px; left: 20px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cam-sidebar {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 28px;
}
.cam-info h3 {
  font-size: 1.6rem; font-weight: 700;
  margin-bottom: 8px; color: var(--text);
}
.cam-info p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.capture-btn {
  width: 130px; height: 130px;
  background: transparent;
  border: none;
  cursor: none;
  align-self: center;
  transition: all 0.3s var(--ease);
}
.capture-ring {
  width: 100%; height: 100%;
  border: 4px solid var(--text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s var(--ease);
}
.capture-dot {
  width: 104px; height: 104px;
  background: var(--red);
  border-radius: 50%;
  transition: all 0.2s var(--ease);
  box-shadow: 0 4px 20px rgba(230,57,70,0.3);
}
.capture-btn.hover .capture-ring { border-color: var(--red); }
.capture-btn.hover .capture-dot { transform: scale(0.85); }

/* ═══════════════════════════════════════════════════
   COUNTDOWN
   ═══════════════════════════════════════════════════ */
#screen-countdown {
  align-items: center; justify-content: center;
  z-index: 50;
  background: #000;
}
.countdown-bg {
  position: absolute; inset: 0;
  z-index: 1;
  /* No blur — user can see themselves and pose */
}
.countdown-bg .cam-feed {
  filter: brightness(0.7);
}
.countdown-num {
  font-size: clamp(12rem, 25vw, 22rem);
  font-weight: 900;
  color: var(--red);
  z-index: 2;
  -webkit-text-stroke: 4px rgba(255,255,255,0.9);
  text-shadow:
    0 0 60px rgba(230,57,70,0.5),
    0 8px 40px rgba(0,0,0,0.4);
  animation: countPulse 0.8s ease-out;
}
@keyframes countPulse {
  0%   { transform: scale(1.3); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scale(1); }
}
.countdown-flash {
  position: fixed; inset: 0;
  background: white;
  z-index: 99;
  opacity: 0; pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   PROCESSING
   ═══════════════════════════════════════════════════ */
#screen-processing {
  align-items: center; justify-content: center;
  background: var(--bg);
}
.process-card {
  text-align: center;
  padding: 56px 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.process-card h2 {
  font-size: 1.6rem; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.process-card p {
  color: var(--red);
  font-size: 1rem;
  font-weight: 500;
}

.spinner {
  width: 48px; height: 48px;
  margin: 0 auto 28px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   RESULT
   ═══════════════════════════════════════════════════ */
#screen-result {
  padding: 40px; gap: 32px;
  position: relative;
  background: var(--bg);
}
.result-images {
  flex: 0 0 60%;
  display: flex; gap: 16px;
  align-items: center;
}
.result-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}
.result-card img {
  width: 100%;
  display: block;
}
.result-card-label {
  display: block;
  padding: 10px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border);
}
.result-card-main {
  border-color: var(--red);
  box-shadow: 0 8px 30px rgba(230,57,70,0.1);
}
.result-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
  border: 1px solid var(--border);
}

.result-side {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.result-side h2 {
  font-size: 1.8rem; font-weight: 700; color: var(--text);
}
.result-side > p {
  color: var(--text-secondary);
  font-size: 1rem;
}
.qr-wrap {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.result-actions {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 4px;
}

/* Buttons */
.btn {
  font-family: var(--font);
  font-size: 0.95rem; font-weight: 600;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  cursor: none;
  transition: all 0.25s var(--ease);
  text-align: center;
  border: none;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 12px rgba(230,57,70,0.2);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

/* Timeout Bar */
.timeout-track {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
}
.timeout-bar {
  height: 100%;
  background: var(--red);
  width: 100%;
  transition: none;
}
