/* ============================================================
   Playground — AI Prompt Playground styles
   ============================================================ */

.playground {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
}

/* ── Header ── */
.playground__header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.playground__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .9rem;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #6366F1, #06b6d4);
  color: #fff;
  margin-bottom: 1rem;
}
.playground__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 .6rem;
  letter-spacing: -.02em;
}
.playground__subtitle {
  color: #64748B;
  font-size: 1rem;
  margin: 0 auto;
  max-width: 520px;
  line-height: 1.6;
}
.playground__rate-info {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  font-size: .78rem;
  color: #94A3B8;
  background: #F1F5F9;
  padding: .35rem .8rem;
  border-radius: 9999px;
}

/* ── Two-panel layout ── */
.playground__body {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .playground__body { grid-template-columns: 1fr; }
}

/* ── Left: Prompt picker ── */
.playground__prompts {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.playground__prompts-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94A3B8;
  margin-bottom: .25rem;
}
.playground__prompt-btn {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all .18s cubic-bezier(.16,1,.3,1);
  width: 100%;
}
.playground__prompt-btn:hover {
  border-color: #6366F1;
  box-shadow: 0 2px 16px rgba(99,102,241,.1);
  transform: translateY(-1px);
}
.playground__prompt-btn--active {
  border-color: #6366F1;
  background: linear-gradient(135deg, #EEF2FF, #F0FDFF);
  box-shadow: 0 2px 16px rgba(99,102,241,.12);
}
.playground__prompt-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}
.playground__prompt-text { display: flex; flex-direction: column; gap: .15rem; }
.playground__prompt-label {
  font-size: .85rem;
  font-weight: 700;
  color: #1e293b;
}
.playground__prompt-desc {
  font-size: .75rem;
  color: #64748B;
  line-height: 1.4;
}

/* ── Right: Input + Output ── */
.playground__panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.playground__input-section {
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.playground__input-label {
  font-size: .8rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.playground__textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: .85rem 1rem;
  font-size: .9rem;
  font-family: inherit;
  color: #1e293b;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
  line-height: 1.6;
}
.playground__textarea:focus { border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.playground__run-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.playground__run-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366F1, #818CF8);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 2px 12px rgba(99,102,241,.3);
}
.playground__run-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99,102,241,.4);
}
.playground__run-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.playground__run-btn--loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pg-spin .7s linear infinite;
  display: inline-block;
  margin-left: .25rem;
}
@keyframes pg-spin { to { transform: rotate(360deg); } }

.playground__remaining {
  font-size: .75rem;
  color: #94A3B8;
  white-space: nowrap;
}
.playground__remaining--low { color: #F59E0B; font-weight: 600; }
.playground__remaining--zero { color: #EF4444; font-weight: 700; }

/* ── Output area ── */
.playground__output-section {
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  overflow: hidden;
  min-height: 200px;
  transition: border-color .2s;
}
.playground__output-section--active { border-color: #6366F1; }
.playground__output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #F1F5F9;
  background: #FAFBFF;
}
.playground__output-label {
  font-size: .78rem;
  font-weight: 700;
  color: #6366F1;
  text-transform: uppercase;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.playground__copy-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .8rem;
  border-radius: 7px;
  border: 1px solid #E2E8F0;
  background: #fff;
  font-size: .75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
}
.playground__copy-btn:hover { background: #6366F1; color: #fff; border-color: #6366F1; }
.playground__copy-btn--copied { background: #10B981; color: #fff; border-color: #10B981; }
.playground__output-body {
  padding: 1.25rem;
  font-size: .88rem;
  line-height: 1.75;
  color: #334155;
  max-height: 600px;
  overflow-y: auto;
}
.playground__output-body h1,
.playground__output-body h2 { font-size: 1.05rem; color: #1e293b; margin: 1.2rem 0 .5rem; font-weight: 700; }
.playground__output-body h3 { font-size: .95rem; color: #1e293b; margin: 1rem 0 .4rem; font-weight: 600; }
.playground__output-body p  { margin: 0 0 .75rem; }
.playground__output-body ul,
.playground__output-body ol { padding-left: 1.4rem; margin: .5rem 0 .75rem; }
.playground__output-body li { margin-bottom: .3rem; }
.playground__output-body table {
  width: 100%; border-collapse: collapse; font-size: .82rem; margin: .75rem 0;
}
.playground__output-body th {
  background: #F8FAFC; padding: .5rem .75rem;
  border: 1px solid #E2E8F0; font-weight: 700; color: #475569; text-align: left;
}
.playground__output-body td { padding: .45rem .75rem; border: 1px solid #E2E8F0; }
.playground__output-body code {
  background: #F1F5F9; padding: .15rem .4rem; border-radius: 4px;
  font-family: 'Fira Code', monospace; font-size: .82rem; color: #6366F1;
}
.playground__output-body pre {
  background: #1e293b; color: #e2e8f0; padding: 1rem; border-radius: 10px;
  overflow-x: auto; font-size: .82rem; line-height: 1.6; margin: .75rem 0;
}
.playground__output-body blockquote {
  border-left: 3px solid #6366F1; padding: .5rem 1rem;
  background: #EEF2FF; border-radius: 0 8px 8px 0; margin: .75rem 0; color: #3730A3;
}
.playground__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: #CBD5E1;
  gap: .75rem;
}
.playground__placeholder-icon { font-size: 2.5rem; opacity: .6; }
.playground__placeholder-text { font-size: .85rem; max-width: 280px; line-height: 1.5; }
.playground__error {
  padding: 1rem 1.25rem;
  background: #FFF5F5;
  color: #C53030;
  font-size: .85rem;
  border-radius: 8px;
  margin: .5rem 1.25rem;
}
.playground__powered {
  text-align: center;
  font-size: .72rem;
  color: #CBD5E1;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
