/* css/app.css */

:root {
  --alt-menu-height: 72px;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #f3f4f6;
  user-select: none;
}

/* Layout */
.alt-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--alt-menu-height);
}

.main-content {
  padding-bottom: calc(var(--alt-menu-height) + env(safe-area-inset-bottom, 0px));
}

/* Component Styles */
.firma-kart:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  transition: all 0.3s ease;
}

.btn-primary:hover {
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5), 0 2px 4px -1px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

/* Loader */
.loader {
  border-top-color: #3b82f6;
  animation: spinner 1.5s linear infinite;
}

@keyframes spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* File Input */
.file-input-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px dashed #d1d5db;
}

.file-input-label:hover {
  background: #e5e7eb;
  color: #1f2937;
}

/* Scanner Styles */
#barcode-scanner-container {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#scanner-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

#scanner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

#quagga-scanner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Scanner Overlay Effects */
.mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.cutout {
  position: absolute;
  width: 70%;
  max-width: 420px;
  aspect-ratio: 1.2/1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.corners {
  position: absolute;
  inset: 0;
}

.corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid #22c55e;
}

.corner.tl {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
}

.corner.tr {
  top: -3px;
  right: -3px;
  border-left: none;
  border-bottom: none;
}

.corner.bl {
  bottom: -3px;
  left: -3px;
  border-right: none;
  border-top: none;
}

.corner.br {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
}

.scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #22c55e;
  top: 50%;
  animation: sweep 2.5s infinite;
}

@keyframes sweep {
  0% { transform: translateY(-40%); }
  50% { transform: translateY(40%); }
  100% { transform: translateY(-40%); }
}

#barcode-scanner-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 2rem;
}

#scanner-hint {
  color: #fff;
  margin-top: 0.75rem;
  text-align: center;
  opacity: 0.9;
}

#scanner-toolbar {
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
  z-index: 3;
}

.toolbar-btn {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 8px 12px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.toolbar-btn.active {
  background: rgba(34, 197, 94, 0.7);
  border-color: rgba(34, 197, 94, 0.5);
}

.toolbar-btn.torch-on {
  background: rgba(255, 193, 7, 0.7);
  border-color: rgba(255, 193, 7, 0.5);
}