/* ==========================================================================
   WATSONS ALARM KONTROL - MOBİL BARKOD TARAYICI
   Kullanıcının Referans Ekran Görüntüsü ile %100 Birebir Uyumlu Tasarım
   ========================================================================== */

:root {
  --bg-page: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;

  --btn-green: #00C853;
  --btn-green-dark: #00A344;
  --btn-red: #E53935;
  --btn-red-dark: #C62828;
  --btn-navy: #252D3A;
  --btn-navy-hover: #1E2530;

  --border-subtle: #E2E8F0;
  --radius-camera: 22px;
  --radius-btn: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* ================= GİRİŞ EKRANI (İSİM + SİCİL) ================= */
.screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 20px 16px;
  background: #F8FAFC;
}

.login-box {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  max-width: 380px;
  width: 100%;
  padding: 28px 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.login-watsons-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0097A7 0%, #00B4D8 100%);
  color: #FFFFFF;
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 151, 167, 0.25);
}

.login-store-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0097A7;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-title-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
}

.login-subtitle-text {
  font-size: 0.82rem;
  color: #64748B;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}

.login-input, .login-select {
  width: 100%;
  padding: 13px 14px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #0F172A;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.login-input:focus, .login-select:focus {
  border-color: #0097A7;
  background: #FFFFFF;
}

.btn-login-submit {
  width: 100%;
  padding: 14px;
  background: var(--btn-navy);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 45, 58, 0.25);
  margin-top: 6px;
  transition: transform 0.1s ease;
}
.btn-login-submit:active {
  transform: scale(0.98);
}

/* ================= ANA EKRAN (REFERANS GÖRÜNTÜ İLE BİREBİR) ================= */
.screen-main {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* 1. Üst Bar: "Barkod Taratın" ve Flaş İkonu */
.top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  position: relative;
}

.user-quick-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748B;
  background: #F1F5F9;
  padding: 4px 10px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.top-bar-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1E293B;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.btn-flash-toggle {
  background: transparent;
  border: none;
  color: #1E293B;
  cursor: pointer;
  padding: 6px;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  z-index: 10;
}
.btn-flash-toggle.active {
  color: #F59E0B;
}

/* 2. Kamera Kutusu (Scan Modu - Kırmızı Lazerli) */
.camera-box-wrap {
  width: 100%;
  height: 280px;
  background: #000000;
  border-radius: var(--radius-camera);
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

#reader {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

#reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: var(--radius-camera);
}

/* Kamera İçindeki Nişangah ve Yeşil Köşeler (Referans Ekrandaki Gibi) */
.camera-reticle-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.camera-target-frame {
  width: 76%;
  height: 68%;
  position: relative;
  border-radius: 14px;
  box-shadow: 0 0 0 3000px rgba(0, 0, 0, 0.35);
  /* Yeşil kesikli çizgili nişangah kenarlıkları */
  border: 2px dashed rgba(74, 222, 128, 0.7);
}

/* 4 Köşedeki Parlak Yeşil Köşebentler */
.target-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #4ADE80;
  border-style: solid;
  filter: drop-shadow(0 0 6px #4ADE80);
}

.target-corner.tl {
  top: -2px;
  left: -2px;
  border-width: 4px 0 0 4px;
  border-top-left-radius: 12px;
}

.target-corner.tr {
  top: -2px;
  right: -2px;
  border-width: 4px 4px 0 0;
  border-top-right-radius: 12px;
}

.target-corner.bl {
  bottom: -2px;
  left: -2px;
  border-width: 0 0 4px 4px;
  border-bottom-left-radius: 12px;
}

.target-corner.br {
  bottom: -2px;
  right: -2px;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: 12px;
}

/* KIRMIZI + YEŞİL ANİMASYONLU LAZER ÇİZGİSİ (Referans Görseldeki Kırmızı Lazer Çizgisi) */
/* Kırmızı Lazer Çizgisi - 60-120 FPS GPU Donanım Hızlandırmalı, Sıfır Takılma */
.laser-beam-red {
  position: absolute;
  top: 0;
  left: 3%;
  right: 3%;
  height: 3px;
  background: #EF4444;
  box-shadow: 0 0 12px 3px rgba(239, 68, 68, 0.95), 0 0 22px 6px rgba(239, 68, 68, 0.65);
  border-radius: 9999px;
  pointer-events: none;
  z-index: 25;
  will-change: transform;
  transform: translate3d(0, 16px, 0);
  animation: laserScanSmooth 1.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

@keyframes laserScanSmooth {
  0% {
    transform: translate3d(0, 16px, 0);
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 230px, 0);
    opacity: 0.85;
  }
}

/* Kamera içi sessiz/flaş butonu (sağ üst) */
.camera-inner-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  backdrop-filter: blur(4px);
  font-size: 0.9rem;
}

/* 3. Okutulan Ürün Bilgi Rozeti (Kamera Altı) */
.scanned-product-badge {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.scanned-product-badge.detected {
  border-color: #00C853;
  background: #F0FDF4;
}

.badge-text-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.badge-text-sub {
  font-size: 0.75rem;
  color: #64748B;
  font-family: monospace;
}

/* 4. İKİ BÜYÜK BUTON: ALARM ÖTMÜYOR (YEŞİL) & ALARM ÖTÜYOR (KIRMIZI) */
/* Kullanıcının Yüklediği Resimdeki Birebir Butonlar: */
.action-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 2px;
}

.btn-state {
  height: 82px;
  border-radius: var(--radius-btn);
  border: 3px solid transparent;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.15s ease;
}

.btn-state:active {
  transform: scale(0.97);
}

.btn-state-text {
  text-align: left;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.btn-state-main {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.btn-state-icon {
  font-size: 1.85rem;
  flex-shrink: 0;
  margin-left: 6px;
}

/* 1. Buton: ALARM ÖTMÜYOR (Yeşil - Görseldeki gibi) */
.btn-state-green {
  background: var(--btn-green);
}
.btn-state-green:hover {
  background: var(--btn-green-dark);
}
.btn-state-green.active-selected {
  border-color: #0F172A;
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.4), 0 6px 16px rgba(0, 200, 83, 0.35);
  transform: scale(1.02);
}

/* 2. Buton: ALARM ÖTÜYOR (Kırmızı - Görseldeki gibi) */
.btn-state-red {
  background: var(--btn-red);
}
.btn-state-red:hover {
  background: var(--btn-red-dark);
}
.btn-state-red.active-selected {
  border-color: #0F172A;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.4), 0 6px 16px rgba(229, 57, 53, 0.35);
  transform: scale(1.02);
}

/* 5. KAYDET BUTONU (Görseldeki Gibi Koyu Lacivert / Siyah) */
.btn-save-main {
  width: 100%;
  height: 58px;
  background: var(--btn-navy);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 45, 58, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, background-color 0.15s ease;
  margin-top: 4px;
}

.btn-save-main:hover {
  background: var(--btn-navy-hover);
}

.btn-save-main:active {
  transform: scale(0.98);
}

/* 6. Hedef İlerlemesi: 10 Adet Kayıt Kotası */
.quota-strip {
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quota-counter-pill {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0097A7;
  font-family: monospace;
}

.quota-bar-bg {
  flex: 1;
  height: 7px;
  background: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0097A7 0%, #00C853 100%);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* 10 Kayıt Kutlama Bildirimi */
.celebration-box {
  background: #ECFDF5;
  border: 2px solid #00C853;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.25s ease;
}

.celebration-text {
  font-size: 0.95rem;
  font-weight: 900;
  color: #065F46;
}

.celebration-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 7. Alt Aksiyonlar & Çizelge Listesi */
.footer-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-tool {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  color: var(--text-dark);
  text-decoration: none;
}
.btn-tool:hover {
  background: #F8FAFC;
}

.btn-tool-excel {
  background: #10B981;
  color: #FFFFFF;
  border-color: #059669;
}
.btn-tool-excel:hover {
  background: #059669;
}

.btn-tool-wa {
  background: #25D366;
  color: #FFFFFF;
  border-color: #128C7E;
}
.btn-tool-wa:hover {
  background: #128C7E;
}

/* Liste Alanı (Bugün Okutulan 10 Ürün) */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.history-item {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.history-num {
  font-weight: 900;
  color: #64748B;
  width: 20px;
}

.history-name {
  flex: 1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-tag {
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.tag-ok {
  background: #DCFCE7;
  color: #15803D;
}
.tag-dead {
  background: #FEE2E2;
  color: #B91C1C;
}

.btn-item-del {
  background: transparent;
  border: none;
  color: #EF4444;
  cursor: pointer;
  font-size: 0.9rem;
}

/* El İle Barkod Arama Katlanır Satır */
.manual-input-box {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.input-code {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 16px;
  padding: 10px 12px;
  outline: none;
}
.input-code:focus {
  border-color: #0097A7;
}

.btn-code-find {
  padding: 8px 12px;
  background: #334155;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* ================= 10 ÜRÜN KONTROL TAMAMLANDI VE AKTAR BUTONU ================= */
.btn-finish-today {
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  background: linear-gradient(135deg, #059669 0%, #10B981 50%, #047857 100%);
  color: #FFFFFF;
  border: 2px solid #34D399;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px -3px rgba(16, 185, 129, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: finishButtonPulse 2.2s infinite ease-in-out;
  display: block;
  user-select: none;
}

.btn-finish-today:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.4);
}

@keyframes finishButtonPulse {
  0%, 100% {
    box-shadow: 0 6px 18px -3px rgba(16, 185, 129, 0.45);
    border-color: #34D399;
  }
  50% {
    box-shadow: 0 10px 26px -2px rgba(16, 185, 129, 0.75);
    border-color: #6EE7B7;
  }
}

.finish-btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.finish-btn-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.finish-btn-text {
  text-align: left;
}

.finish-btn-main {
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.finish-btn-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: #D1FAE5;
  margin-top: 1px;
}
