/* Plaka Tanıma PWA - Modern Glassmorphism & Dark Mode */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: rgba(19, 27, 46, 0.75);
  --bg-card-hover: rgba(30, 41, 69, 0.85);
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-danger: #ef4444;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-glass: rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Arka Plan Glow Efektleri */
.bg-glow {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(11, 15, 25, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Üst Başlık (Header) */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(11, 15, 25, 0.85);
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

.logo-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 500;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Ana İçerik Kapsayıcı */
main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 10;
}

/* Kamera Bölgesi */
.camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
}

.camera-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#overlayCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Canlı Çoklu Plaka HUD Rozeti (Tüm Görüş Alanı) */
.live-hud-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.hud-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 1.5s infinite;
}

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

.camera-placeholder .icon {
  font-size: 42px;
  opacity: 0.7;
}

/* Kamera Kontrol Butonları */
.camera-controls {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid var(--border-glass);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.btn-active {
  background: linear-gradient(135deg, var(--accent-green), #059669) !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

/* Listbox Kartı (Okunan Plakalar) */
.listbox-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.listbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.listbox-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.listbox-title h2 {
  font-size: 16px;
  font-weight: 700;
}

.count-badge {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.listbox-actions {
  display: flex;
  gap: 8px;
}

/* Plaka Listesi (Listbox) */
.plate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Özel Kaydırma Çubuğu */
.plate-list::-webkit-scrollbar {
  width: 5px;
}
.plate-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
.plate-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Tek Bir Plaka Elemanı (Item) */
.plate-item {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.plate-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.plate-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Görsel Plaka Rozeti (Gerçek Plaka Tasarımı) */
.plate-badge {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: #111827;
  border: 1.5px solid #000000;
  border-radius: 5px;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  font-weight: 800;
  letter-spacing: 1.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-size: 15px;
  user-select: all;
}

.plate-tr {
  background: #003399;
  color: #ffffff;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plate-number {
  padding: 4px 10px;
}

/* Plaka Kırpıntı Resmi (Thumbnail) */
.plate-thumb {
  width: 58px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #000;
}

.plate-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plate-time {
  font-size: 11px;
  color: var(--text-muted);
}

.plate-conf {
  font-size: 11px;
  color: var(--accent-green);
  font-weight: 600;
}

.plate-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Boş Durum (Empty State) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text-muted);
  gap: 10px;
  text-align: center;
}

.empty-state .icon {
  font-size: 38px;
  opacity: 0.5;
}

/* Ayarlar Çekmecesi (Settings Drawer) */
.settings-panel {
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  font-size: 12px;
}

.setting-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-item label {
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}

.setting-item input[type="range"] {
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* Bildirim Baloncuğu (Toast) */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-blue);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}
