﻿/* ==========================================================================
   laboratorio-prompts.css — Laboratório de Prompts com IA (F5)
   Design System Oficial F5 com Construtor de Pilares e Terminal de IA
   ========================================================================== */

:root {
  --lp-bg: #07111e;
  --lp-surface: #0b1a2d;
  --lp-surface-hover: #10243e;
  --lp-cyan: #38bdf8;
  --lp-cyan-glow: rgba(56, 189, 248, 0.4);
  --lp-yellow: #facc15;
  --lp-yellow-glow: rgba(250, 204, 21, 0.4);
  --lp-green: #4ade80;
  --lp-purple: #c084fc;
  --lp-pink: #f472b6;
  --lp-text: #f8fafc;
  --lp-text-muted: #94a3b8;
  --lp-font: 'Barlow', -apple-system, sans-serif;
  --lp-font-cond: 'Barlow Condensed', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--lp-bg);
  font-family: var(--lp-font);
  color: var(--lp-text);
  user-select: none;
  -webkit-user-select: none;
}

.lp-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  background: radial-gradient(circle at 50% 15%, #0e223d 0%, #050d18 100%);
}

/* ── Topbar ── */
.lp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.2rem;
  background: rgba(7, 17, 30, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
  z-index: 20;
}

.lp-back-btn {
  color: var(--lp-cyan);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}
.lp-back-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  transform: translateX(-2px);
}

.lp-top-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lp-top-title span:first-child {
  font-family: var(--lp-font-cond);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}
.lp-top-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--lp-yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lp-top-controls {
  display: flex;
  gap: 0.5rem;
}
.lp-btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--lp-text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lp-btn-icon:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--lp-cyan);
  border-color: rgba(56, 189, 248, 0.4);
}
.lp-btn-icon svg { width: 16px; height: 16px; }

/* ── Palco Principal ── */
.lp-main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.4rem 1.2rem 0.6rem;
  overflow: hidden;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  gap: 0.4rem;
}

/* ── HUD ── */
.lp-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.lp-stat-box {
  background: rgba(11, 26, 45, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 0.25rem 0.7rem;
  display: flex;
  flex-direction: column;
  min-width: 75px;
}
.lp-stat-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--lp-text-muted);
  letter-spacing: 0.05em;
}
.lp-stat-val {
  font-family: var(--lp-font-cond);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.lp-stat-val.gold { color: var(--lp-yellow); text-shadow: 0 0 10px var(--lp-yellow-glow); }
.lp-stat-val.cyan { color: var(--lp-cyan); }

.lp-mission-badge {
  font-family: var(--lp-font-cond);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #fff;
  letter-spacing: 0.04em;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

/* ── Card do Desafio ── */
.lp-challenge-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgba(11, 26, 45, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 0.5rem 0.9rem;
}
.lp-challenge-icon {
  font-size: 1.6rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.lp-challenge-info { flex: 1; min-width: 0; }
.lp-challenge-tag {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--lp-yellow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lp-challenge-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 0.1rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lp-challenge-desc {
  font-size: 0.78rem;
  color: var(--lp-text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Grade do Laboratório (2 Colunas) ── */
.lp-lab-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  min-height: 0;
}

/* ── Coluna 1: Construtor de Prompt ── */
.lp-builder-panel {
  background: linear-gradient(180deg, #0e223d 0%, #081628 100%);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow-y: auto;
  gap: 0.5rem;
}

.lp-panel-header {
  font-family: var(--lp-font-cond);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--lp-cyan);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding-bottom: 0.3rem;
}

.lp-pillars-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lp-pillar-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.lp-pillar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lp-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lp-tag-role { background: rgba(192, 132, 252, 0.2); color: var(--lp-purple); border: 1px solid rgba(192, 132, 252, 0.4); }
.lp-tag-ctx { background: rgba(56, 189, 248, 0.2); color: var(--lp-cyan); border: 1px solid rgba(56, 189, 248, 0.4); }
.lp-tag-format { background: rgba(250, 204, 21, 0.2); color: var(--lp-yellow); border: 1px solid rgba(250, 204, 21, 0.4); }
.lp-tag-tone { background: rgba(244, 114, 182, 0.2); color: var(--lp-pink); border: 1px solid rgba(244, 114, 182, 0.4); }

.lp-pillar-sub {
  font-size: 0.62rem;
  color: var(--lp-text-muted);
}

.lp-select {
  width: 100%;
  background: rgba(7, 17, 31, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  font-family: var(--lp-font);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}
.lp-select:focus {
  border-color: var(--lp-cyan);
  box-shadow: 0 0 10px var(--lp-cyan-glow);
}

.lp-btn-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 42px;
  background: linear-gradient(135deg, #fde047 0%, #facc15 50%, #eab308 100%);
  color: #08111e;
  border: 1px solid rgba(254, 240, 138, 0.6);
  border-radius: 10px;
  font-family: var(--lp-font);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(250, 204, 21, 0.35);
  transition: all 0.2s ease;
}
.lp-btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.5);
}

/* ── Coluna 2: Terminal Simulador da IA ── */
.lp-ai-panel {
  background: linear-gradient(180deg, #071220 0%, #030810 100%);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  min-height: 0;
  gap: 0.5rem;
}

.lp-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.3rem;
}
.lp-ai-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lp-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}
.lp-ai-brand strong { font-size: 0.85rem; color: #fff; }
.lp-model-tag {
  font-size: 0.58rem;
  color: var(--lp-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.lp-score-badge {
  font-family: var(--lp-font-cond);
  font-size: 0.82rem;
  color: var(--lp-text-muted);
}
.lp-score-badge strong {
  font-size: 1rem;
  color: var(--lp-yellow);
}

.lp-prompt-preview {
  background: rgba(11, 26, 45, 0.7);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
}
.lp-prompt-label {
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--lp-yellow);
  display: block;
  margin-bottom: 0.15rem;
}
.lp-prompt-preview p {
  color: #bae6fd;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}

.lp-ai-response-box {
  flex: 1;
  background: rgba(4, 10, 19, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #e2e8f0;
  user-select: text;
  -webkit-user-select: text;
}
.lp-ai-placeholder {
  color: var(--lp-text-muted);
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.lp-ai-output { white-space: pre-wrap; }

.lp-diagnosis-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(7, 17, 31, 0.8);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
}
.lp-diag-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lp-diag-item span {
  font-size: 0.58rem;
  color: var(--lp-text-muted);
  font-weight: 700;
}
.lp-diag-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}
.lp-diag-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #4ade80);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── Modais e Overlays ── */
.lp-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 19, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}
.lp-overlay.hidden { display: none !important; }

.lp-card {
  background: linear-gradient(145deg, #0e223d 0%, #081628 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 1.4rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px var(--lp-cyan-glow);
}

.lp-result-icon { font-size: 2.2rem; margin-bottom: 0.2rem; }
.lp-stars-display { font-size: 1.8rem; margin: 0.4rem 0 0.8rem; }

.lp-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lp-cyan);
  margin-bottom: 0.2rem;
  display: inline-block;
}

.lp-title {
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.6rem;
  color: #fff;
}

.lp-feedback-box {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #e2e8f0;
  margin-bottom: 1.1rem;
}
.lp-feedback-box strong { color: var(--lp-yellow); }

.lp-btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 46px;
  padding: 0.75rem 1.4rem;
  background: linear-gradient(135deg, #fde047 0%, #facc15 50%, #eab308 100%);
  color: #08111e;
  border: 1px solid rgba(254, 240, 138, 0.6);
  border-radius: 12px;
  font-family: var(--lp-font);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(250, 204, 21, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.lp-btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(250, 204, 21, 0.5);
}

.lp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}
.lp-btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 42px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lp-btn-share:hover { background: #16a34a; }
.lp-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--lp-text);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lp-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--lp-cyan);
}

.lp-gameover-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}
.lp-go-stat {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.6rem;
  text-align: center;
}
.lp-go-label {
  font-size: 0.62rem;
  color: var(--lp-text-muted);
  font-weight: 700;
  text-transform: uppercase;
}
.lp-go-val {
  font-family: var(--lp-font-cond);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}
.lp-go-val.highlight { color: var(--lp-yellow); }

.lp-record-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--lp-yellow);
  color: var(--lp-yellow);
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

/* ── Toast no Canto Superior Direito ── */
.lp-toast {
  position: absolute;
  top: 65px;
  right: 25px;
  background: rgba(14, 34, 61, 0.95);
  border: 1px solid var(--lp-yellow);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--lp-yellow-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-15px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}
.lp-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .lp-lab-grid {
    grid-template-columns: 1fr;
  }
}
