/* ========================================
   Advanced Barcode Scanner Styles
   ======================================== */

/* Quick Scan Toggle Button */
.pos-quick-scan-btn {
      background: linear-gradient(145deg, rgba(40, 40, 40, 0.8), rgba(30, 30, 30, 0.8));
      border: 2px solid rgba(255, 255, 255, 0.1);
      color: var(--text-color);
      padding: 8px 12px;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 0.9rem;
      font-weight: 600;
      white-space: nowrap;
      margin-left: 8px;
}

.pos-quick-scan-btn i {
      font-size: 1.1rem;
}

.pos-quick-scan-btn:hover {
      background: linear-gradient(145deg, rgba(0, 176, 155, 0.2), rgba(0, 140, 120, 0.2));
      border-color: rgba(0, 176, 155, 0.4);
      transform: translateY(-1px);
}

.pos-quick-scan-btn.active {
      background: linear-gradient(145deg, rgba(0, 176, 155, 0.4), rgba(0, 140, 120, 0.4));
      border-color: var(--primary-green);
      box-shadow: 0 0 20px rgba(0, 176, 155, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
      animation: scanPulse 2s infinite;
      color: white;
}

@keyframes scanPulse {

      0%,
      100% {
            box-shadow: 0 0 20px rgba(0, 176, 155, 0.5),
                  inset 0 1px 0 rgba(255, 255, 255, 0.2);
      }

      50% {
            box-shadow: 0 0 30px rgba(0, 176, 155, 0.8),
                  0 0 15px rgba(0, 176, 155, 0.6),
                  inset 0 1px 0 rgba(255, 255, 255, 0.3);
      }
}

.pos-quick-scan-btn .quick-scan-label {
      font-size: 0.85rem;
}

/* Scan Statistics Panel */
.scan-stats-panel {
      background: linear-gradient(145deg, rgba(0, 176, 155, 0.1), rgba(0, 140, 120, 0.05));
      padding: 15px;
      border-radius: 12px;
      margin-bottom: 15px;
      border: 2px solid rgba(0, 176, 155, 0.3);
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.scan-stat-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scan-stat-item:last-child {
      border-bottom: none;
}

.scan-stat-item span:first-child {
      color: var(--text-muted-color);
      font-size: 0.9rem;
}

.scan-stat-value {
      color: var(--primary-green);
      font-weight: bold;
      font-size: 1.2rem;
      text-shadow: 0 0 10px rgba(0, 176, 155, 0.3);
}

/* Recent Items List */
.recent-items-list {
      max-height: 120px;
      overflow-y: auto;
      background: rgba(0, 0, 0, 0.15);
      border-radius: 8px;
      padding: 8px;
      border: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-item {
      padding: 6px 10px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      font-size: 0.85rem;
      color: var(--text-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
      animation: slideInRight 0.3s ease-out;
}

.recent-item:last-child {
      border-bottom: none;
}

.recent-item-name {
      flex: 1;
      color: var(--text-color);
}

.recent-item-check {
      color: var(--primary-green);
      margin-left: 8px;
      font-size: 0.9rem;
}

@keyframes slideInRight {
      from {
            opacity: 0;
            transform: translateX(20px);
      }

      to {
            opacity: 1;
            transform: translateX(0);
      }
}

/* Scan success flash */
@keyframes scanFlash {

      0%,
      100% {
            background-color: var(--bg-secondary);
      }

      50% {
            background-color: rgba(76, 175, 80, 0.2);
      }
}

.scan-success-flash {
      animation: scanFlash 0.5s ease;
}

/* Toast Notification for Quick Scan */
.scan-toast {
      position: fixed;
      top: 80px;
      right: 20px;
      background: linear-gradient(145deg, rgba(0, 176, 155, 0.95), rgba(0, 140, 120, 0.95));
      color: white;
      padding: 12px 20px;
      border-radius: 12px;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
      z-index: 10000;
      animation: toastSlideIn 0.3s ease-out;
      font-weight: 600;
      border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes toastSlideIn {
      from {
            opacity: 0;
            transform: translateX(100px);
      }

      to {
            opacity: 1;
            transform: translateX(0);
      }
}

.scan-toast.hiding {
      animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideOut {
      from {
            opacity: 1;
            transform: translateX(0);
      }

      to {
            opacity: 0;
            transform: translateX(100px);
      }
}

/*  Quantity Dialog Styles */
.quantity-dialog-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.7);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10001;
      backdrop-filter: blur(4px);
      animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
      from {
            opacity: 0;
      }

      to {
            opacity: 1;
      }
}

.quantity-dialog {
      background: var(--bg-secondary);
      border: 2px solid var(--primary-green);
      border-radius: 12px;
      padding: 25px;
      min-width: 350px;
      max-width: 90%;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
      animation: slideUp 0.3s ease;
}

@keyframes slideUp {
      from {
            transform: translateY(20px);
            opacity: 0;
      }

      to {
            transform: translateY(0);
            opacity: 1;
      }
}

.quantity-dialog .dialog-header {
      margin-bottom: 15px;
      padding-bottom: 15px;
      border-bottom: 2px solid var(--border-color);
}

.quantity-dialog .item-sku {
      display: block;
      font-size: 1.1em;
      color: var(--primary-green);
      font-weight: 600;
      margin-bottom: 5px;
}

.quantity-dialog .item-name {
      display: block;
      font-size: 0.95em;
      color: var(--text-muted-color);
}

.quantity-dialog .system-qty {
      background: rgba(255, 255, 255, 0.05);
      padding: 10px;
      border-radius: 6px;
      margin-bottom: 15px;
      text-align: center;
      font-size: 0.9em;
      color: var(--text-muted-color);
}

.quantity-dialog .system-qty strong {
      color: var(--primary-green);
      font-size: 1.3em;
}

.quantity-dialog .quantity-input-wrapper {
      margin-bottom: 20px;
}

.quantity-dialog .quantity-input-wrapper label {
      display: block;
      margin-bottom: 8px;
      font-weight: 600;
      color: var(--text-color);
}

.quantity-dialog #quick-qty-input {
      width: 100%;
      padding: 12px 15px;
      font-size: 1.2em;
      text-align: center;
      border: 2px solid var(--border-color);
      border-radius: 8px;
      background: var(--bg-primary);
      color: var(--text-color);
      transition: all 0.3s ease;
}

.quantity-dialog #quick-qty-input:focus {
      outline: none;
      border-color: var(--primary-green);
      box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.quantity-dialog .dialog-actions {
      display: flex;
      gap: 10px;
      margin-top: 20px;
}

.quantity-dialog .dialog-btn {
      flex: 1;
      padding: 12px 20px;
      border: none;
      border-radius: 8px;
      font-size: 0.95em;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
}

.quantity-dialog .confirm-btn {
      background: var(--primary-green);
      color: white;
}

.quantity-dialog .confirm-btn:hover {
      background: #66BB6A;
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.quantity-dialog .skip-btn {
      background: rgba(255, 193, 7, 0.2);
      color: #FFC107;
      border: 1px solid #FFC107;
}

.quantity-dialog .skip-btn:hover {
      background: rgba(255, 193, 7, 0.3);
}

.quantity-dialog .cancel-btn {
      background: rgba(244, 67, 54, 0.2);
      color: #F44336;
      border: 1px solid #F44336;
}

.quantity-dialog .cancel-btn:hover {
      background: rgba(244, 67, 54, 0.3);
}

/* Update search container to accommodate new button */
.pos-search-container {
      flex-grow: 1;
      background: var(--surface-color);
      border-radius: 8px;
      display: flex;
      align-items: center;
      padding: 0 15px;
      border: 1px solid var(--border-color);
      gap: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
      .quick-scan-label {
            display: none;
      }

      .pos-quick-scan-btn {
            padding: 8px 10px;
      }

      .scan-stats-panel {
            padding: 10px;
      }

      .scan-stat-value {
            font-size: 1rem;
      }
}

/* Force Scanner Modal to be on top of everything */
#scanAssetModal {
      z-index: 10000 !important;
}

/* Quick Scan Blinking Animation */
@keyframes blink-red {
      0% {
            background-color: var(--surface-color);
            color: var(--text-color);
      }

      50% {
            background-color: var(--accent-red);
            color: white;
      }

      100% {
            background-color: var(--surface-color);
            color: var(--text-color);
      }
}

.quick-scan-active {
      animation: blink-red 1.5s infinite;
      border: 1px solid var(--accent-red) !important;
}