/* playground.css */

/* Import font */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* ─── Theme Variables ─── */
:root {
  --bg-primary:     #28282b;
  --bg-surface:     #1e1e22;
  --text-primary:   #ffffff;
  --accent-main:    #0ff;
  --accent-alt:     #e63946;
  --border-green:   #39ff14;
  --border-yellow:  #f1c40f;
  --border-red:     #e74c3c;
  --border-blue:    #3498db;
  --border-magenta: #8e44ad;
  --font-heading:   'JetBrains Mono', monospace;
  --font-body:      'JetBrains Mono', monospace;
}
body.theme-inverted {
  --bg-primary:   #ffffff;
  --bg-surface:   #eeeeee;
  --text-primary: #000000;
  --accent-main:  #e63946;
  --accent-alt:   #0ff;
}

/* ─── Reset & Base ─── */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
  display:flex;
  flex-direction:column;
  background:var(--bg-primary);
  color:var(--text-primary);
  font-family:var(--font-body);
}
.main-content {
  flex:1;
  overflow-y:auto;
  padding:2rem;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.main-content::-webkit-scrollbar { display:none; }

/* ─── Header & Footer ─── */
.site-header, .site-footer {
  background:var(--bg-surface);
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 2rem;
  height:50px;
}
.site-header { border-bottom:1px solid var(--text-primary); }
.site-footer { border-top:1px solid var(--text-primary); }
.logo a, .top-nav a, .footer-nav a {
  color:var(--text-primary);
  text-decoration:none;
  font-weight:700;
  font-family:var(--font-heading);
}

#theme-toggle-btn {
  background:none;
  border:1px solid var(--accent-main);
  color:var(--accent-main);
  padding:0.25rem 0.5rem;
  font-size:0.875rem;
  cursor:pointer;
}
#theme-toggle-btn:hover { background:rgba(255,255,255,0.1); }

/* ─── Playground Wrapper ─── */
.playground-wrapper {
  max-width:1000px;
  margin:0 auto;
  border:3px solid var(--border-green);
  padding:1rem;
  display:flex;
  flex-direction:column;
  gap:1rem;
}

/* ─── Builder Section ─── */
.builder-section {
  border:2px solid var(--border-yellow);
  padding:0.5rem;
  display:flex;
  flex-direction:column;
  gap:0.5rem;
}
.builder-section h1,
.builder-section .subheading {
  position:relative;
  display:inline-block;
  font-family:var(--font-heading);
  color:var(--accent-main);
  padding-bottom:0.25rem;
  margin-bottom:0.5rem;
}
.builder-section h1 { font-size:1.75rem; }
.builder-section .subheading { font-style:italic; font-size:1.25rem; }
.builder-section h1::after,
.builder-section .subheading::after {
  content:'';
  display:block;
  width:100%;
  border-bottom:1px solid var(--text-primary);
  margin-top:0.25rem;
}

.field-row {
  display:flex;
  align-items:center;
  gap:0.5rem;
}
.field-row label { min-width:8rem; }

/* ─── Input Fields ─── */
.input-wrapper {
  position: relative;
  width: 100%;
}
.text-input, .seed-input {
  flex:1;
  width: 100%;
  max-width: 100%;
  padding:0.5rem;
  background:var(--bg-surface);
  border:1px solid var(--accent-main);
  color:var(--text-primary);
  font-family:var(--font-body);
  position: relative;
  z-index: 1;
}

/* ─── Controls Row & Dropdowns ─── */
.controls-row {
  display:flex;
  align-items:center;
  gap:0.5rem;
  flex-wrap:wrap;
}
.select-wrapper { position:relative; display:inline-block; }
.select-input {
  appearance:none;
  background:transparent;
  border:none;
  border-bottom:1px solid var(--text-primary);
  color:var(--text-primary);
  font-family:var(--font-body);
  font-size:0.875rem;
  padding:0.25rem 1rem 0.25rem 1.25rem;
  min-width:6rem;
  cursor:pointer;
}
.select-wrapper::before {
  content:'▼';
  position:absolute;
  left:0;
  top:50%;
  transform:translateY(-50%);
  color:var(--text-primary);
  pointer-events:none;
  font-size:0.75rem;
}

/* ─── Output Box & Actions ─── */
.output-row {
  display:flex;
  flex-direction:column;
  gap:0.25rem;
}
.output-box {
  width:100%;
  min-height:3rem;
  padding:0.25rem;
  background:var(--bg-surface);
  border:1px solid var(--accent-main);
  color:var(--text-primary);
  resize:vertical;
}
.output-actions {
  display:flex;
  gap:0.5rem;
}

/* ─── Button Builder Section ─── */
.button-builder-section {
  border:2px solid var(--border-red);
  padding:0.5rem;
  display:flex;
  flex-direction:column;
  gap:0.5rem;
}
.button-builder-section .field-row {
  display:flex;
  align-items:center;
  gap:1rem;
}

/* ─── Results Section ─── */
.results-section {
  display:flex;
  gap:0.5rem;
}
.generated-builds, .favorite-builds {
  flex:1;
  border:2px solid;
  padding:0.5rem;
  display:flex;
  flex-direction:column;
  max-height:300px;
  overflow-y:auto;
}
.generated-builds { border-color:var(--border-blue); }
.favorite-builds { border-color:var(--border-magenta); }
.generated-builds h2,
.favorite-builds h2 {
  color:var(--accent-main);
  font-family:var(--font-heading);
  display:inline-block;
  padding-bottom:0.25rem;
  margin-bottom:0.5rem;
}
.generated-builds h2::after,
.favorite-builds h2::after {
  content:'';
  display:block;
  width:100%;
  border-bottom:1px solid var(--text-primary);
  margin-top:0.25rem;
}
.generated-list, .favorite-list {
  display:flex;
  flex-wrap:wrap;
  gap:0.5rem;
}
.generated-list button, .favorite-list button {
  padding:0.25rem 0.5rem;
  background:var(--accent-alt);
  color:var(--text-primary);
  border:none;
  cursor:pointer;
  white-space:nowrap;
  font-family:var(--font-body);
}

/* ─── Action Buttons ─── */
.action-btn {
  font-weight: bold;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #000;
  background-color: #e5dfd5;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 6px 14px;
  box-shadow: 3px 3px 0 #333;
  cursor: pointer;
  user-select: none;
}
.action-btn.small-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
}

/* ─── Section Divider ─── */
.playground-wrapper section + section {
  border-top: 1px dotted var(--text-primary);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* ─── Footer ─── */
.site-footer {
  background:var(--bg-surface);
  padding:0.5rem 2rem;
  display:flex;
  justify-content:center;
}
.footer-nav a {
  margin:0 1rem;
  color:var(--text-primary);
  text-decoration:none;
  font-family:var(--font-body);
}

/* ─── Mobile ─── */
@media (max-width:768px) {
  .results-section { flex-direction:column; }
  .controls-row { flex-direction:column; align-items:stretch; }
}
