/* =====================================================================
   scan.css — İSG Pro Saha Tarama Modülü Arayüzü
   Tasarım: Koyu zemin, glassmorphism, mobil-önce, 
   kamera overlay, animasyonlar
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Temel Değişkenler ─────────────────────────────────────────────── */
:root {
  --bg-dark:        #0a0d12;
  --bg-panel:       rgba(15, 20, 30, 0.85);
  --bg-glass:       rgba(255, 255, 255, 0.05);
  --border-glass:   rgba(255, 255, 255, 0.10);
  --accent-yellow:  #f59e0b;
  --accent-red:     #ef4444;
  --accent-green:   #10b981;
  --accent-blue:    #3b82f6;
  --accent-purple:  #8b5cf6;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --shadow-glow-y:  0 0 20px rgba(245, 158, 11, 0.4);
  --shadow-glow-r:  0 0 20px rgba(239, 68, 68, 0.5);
  --shadow-glow-g:  0 0 20px rgba(16, 185, 129, 0.4);
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --transition:     0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: manipulation;
}

/* ── Ana Kapsayıcı ─────────────────────────────────────────────────── */
#scan-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ── Kamera Video Katmanı ───────────────────────────────────────────── */
#camera-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  transform-origin: center;
}

/* ── Canvas Overlay (bounding box + ghost) ──────────────────────────── */
#overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ── Üst Durum Çubuğu ───────────────────────────────────────────────── */
#top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(10,13,18,0.9) 0%, transparent 100%);
  backdrop-filter: blur(0px);
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.top-bar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(245,158,11,0.3);
}

.top-bar-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}

.badge.badge-rec {
  border-color: rgba(239, 68, 68, 0.4);
}

.badge.badge-rec::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: pulse-red 1.5s infinite;
}

.badge.badge-dof {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-yellow);
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Mod Göstergesi ─────────────────────────────────────────────────── */
#mode-indicator {
  position: absolute;
  top: 60px; left: 50%; 
  transform: translateX(-50%);
  z-index: 50;
  transition: var(--transition);
  pointer-events: none;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid;
  white-space: nowrap;
}

.mode-pill.scanning {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.mode-pill.candidate {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--accent-yellow);
  box-shadow: var(--shadow-glow-y);
}

.mode-pill.dof-created {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  box-shadow: var(--shadow-glow-r);
}

.mode-pill.ghost-mode {
  background: rgba(139, 92, 246, 0.20);
  border-color: rgba(139, 92, 246, 0.5);
  color: #c4b5fd;
}

/* ── Viewfinder Çerçevesi ───────────────────────────────────────────── */
#viewfinder {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vf-corner {
  position: absolute;
  width: 24px; height: 24px;
  border-color: rgba(255,255,255,0.4);
  border-style: solid;
  transition: var(--transition);
}
.vf-corner.tl { top: 20%; left: 10%; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.vf-corner.tr { top: 20%; right: 10%; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.vf-corner.bl { bottom: 30%; left: 10%; border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.vf-corner.br { bottom: 30%; right: 10%; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

.vf-corner.active-yellow {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 8px rgba(245,158,11,0.6);
}
.vf-corner.active-red {
  border-color: var(--accent-red);
  box-shadow: 0 0 8px rgba(239,68,68,0.6);
}

/* ── Risk Kartı (aday / DÖF) ────────────────────────────────────────── */
#risk-card {
  position: absolute;
  left: 12px; right: 12px;
  bottom: 200px;
  z-index: 60;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  display: none;
}

#risk-card.visible {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

#risk-card.state-candidate {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-glow-y);
}

#risk-card.state-dof {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: var(--shadow-glow-r);
}

.risk-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.risk-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.risk-severity {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.severity-high   { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.severity-medium { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.severity-low    { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }

#risk-description {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 8px;
}

#risk-action-text {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  padding: 8px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-blue);
  line-height: 1.4;
}

.risk-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.btn-approve {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}
.btn-approve:active { transform: scale(0.96); }

.btn-dismiss {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}
.btn-dismiss:active { transform: scale(0.96); }

/* ── DÖF Form Paneli ────────────────────────────────────────────────── */
#dof-form-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-glass);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: none;
}

#dof-form-panel.visible {
  display: block;
  transform: translateY(0);
}

.form-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fca5a5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(255,255,255,0.09);
}

.btn-save-dof {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(239,68,68,0.35);
  transition: var(--transition);
}
.btn-save-dof:active { transform: scale(0.98); }

/* ── Alt Araç Çubuğu ────────────────────────────────────────────────── */
#bottom-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(10,13,18,0.95) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bottom-action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bottom-action-group span {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-round {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.btn-round:active { transform: scale(0.9); }

.btn-shutter {
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.btn-shutter:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.25);
}

.btn-camera-flip {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-mic {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  position: relative;
}

.btn-mic.active {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  color: var(--accent-red);
  animation: mic-pulse 2s infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.btn-pause {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-pause.paused {
  background: rgba(245,158,11,0.2);
  border-color: rgba(245,158,11,0.5);
  color: var(--accent-yellow);
}

/* ── Başlatma Ekranı ────────────────────────────────────────────────── */
#start-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #1a2035 0%, var(--bg-dark) 70%);
  padding: 32px;
  gap: 24px;
}

.start-logo {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 8px 32px rgba(245,158,11,0.3), 0 0 0 1px rgba(255,255,255,0.1);
  animation: logo-float 3s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.start-title {
  text-align: center;
}

.start-title h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.start-title p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.start-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.feature-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.feature-row .feature-icon {
  font-size: 20px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.feature-row .feature-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feature-row .feature-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 2px;
}

.btn-start {
  width: 100%;
  max-width: 320px;
  padding: 16px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 24px rgba(245,158,11,0.35);
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-start:active { transform: scale(0.97); }

.camera-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.camera-select-row label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

#camera-select {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  -webkit-appearance: none;
}

/* ── Bildirim Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: absolute;
  top: 70px; left: 12px; right: 12px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border: 1px solid;
}

.toast.info    { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); color: #93c5fd; }
.toast.success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: #6ee7b7; }
.toast.warning { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: #fcd34d; }
.toast.error   { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

@keyframes toast-in {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Kalite Göstergesi (blur / hareket) ─────────────────────────────── */
#quality-meter {
  position: absolute;
  top: 72px; right: 14px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.quality-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quality-bar-wrap span {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.quality-bar {
  width: 50px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.quality-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
  background: var(--accent-green);
}

.quality-bar-fill.low    { background: var(--accent-red); }
.quality-bar-fill.medium { background: var(--accent-yellow); }

/* ── DÖF Listesi Drawer ─────────────────────────────────────────────── */
#dof-list-drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 90vw);
  z-index: 80;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

#dof-list-drawer.open {
  transform: translateX(0);
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.drawer-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}
.btn-close-drawer:hover { background: var(--bg-glass); }

#dof-list-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dof-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.dof-item:active { transform: scale(0.98); }

.dof-item.has-keypoints {
  border-color: rgba(139,92,246,0.3);
}

.dof-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dof-item-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-red);
}

.dof-item-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245,158,11,0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(245,158,11,0.3);
}

.dof-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dof-keypoint-hint {
  margin-top: 6px;
  font-size: 10px;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Ghost Overlay Paneli ───────────────────────────────────────────── */
#ghost-panel {
  position: absolute;
  left: 12px; right: 12px; bottom: 180px;
  z-index: 55;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: var(--radius-lg);
  padding: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 0 24px rgba(139,92,246,0.3);
  display: none;
  animation: ghost-in 0.4s ease;
}

#ghost-panel.visible { display: block; }

@keyframes ghost-in {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.ghost-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ghost-match-score {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.ghost-match-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.ghost-match-fill {
  height: 100%;
  background: linear-gradient(to right, #8b5cf6, #c4b5fd);
  border-radius: 3px;
  transition: width 0.5s;
}

.btn-after-photo {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(139,92,246,0.4);
  transition: var(--transition);
}
.btn-after-photo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Yükleniyor / Loading ───────────────────────────────────────────── */
.loading-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Blur Uyarısı ───────────────────────────────────────────────────── */
#blur-warning {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fca5a5;
  backdrop-filter: blur(10px);
  pointer-events: none;
  display: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#blur-warning.show { display: flex; }

/* ── Responsif ──────────────────────────────────────────────────────── */
@media (min-width: 480px) {
  #risk-card, #ghost-panel {
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: min(440px, calc(100% - 24px));
  }
  #risk-card { left: 50%; right: auto; }
}

@media (prefers-color-scheme: light) {
  /* Zorla koyu temada kal — saha görünümü için */
  :root { color-scheme: dark; }
}

/* ── Oturum Özeti ───────────────────────────────────────────────────── */
#session-stats {
  position: absolute;
  bottom: 100px; left: 12px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
