/* ==========================================================================
   Scanner & Reader View + History Drawer Styling
   ========================================================================== */

.scanner-layout, .history-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .scanner-layout, .history-layout {
    grid-template-columns: 1fr;
  }
}

.scanner-modes-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.scanner-mode-btn {
  flex: 1;
  padding: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.scanner-mode-btn.active {
  background: var(--accent-primary);
  color: #0f172a;
  border-color: var(--accent-primary);
}

.scanner-viewport-box {
  min-height: 320px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  gap: 0.75rem;
}

.drop-zone input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.video-container {
  position: relative;
  width: 100%;
  height: 340px;
  background: #000000;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-laser-line {
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--status-error);
  box-shadow: 0 0 12px var(--status-error);
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 15%; }
  50% { top: 85%; }
  100% { top: 15%; }
}

.result-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-format {
  font-size: 0.9rem;
  color: var(--status-success);
}

.result-value-box textarea {
  font-family: var(--font-mono);
}

.result-actions {
  display: flex;
  gap: 0.75rem;
}

/* History Card */
.history-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  max-height: 520px;
  overflow-y: auto;
}

.history-item-card {
  padding: 1rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-sym-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-primary);
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-item-value code {
  display: block;
  word-break: break-all;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
  gap: 1rem;
}
