/* === Barcode Scanner — Tool Styles === */

.bs-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* Mode toggle */
.bs-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2.5rem 0 1.25rem;
}
.bs-mode-pill {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color var(--transition), background var(--transition);
}
.bs-mode-pill:hover {
  border-color: var(--accent);
}
.bs-mode-pill input[type="radio"] {
  accent-color: var(--accent);
  margin: 0;
}
.bs-mode-pill input[type="radio"]:checked ~ span {
  font-weight: 600;
}
.bs-mode-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.bs-panel {
  margin-bottom: 1.25rem;
}

/* Dropzone (mirrors PDF Split's pattern) */
.bs-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}
.bs-dropzone:hover,
.bs-dropzone:focus,
.bs-dropzone.bs-dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  outline: none;
}
.bs-dropzone__inner {
  pointer-events: none;
}
.bs-dropzone__inner .bs-btn {
  pointer-events: auto;
}
.bs-dropzone__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.bs-dropzone__text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.bs-dropzone__sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

/* Camera */
.bs-camera-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 1rem;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bs-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.bs-video.is-active {
  display: block;
}
.bs-camera-placeholder {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 1rem;
}
.bs-camera-placeholder.is-hidden {
  display: none;
}
.bs-scan-frame {
  position: absolute;
  inset: 12%;
  border: 3px solid var(--accent);
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25);
}
.bs-camera-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 0.75rem;
}

/* Result */
.bs-result {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin: 1rem 0 1.5rem;
}
.bs-result__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 10px;
}
.bs-result__text {
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
  margin: 0 0 12px;
  font-family: var(--font-mono, monospace);
}
/* Messages */
.bs-error {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 0.875rem;
  margin-bottom: 12px;
}

/* Actions / buttons */
.bs-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bs-btn {
  padding: 8px 22px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
}
.bs-btn--small {
  height: 32px;
  padding: 4px 14px;
  font-size: 0.8rem;
}
.bs-btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.bs-btn--primary:hover:not(:disabled) {
  background: var(--accent-hover, #1d4ed8);
  border-color: var(--accent-hover, #1d4ed8);
}
.bs-btn--secondary {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent);
}
.bs-btn--secondary:hover:not(:disabled) {
  background: var(--accent-light);
}
.bs-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.bs-btn--ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Common uses grid */
.bs-copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.bs-copy-grid article h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.bs-copy-grid article p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* FAQ */
.bs-faq {
  margin-top: 2.5rem;
}
.bs-faq h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
}
.bs-faq__item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.bs-faq__item summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.bs-faq__item summary::-webkit-details-marker { display: none; }
.bs-faq__item summary::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform var(--transition);
}
.bs-faq__item[open] summary::after {
  transform: rotate(45deg);
}
.bs-faq__item p {
  padding: 0 16px 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .bs-actions {
    flex-direction: column;
  }
  .bs-btn {
    width: 100%;
    height: 42px;
  }
  .bs-mode-pill {
    flex: 1 1 100%;
  }
}
