/* Core layout */
:root{
  --bg1: #0a0a0f;
  --bg2: #0f1220;
  --panel: #14162a;
  --text: #e8ecff;
  --muted: #b8c0ff;
  --accent1: #00eaff;
  --accent2: #6c5ce7;
  --glow: 0 0 20px rgba(0,234,255,0.45), 0 0 60px rgba(108,92,231,0.25);
  --ring: 0 0 0 3px rgba(0,234,255,0.25);
  --radius: 18px;
}

*{box-sizing: border-box}

html,body{
  height:100%;
  margin:0;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% 0%, rgba(108,92,231,0.18), transparent),
              radial-gradient(1000px 800px at 90% 10%, rgba(0,234,255,0.18), transparent),
              linear-gradient(180deg, var(--bg1), var(--bg2));
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index: 10;
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 18px;
  backdrop-filter: blur(8px);
  background: rgba(10,10,15,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand{display:flex; align-items:center; gap:10px}
.brand h1{font-size: 18px; margin:0; letter-spacing: 0.5px}
.brand-dot{
  width:10px; height:10px; border-radius:999px;
  background: radial-gradient(circle at 30% 30%, var(--accent1), var(--accent2));
  box-shadow: var(--glow);
}

.actions{display:flex; align-items:center; gap:10px; flex-wrap: wrap;}
.checkbox{display:flex; align-items:center; gap:8px; color:var(--muted); font-size: 13px}

/* Buttons */
.btn{
  border:1px solid rgba(255,255,255,0.1);
  background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover{ transform: translateY(-1px); box-shadow: var(--glow); border-color: rgba(255,255,255,0.25) }
.btn:active{ transform: translateY(1px) }
.btn.primary{
  border-color: rgba(0,234,255,0.4);
  box-shadow: var(--glow);
}
.btn.small{ padding:6px 10px; font-size:12px }

/* Grid */
.grid{
  display:grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: auto;
  gap:16px;
  padding:16px;
}
.panel{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  overflow: hidden;
  min-height: 280px;
}
.input-panel{ grid-column: 1 / 2 }
.preview-panel{ grid-column: 2 / 3 }
.outputs-panel{ grid-column: 1 / 3 }

.panel-header{
  display:flex; align-items:center; justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.panel-header h2{ margin:0; font-size:16px; color: var(--text) }
.mini-actions{ display:flex; gap:8px; flex-wrap: wrap }

textarea{
  width: 100%;
  min-height: 220px;
  background: rgba(0,0,0,0.35);
  color: var(--text);
  border: none;
  outline: none;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.hint{ margin: 8px 12px 12px; color: var(--muted); font-size: 12px }

/* Preview and console */
#preview{
  width: 100%;
  height: 320px;
  border: none;
  display: block;
  background: #0b0b12;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.console{
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.35);
}
.console-header{ padding:10px 12px; color: var(--muted); font-size:12px }
.console-body{
  height: 160px;
  overflow: auto;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}
.log{ padding:6px 8px; margin-bottom:6px; border-radius:10px; background: rgba(255,255,255,0.05) }
.log.info{ border-left: 3px solid var(--accent1) }
.log.warn{ border-left: 3px solid #ffcc00 }
.log.error{ border-left: 3px solid #ff5544 }

/* Outputs */
.outputs{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
  padding: 12px;
}
.output-card{
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  display:flex; flex-direction: column;
}
.output-card-head{
  display:flex; align-items:center; justify-content: space-between;
  padding: 10px 12px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.output-card h3{ margin:0; font-size: 14px }

.footer{
  text-align:center;
  color: var(--muted);
  padding: 20px 10px 28px;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 1100px){
  .grid{ grid-template-columns: 1fr; }
  .input-panel{ grid-column: 1 / 2 }
  .preview-panel{ grid-column: 1 / 2 }
  .outputs-panel{ grid-column: 1 / 2 }
  #preview{ height: 260px }
  .outputs{ grid-template-columns: 1fr }
}
