:host {
  display: block;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

.voucher-page {
  background: #f0f2f5;
  min-height: 100vh;
  height: auto;
  overflow: scroll;
  padding: 24px 32px;

  &.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100vw;
    height: 100vh;
    padding: 24px 32px 40px;
    overflow: auto;
    background: #eef2ff;
  }
}

// ── Header Card ─────────────────────────────────────────────────────────
.header-card {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.header-subtitle {
  font-size: 14px;
  color: #64748b;
}

.header-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  border-color: #fecaca;
  color: #dc2626;
}

// Target JSON button — distinct style
.btn-target-json {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  transition: all 0.2s;

  mat-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
  }

  &:hover:not(:disabled) {
    background: #1e293b;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
  }

  &:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

// ── Method Cards ─────────────────────────────────────────────────────────
.method-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.method-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.2s ease;

  &:hover {
    border-color: #a3e635;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }

  &.active {
    border-color: #4ade80;
    background: linear-gradient(135deg, #f0fdf4 0%, #fafff6 100%);
  }
}

.method-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.method-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.method-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

// ── Content Card ──────────────────────────────────────────────────────────
.content-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.ai-badge {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

// ── Examples ────────────────────────────────────────────────────────────
.examples-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.examples-title {
  font-size: 14px;
  font-weight: 600;
  color: #16a34a;
  margin-bottom: 12px;
}

.example-item {
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;

  &:hover {
    background: #ecfdf5;
    border-color: #4ade80;
  }

  &:last-child {
    margin-bottom: 0;
  }
}

// ── Text Area ─────────────────────────────────────────────────────────────
.text-area {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 16px;

  &:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  }
}

// ── Buttons ───────────────────────────────────────────────────────────────
.btn-row,
.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 10px 24px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  &:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  }
}

.btn-secondary {
  padding: 10px 24px;
  background: #fff;
  color: #475569;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  &:hover {
    background: #f8fafc;
  }
}

.btn-success {
  padding: 10px 24px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  &:hover {
    background: #15803d;
  }
}


// ── Processing ────────────────────────────────────────────────────────────
.processing-card {
  background: linear-gradient(135deg, #f0fdf4, #faf5ff);
  border: 1px solid #d9f99d;
  border-left: 4px solid #7c3aed;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.processing-title {
  font-size: 16px;
  font-weight: 700;
  color: #7c3aed;
  margin-bottom: 16px;
}

.processing-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  color: #374151;
}

.step-check {
  color: #16a34a;
  font-weight: 700;
}

// ── Entity Viewer Container ───────────────────────────────────────────────
.entity-viewer-container {
  margin-bottom: 24px;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
}

// ── TARGET JSON VIEWER PANEL ─────────────────────────────────────────────
.json-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.json-panel {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 16px;
  width: 90vw;
  max-width: 860px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
}

.json-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.json-code-wrap {
  flex: 1;
  overflow: auto;
  padding: 20px;
  background: #0a0f1e;
}

.json-code {
  margin: 0;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  white-space: pre-wrap;
}