/* ==========================================================================
   AtlasSERP Interactive Playground Styles
   ========================================================================== */

:root {
  --pg-bg: #0b0e14;
  --pg-card-bg: #11151f;
  --pg-input-bg: #0c0f17;
  --pg-border: #1a2233;
  --pg-border-focus: #38bdf8;
  --pg-text: #f8fafc;
  --pg-text-muted: #94a3b8;
  --pg-text-dim: #64748b;
  --pg-accent-blue: #38bdf8;
  --pg-accent-hover: #0ea5e9;
  --pg-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --pg-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

.pg-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: var(--pg-text);
  font-family: var(--pg-font-sans);
}

.pg-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.pg-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0;
}

/* Two-Panel Layout */
.pg-container {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 960px) {
  .pg-container {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   Left Panel: Form Controls
   ========================================== */
.pg-panel-left {
  background: var(--pg-card-bg);
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.pg-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pg-label-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pg-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.pg-param-badge {
  font-family: var(--pg-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Type Row with Select + Search Button */
.pg-type-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pg-type-select-wrap {
  flex: 1;
  position: relative;
}

.pg-btn-search {
  background: #38bdf8;
  color: #070a10;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.15rem;
  font-family: var(--pg-font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pg-btn-search:hover {
  background: #7dd3fc;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.pg-btn-search:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Inputs & Selects */
.pg-input,
.pg-select,
.pg-textarea {
  background: var(--pg-input-bg);
  border: 1px solid var(--pg-border);
  color: #f1f5f9;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font-family: var(--pg-font-sans);
  font-size: 0.88rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.pg-input:focus,
.pg-select:focus,
.pg-textarea:focus {
  border-color: var(--pg-border-focus);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.pg-select option {
  background: #11151f;
  color: #f1f5f9;
}

/* Number Stepper */
.pg-input[type="number"] {
  font-family: var(--pg-font-mono);
}

/* Toggle Switch Row */
.pg-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pg-toggle-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.pg-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  cursor: pointer;
}

.pg-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pg-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: 0.25s;
  border-radius: 20px;
}

.pg-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.25s;
  border-radius: 50%;
}

.pg-switch input:checked + .pg-slider {
  background-color: #38bdf8;
}

.pg-switch input:checked + .pg-slider:before {
  transform: translateX(18px);
}

/* ==========================================
   Right Panel: Results & Code View
   ========================================= */
.pg-panel-right {
  background: var(--pg-card-bg);
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

/* Right Header / Tabs */
.pg-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--pg-border);
  background: #0d111a;
  height: 48px;
}

.pg-tabs-list {
  display: flex;
  gap: 1.5rem;
  height: 100%;
}

.pg-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--pg-font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.2rem;
  transition: color 0.2s;
}

.pg-tab-btn:hover {
  color: #f1f5f9;
}

.pg-tab-btn.active {
  color: #38bdf8;
}

.pg-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #38bdf8;
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 8px #38bdf8;
}

.pg-credits-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Secondary Toolbar inside Code Tab */
.pg-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  background: #0f131d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pg-toolbar-select {
  background: #171d2c;
  border: 1px solid #232d3f;
  color: #f1f5f9;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.pg-toolbar-select:focus {
  border-color: #38bdf8;
}

.pg-method-badge {
  background: #1e2638;
  border: 1px solid #28354d;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-family: var(--pg-font-mono);
}

.pg-copy-btn {
  background: #1e2638;
  border: 1px solid #2b3952;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pg-copy-btn:hover {
  background: #273449;
  color: #ffffff;
  border-color: #38bdf8;
}

/* Content Viewports */
.pg-tab-content {
  display: none;
  flex: 1;
  overflow: auto;
}

.pg-tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Code Pre Body */
.pg-code-pre,
.pg-results-pre {
  margin: 0;
  padding: 1.25rem;
  background: #080b11;
  color: #e2e8f0;
  font-family: var(--pg-font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow: auto;
  flex: 1;
  min-height: 480px;
}

/* Results Toolbar */
.pg-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: #0f131d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pg-res-meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pg-badge-ok {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.pg-badge-latency {
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 600;
}
