.pattern-extract-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;
  max-height: 70vh;

  @media (max-width: 768px) {
    padding: 0;
    max-height: 95vh;
  }
}

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid var(--p-primary-color);
  border-radius: 6px;
  color: var(--p-text-color);

  i {
    font-size: 1.25rem;
    color: var(--p-primary-color);
    margin-top: 2px;
  }

  code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
  }
}

.pattern-section,
.placeholders-section,
.common-patterns-section,
.preview-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--p-text-secondary-color);
  }
}

.pattern-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pattern-input {
  flex: 1;
  font-family: monospace;
}

.placeholder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

:host ::ng-deep .placeholder-chip {
  cursor: pointer;
  font-family: monospace;
  font-size: 0.85rem;

  &:hover {
    background-color: var(--p-primary-color);
    color: var(--p-primary-contrast-color);
  }
}

.common-pattern-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.preview-item {
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--p-surface-300);

  &.preview-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
  }

  &.preview-failure {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
  }
}

.preview-filename {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;

  i {
    font-size: 1rem;
  }

  .pi-check-circle {
    color: #4caf50;
  }

  .pi-times-circle {
    color: #f44336;
  }
}

.preview-extracted {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-left: 1.5rem;
}

.extracted-field {
  display: flex;
  gap: 0.25rem;
  font-size: 0.85rem;

  .field-name {
    color: var(--p-text-secondary-color);
  }

  .field-value {
    font-weight: 500;
    color: var(--p-primary-color);
  }
}

.preview-error {
  padding-left: 1.5rem;
  font-size: 0.85rem;
  color: var(--p-text-secondary-color);
  font-style: italic;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.extracting-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;
  color: var(--p-text-secondary-color);
}
