/* Modern Asset Management Public Styles */

/* Form Styles */
.asset-management-form {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.asset-management-form h2 {
  color: #1f2937;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.asset-management-form .form-description {
  color: #6b7280;
  font-size: 16px;
  text-align: center;
  margin-bottom: 30px;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.form-group label .required {
  color: #ef4444;
  margin-left: 4px;
}

/* Form Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
  font-family: inherit;
}

/* Enhanced Placeholder Visibility */
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #555 !important;
  opacity: 0.8 !important;
  font-weight: 500;
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
  color: #6b7280 !important;
  opacity: 0.6 !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* Auto-generated Code Display */
.auto-generated-code {
  background: #f3f4f6;
  color: #6b7280;
  font-style: italic;
  font-size: 12px;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 4px;
}

/* File Upload */
.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}

.file-upload-area.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.file-upload-icon {
  font-size: 32px;
  color: #9ca3af;
  margin-bottom: 10px;
}

.file-upload-text {
  color: #6b7280;
  font-size: 14px;
}

.file-upload-text strong {
  color: #3b82f6;
}

/* Barcode Scanner */
.barcode-scanner-container {
  position: relative;
  margin: 15px 0;
}

.scanner-toggle-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scanner-toggle-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.scanner-container {
  margin-top: 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

#barcode-scanner {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 150px;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  pointer-events: none;
}

.scanner-overlay::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  animation: scannerPulse 2s infinite;
}

@keyframes scannerPulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
}

.scanner-status {
  padding: 10px;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 14px;
}

/* Submit Button */
.submit-container {
  margin-top: 30px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.submit-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  justify-content: center;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading State */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success/Error Messages */
.form-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.form-message.info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Registered Items List */
.registered-items-preview {
  margin-top: 20px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.registered-items-preview h3 {
  margin: 0 0 15px;
  color: #374151;
  font-size: 16px;
  font-weight: 600;
}

.items-list {
  display: grid;
  gap: 10px;
}

.item-preview {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}

.item-code {
  font-size: 12px;
  color: #6b7280;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
}

.sku-preview {
  background: #f3f4f6;
  color: #374151;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 12px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .asset-management-form {
    margin: 20px;
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .asset-management-form h2 {
    font-size: 24px;
  }

  .submit-btn {
    width: 100%;
  }

  #barcode-scanner {
    height: 250px;
  }

  .scanner-overlay {
    width: 200px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .asset-management-form {
    margin: 10px;
    padding: 15px;
  }

  .asset-management-form h2 {
    font-size: 20px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 12px;
  }

  #barcode-scanner {
    height: 200px;
  }

  .scanner-overlay {
    width: 150px;
    height: 100px;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .form-group input,
  .form-group select,
  .form-group textarea {
    border-width: 3px;
  }

  .submit-btn {
    border: 2px solid #1d4ed8;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.submit-btn:focus,
.scanner-toggle-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .barcode-scanner-container,
  .submit-container {
    display: none;
  }

  .asset-management-form {
    box-shadow: none;
    border: 1px solid #000;
  }
}
