/* ============================================================
   GENERATOR PAGE STYLES
   ============================================================ */

.generator-page {
  padding-top: 80px;
  min-height: 100vh;
  padding-bottom: 4rem;
}

/* ---- Generator Header ---- */
.gen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.gen-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
}

[data-theme="light"] .gen-state-badge {
  background: rgba(0, 85, 204, 0.06);
  border-color: rgba(0, 85, 204, 0.2);
}

.gen-state-rev {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.gen-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.state-quick-select select {
  font-size: 0.85rem;
  padding: 0.5rem 2.5rem 0.5rem 0.875rem;
}

/* ---- Generator Layout ---- */
.gen-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
  align-items: start;
}

/* ---- Form Panel ---- */
.gen-form-card {
  padding: 1.75rem;
}

.gen-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.gen-form-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.field-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(0, 204, 255, 0.1);
  border: 1px solid rgba(0, 204, 255, 0.2);
  color: var(--accent-secondary);
  font-size: 0.65rem;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}

.gen-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* ---- Result Panel ---- */
.gen-result-panel {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.barcode-result-card {
  padding: 1.5rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.result-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

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

/* Barcode Output Area */
.barcode-output {
  background: #ffffff;
  border-radius: var(--radius-sm);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

[data-theme="light"] .barcode-output {
  background: #f8f9ff;
  border: 1px solid var(--border-color);
}

.barcode-placeholder {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.barcode-placeholder svg {
  width: 80px; height: 60px;
  color: var(--text-muted);
}

.barcode-placeholder p { line-height: 1.5; }

#barcodeCanvas {
  max-width: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Barcode Meta */
.barcode-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.meta-label { color: var(--text-muted); }
.meta-value { color: var(--text-secondary); font-weight: 600; }

/* Raw Data */
.raw-data-pre {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}

/* Scanner List */
.scanner-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.scanner-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---- Tooltip ---- */
.tooltip {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 5000;
  max-width: 220px;
  display: none;
  box-shadow: var(--shadow-card);
}

/* ---- Generating Animation ---- */
.btn-generating {
  position: relative;
  overflow: hidden;
}

.btn-generating::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1s ease infinite;
}

@keyframes shimmer {
  to { left: 100%; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .gen-layout { grid-template-columns: 1fr; }
  .gen-result-panel { position: static; }
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .gen-form-actions { flex-direction: column; }
  .gen-header { flex-direction: column; align-items: flex-start; }
  .scanner-list { grid-template-columns: 1fr; }
}
