/* ==========================================================================
   QR & BARCODE STUDIO PRO - UI COMPONENTS & FORM STYLES
   ========================================================================== */

/* Sub-nav / Type Grid Selector */
.type-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.type-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  color: var(--text-muted);
}

.type-card i {
  font-size: 1.4rem;
  color: var(--accent-secondary);
}

.type-card span {
  font-size: 0.78rem;
  font-weight: 600;
}

.type-card:hover {
  border-color: var(--accent-primary);
  color: var(--text-main);
  transform: translateY(-2px);
}

.type-card.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

select.form-control {
  cursor: pointer;
}

/* Inline Grid Inputs */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* Accordion Options (Style Customization) */
.accordion-section {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.4);
}

.accordion-header {
  padding: 0.85rem 1.25rem;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  user-select: none;
}

.accordion-header i.chevron {
  transition: var(--transition-fast);
}

.accordion-section.open .accordion-header i.chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 1.25rem;
  display: none;
}

.accordion-section.open .accordion-body {
  display: block;
}

/* Custom Color Controls */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.color-picker-wrapper input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
}

/* Range Sliders */
.range-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-slider input[type="range"] {
  flex: 1;
  accent-color: var(--accent-primary);
}

.range-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-secondary);
  min-width: 36px;
}

/* Preview Side Panel (Sticky) */
.preview-panel {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preview-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 320px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.preview-box canvas, .preview-box svg, .preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.action-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.download-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

/* Scanner Viewport */
.scanner-viewport {
  width: 100%;
  max-width: 500px;
  height: 320px;
  margin: 0 auto 1.5rem;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--accent-primary);
  box-shadow: var(--accent-glow);
}

.scanner-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border: 2px dashed rgba(6, 182, 212, 0.8);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #06b6d4, #10b981, transparent);
  box-shadow: 0 0 15px #06b6d4;
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}

.scan-result-card {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-tertiary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  word-break: break-all;
}

/* History List & Batch Table */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.history-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.history-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
}

.history-text {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-primary);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* SEO Content & Article Styling */
.seo-content-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-glass);
}

.seo-article {
  margin-bottom: 2.5rem;
}

.seo-article h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.seo-article h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: var(--accent-secondary);
}

.seo-article p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.seo-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.seo-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.seo-card h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;

  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seo-card h4 i {
  color: var(--accent-primary);
}

/* FAQ Accordions */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.faq-item {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}
