/* Split QR Code specific styles */

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--color-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.tab-btn {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  background: var(--color-accent);
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Generate Tab */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.textarea {
  width: 100%;
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  line-height: 1.6;
  resize: vertical;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
}

.textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.text-info {
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.options-row {
  display: flex;
  gap: 16px;
}

.option-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.select-field {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.select-field:focus {
  outline: none;
  border-color: var(--color-accent);
}

.btn-primary {
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--color-accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition);
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background-color: var(--color-bg);
  border-color: var(--color-accent);
}

/* Output Section */
.output-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.output-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.output-actions {
  display: flex;
  gap: 12px;
}

.print-header {
  display: none;
}

.scan-link-qr {
  display: none;
}

.print-header .scan-url {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* QR Grid */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.qr-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-muted);
}

.qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-preview canvas {
  max-width: 100%;
  height: auto;
}

.btn-download {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-download:hover {
  border-color: var(--color-accent);
}

/* Scan Tab */
.scan-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.camera-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 400px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

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

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.scan-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Progress */
.scan-progress {
  background: var(--color-surface);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

.progress-bar {
  height: 8px;
  background: var(--color-bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.scanned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.scanned-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
}

.scanned-item.scanned {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Result Section */
.result-section {
  background: var(--color-surface);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

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

.result-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.result-text {
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .options-row {
    flex-direction: column;
  }

  .qr-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .output-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .scan-controls {
    flex-direction: column;
  }

  .scan-controls button {
    width: 100%;
  }
}

/* Print styles */
@media print {
  /* Hide non-print elements */
  .header,
  .footer,
  .back-link,
  .tabs,
  .input-section,
  .no-print,
  .btn-download {
    display: none !important;
  }

  /* Show print-only elements */
  .print-only {
    display: block !important;
  }

  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #000;
  }

  .print-header .scan-link-qr {
    display: block !important;
    margin: 0 auto 12px;
  }

  .print-header p {
    margin: 4px 0;
  }

  .print-header .scan-url {
    font-size: 1rem;
    color: #000;
  }

  /* Reset page styles */
  .main {
    padding: 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .output-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  /* QR grid for print */
  .qr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .qr-card {
    break-inside: avoid;
    border: 1px solid #ccc;
    padding: 12px;
  }

  .qr-label {
    font-size: 1rem;
    font-weight: bold;
    color: #000;
  }

  .qr-preview canvas {
    max-width: 100%;
  }
}
