.playground {
  padding: 2rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.operationSelector select {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--ifm-color-emphasis-300);
  background: var(--ifm-background-color);
  color: var(--ifm-font-color-base);
}

.buttons {
  display: flex;
  gap: 0.5rem;
}

.textAreas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 996px) {
  .textAreas {
    grid-template-columns: 1fr;
  }
}

.textAreaContainer {
  position: relative;
}

.textAreaContainer label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--ifm-color-primary);
}

.textArea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--ifm-color-emphasis-300);
  border-radius: 8px;
  font-family: var(--ifm-font-family-monospace);
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s;
}

.textArea:focus {
  outline: none;
  border-color: var(--ifm-color-primary);
}

.textArea.output {
  background-color: var(--ifm-color-emphasis-100);
  cursor: not-allowed;
}

.characterCount {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.875rem;
  color: var(--ifm-color-emphasis-600);
  background: var(--ifm-background-color);
  padding: 0.25rem;
}

.outputActions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.loading {
  text-align: center;
  padding: 1rem;
  color: var(--ifm-color-primary);
  font-weight: 600;
}

.examples {
  margin: 3rem 0;
  text-align: center;
}

.exampleButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.info ul {
  margin: 0;
  padding-left: 1.5rem;
}

.info li {
  margin-bottom: 0.5rem;
}

/* RTL support */
[dir="rtl"] .textAreas {
  direction: ltr;
}

[dir="rtl"] .exampleButtons {
  direction: ltr;
}

[dir="rtl"] .info ul {
  padding-right: 1.5rem;
  padding-left: 0;
}