/* DepoTakip - Profesyonel Mobil PWA Stil Dosyası */

:root {
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  touch-action: manipulation;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

/* Number Input Spin Butonlarını Sıfırla (Mobilde kaymayı önler) */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
}

/* iOS Safari Input Otomatik Zoom Engelleme */
@media screen and (max-width: 768px) {
  input:not(.text-2xl):not(.text-xl):not(.text-lg),
  select,
  textarea {
    font-size: 16px;
  }
}

/* Safe Area Padding for Modern Mobile Devices (iPhone notch & home bar) */
.pb-safe {
  padding-bottom: calc(5rem + var(--safe-bottom));
}

.pb-safe-nav {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
}

.pt-safe {
  padding-top: var(--safe-top);
}

/* Modern Bottom Sheet (Alt Çekmece) Animasyonları & Güvenli Alan */
.bottom-sheet-backdrop {
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet-content {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  max-height: 90dvh;
  overscroll-behavior: contain;
  padding-bottom: max(1.25rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
}

@media (min-width: 768px) {
  .bottom-sheet-content {
    max-height: 85vh;
    padding-bottom: 1.5rem;
  }
}

.bottom-sheet-backdrop.hidden-sheet {
  opacity: 0;
  pointer-events: none;
}

.bottom-sheet-backdrop.hidden-sheet .bottom-sheet-content {
  transform: translateY(100%);
}

.bottom-sheet-drag-handle {
  width: 44px;
  height: 5px;
  background-color: #cbd5e1;
  border-radius: 9999px;
  margin: 0 auto 12px auto;
  cursor: grab;
}

/* Kamera Görüntüleyici ve Reticle Çerçeve */
#reader {
  width: 100% !important;
  border: none !important;
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background-color: #020617;
  min-height: 260px;
}

#reader video,
#scannerVideo {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 1.5rem;
  display: block;
}

#reader__scan_region {
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#reader__scan_region img {
  display: none !important;
}

#reader__dashboard_section {
  display: none !important;
}

/* Kamera Hedef Çerçevesi (Reticle Brackets) */
.scanner-reticle-box {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  height: 52%;
  max-width: 320px;
  max-height: 180px;
  pointer-events: none;
  z-index: 20;
}

.scanner-reticle-box::before,
.scanner-reticle-box::after,
.scanner-reticle-box .reticle-bottom-corners::before,
.scanner-reticle-box .reticle-bottom-corners::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: #38bdf8;
  border-style: solid;
  pointer-events: none;
}

/* 4 Köşe Çizgisi */
.scanner-reticle-box::before {
  top: 0;
  left: 0;
  border-width: 4px 0 0 4px;
  border-top-left-radius: 10px;
}

.scanner-reticle-box::after {
  top: 0;
  right: 0;
  border-width: 4px 4px 0 0;
  border-top-right-radius: 10px;
}

.scanner-reticle-box .reticle-bottom-corners::before {
  bottom: 0;
  left: 0;
  border-width: 0 0 4px 4px;
  border-bottom-left-radius: 10px;
}

.scanner-reticle-box .reticle-bottom-corners::after {
  bottom: 0;
  right: 0;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: 10px;
}

/* Animasyonlu Lazer Çizgisi */
.scanner-laser-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0) 0%, rgba(56, 189, 248, 1) 50%, rgba(56, 189, 248, 0) 100%);
  box-shadow: 0 0 16px 3px rgba(56, 189, 248, 0.85);
  animation: laserScan 2.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes laserScan {
  0% { top: 8%; opacity: 0.3; }
  50% { top: 90%; opacity: 1; }
  100% { top: 8%; opacity: 0.3; }
}

/* Toast Bildirim Animasyonu */
.toast-notification {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translate(-50%, -120%);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

.toast-notification.show {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

/* Buton Basma / Dokunma Efekti (Tactile Haptic Feel) */
button, .touch-scale {
  transition: transform 0.12s ease, opacity 0.12s ease;
  user-select: none;
}

button:active, .touch-scale:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* Glassmorphism Efektleri */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-panel-dark {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Özel Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

/* ==================== YAZDIRMA (PRINT) STİLLERİ ==================== */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  /* Arka plan ve marginleri sıfırla */
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* Ana sayfa içeriklerini yer kaplamayacak şekilde gizle */
  nav, header, main, #mainTabs, #tabProducts, #tabIdeasoft, #tabOrders, #tabSales, #tabReports, #toast, .bottom-sheet-drag-handle {
    display: none !important;
  }

  .no-print {
    display: none !important;
  }

  /* Yalnızca açık olan (gizli olmayan) modalı göster, gizli olanları kesinlikle gizle */
  .hidden-sheet {
    display: none !important;
  }

  .bottom-sheet-backdrop:not(.hidden-sheet) {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  .bottom-sheet-content {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }
}

