/* Estilos personalizados para complementar Bootstrap */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
}

body {
  background-color: var(--light-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
/* Estilo para el selector de c¨¢mara */
#cameraSelect {
    max-width: 300px;
    margin: 0 auto;
}

/* Ajustes para m¨®viles */
@media (max-width: 576px) {
    #cameraSelect {
        max-width: 100%;
    }
}
#scanner {
  width: 100%;
  height: auto;
  max-height: 300px;
  background-color: #000;
  border-radius: 5px;
}

#productoInfo {
  transition: all 0.3s ease;
  min-height: 150px;
}

#productoInfo p {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

#productoInfo strong {
  color: var(--primary-color);
  min-width: 120px;
  display: inline-block;
}

.card {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  border-radius: 0 !important;
  padding: 1.25rem;
}

.btn-group .btn {
  min-width: 120px;
  font-weight: 500;
}

/* AnimaciÃ³n para el escÃ¡ner activo */
.scanner-active {
  box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

/* Loading state */
.loading-state {
  animation: fadeIn 0.3s ease;
  text-align: center;
  padding: 2rem 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* History styles */
.history-item {
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.history-item:hover {
  background-color: #f0f8ff;
  border-left-color: var(--primary-color);
}

.history-code {
  font-weight: bold;
  color: var(--primary-color);
}

.history-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Error styles */
.alert-danger {
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Connection status */
#connectionStatus {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.badge-danger {
  background-color: var(--danger-color);
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .btn-group .btn {
    min-width: 100px;
    font-size: 0.9rem;
  }
  
  #productoInfo p {
    font-size: 1rem;
  }
  
  #productoInfo strong {
    min-width: 90px;
  }
}