/* ============================================================
   styles.css — Escritório de IA Visual
   ============================================================ */

:root {
  --bg: #0d0f1a;
  --panel: #141828;
  --border: #2a3058;
  --accent: #6ef3a5;
  --accent2: #ffd166;
  --danger: #ff5d73;
  --blue: #7eb8f7;
  --text: #e8ecff;
  --muted: #6b74a0;
  --sidebar-w: 300px;
  --hud-h: 50px;
}

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

html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: 'VT323', monospace; }

/* ─── UTILIDADES ─────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── LAYOUT ─────────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: var(--hud-h) 1fr;
  grid-template-columns: 1fr var(--sidebar-w);
  grid-template-areas:
    "hud hud"
    "game sidebar";
  height: 100%;
}

/* ─── HUD ─────────────────────────────────────────── */
#hud {
  grid-area: hud;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0c18;
  border-bottom: 2px solid var(--border);
  padding: 0 16px;
  gap: 12px;
  z-index: 10;
}

.hud-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 1px;
  margin-right: 16px;
}

.hud-status {
  font-size: 18px;
  color: var(--accent2);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.hud-left, .hud-right { display: flex; align-items: center; gap: 12px; }

.room-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-right: 16px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.room-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--panel);
  color: var(--muted);
  transition: all 0.2s;
}

.room-tab.active {
  background: var(--blue);
  color: #000;
  border-color: var(--blue);
}

.room-tab.new-room {
  background: transparent;
  border: 1px dashed var(--muted);
}
.room-tab.new-room:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-hud {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  background: #1e2a5e;
  border: 2px solid var(--blue);
  color: var(--blue);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.btn-hud:hover { background: #2a3a80; }

.conn-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  transition: background .3s;
}
.conn-online  { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.conn-offline { background: var(--danger); }
.conn-busy    { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }

/* ─── GAME AREA ───────────────────────────────────── */
#gameArea {
  grid-area: game;
  position: relative;
  overflow: hidden;
  background: #080a14;
}

#officeCanvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#officeCanvas.clickable {
  cursor: crosshair !important;
}

.placement-banner {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(110, 243, 165, 0.9);
  color: #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  z-index: 50;
  pointer-events: none;
  animation: bounceBanner 1s infinite alternate;
}

@keyframes bounceBanner {
  from { transform: translate(-50%, 0); }
  to { transform: translate(-50%, -5px); }
}

/* ─── AGENT TOOLTIP ───────────────────────────────── */
.agent-tooltip {
  position: absolute;
  background: rgba(10,12,24, .9);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px;
  color: var(--accent);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .2s;
  z-index: 20;
}
.agent-tooltip.hidden { opacity: 0; }

/* ─── SIDEBAR ─────────────────────────────────────── */
#sidebar {
  grid-area: sidebar;
  background: var(--panel);
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 1px;
}

.log-feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}

.log-entry {
  font-size: 16px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 3px solid var(--border);
  background: rgba(255,255,255,.03);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.log-pm   { border-color: var(--blue); }
.log-dev  { border-color: var(--accent); }
.log-qa   { border-color: var(--accent2); }
.log-sys  { border-color: var(--muted); color: var(--muted); }
.log-done { border-color: var(--accent); color: var(--accent); font-weight: bold; }

.log-time { font-size: 12px; color: var(--muted); }

/* ─── DELIVERY BOX ────────────────────────────────── */
.delivery-box {
  margin: 10px;
  padding: 14px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: rgba(110,243,165,.08);
  text-align: center;
  animation: pulseGlow 2s infinite;
}
.delivery-box.hidden { display: none; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(110,243,165,.3); }
  50%       { box-shadow: 0 0 20px rgba(110,243,165,.6); }
}

.delivery-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--accent);
  margin-bottom: 8px;
}

.delivery-path {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 10px;
}

.btn-delivery {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
}

/* ─── MODAL DO QUADRO ────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal-board {
  background: #f5f0e0;
  border: 6px solid #c8b87e;
  border-radius: 4px;
  padding: 28px;
  width: min(92%, 620px);
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 0 40px rgba(200,184,126,.3);
  position: relative;
}

.board-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #3d2b00;
  margin-bottom: 6px;
}

.board-subtitle {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #6b5020;
  margin-bottom: 16px;
}

.task-textarea {
  width: 100%;
  font-family: 'VT323', monospace;
  font-size: 22px;
  background: rgba(0,0,0,.04);
  border: 2px dashed #c8b87e;
  border-radius: 4px;
  padding: 12px;
  color: #1a1200;
  resize: vertical;
  outline: none;
  line-height: 1.5;
}
.task-textarea:focus { border-color: #8b6914; }

.board-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.btn-board {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  cursor: pointer;
}
.btn-cancel { background: #d0ccc0; color: #444; }
.btn-submit { background: #2d6e3e; color: #fff; }
.btn-submit:hover { background: #3a8a4f; }
