/* Base styles */
:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --secondary: #f5f5f5;
  --secondary-foreground: #171717;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --accent: #f5f5f5;
  --accent-foreground: #171717;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #0a0a0a;
  --radius: 0.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  font-feature-settings: "ss01", "ss02", "ss03", "cv01", "cv02", "cv03";
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background);
  color: var(--foreground);
}

/* Layout */
.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.content {
  width: 100%;
  max-width: 28rem; /* 448px */
  margin: 0 auto;
}

/* Typography */
.title {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 2rem;
}

.label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: block;
  margin-bottom: 0.5rem;
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.select-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.select-container {
  display: flex;
  flex-direction: column;
}

.select {
  width: 100%;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--background);
  font-family: inherit;
  font-size: 0.875rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
}

/* Collapsible */
.collapsible {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}

.collapsible-trigger {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.collapsible-trigger:hover {
  color: var(--foreground);
}

.chevron-icon {
  margin-right: 0.25rem;
  transition: transform 0.3s ease;
}

.collapsible-trigger[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.5s ease-in-out,
    opacity 0.5s ease-in-out,
    padding-top 0.5s ease-in-out;
}

.collapsible-content.expanded {
  max-height: 500px; /* Large enough to fit content */
  opacity: 1;
  padding-top: 1rem;
}

.setting-option {
  margin-bottom: 1rem;
}

.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Preview */
.preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 200px;
  background-color: var(--secondary);
  position: relative;
}

.preview::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(to bottom, transparent, var(--secondary));
  pointer-events: none;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.preview-content {
  font-family: monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  max-height: 300px;
  padding-bottom: 20px;
}

/* Buttons */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.button svg {
  width: 1rem;
  height: 1rem;
}

.button-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.button-outline:hover {
  background-color: var(--secondary);
}

.button-primary {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: var(--primary-foreground);
}

.button-primary:hover {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 640px) {
  .select-group {
    grid-template-columns: 1fr;
  }
}
