/* Elffuss Code — VS Code oscuro con alma élfica */
:root {
  --bg: #0b0d12; --bg2: #11141c; --bg3: #171b26; --line: #262c3d;
  --fg: #e8ebf4; --muted: #8b93a8; --accent: #ff4d8d; --accent2: #7c5cff;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--fg); overflow: hidden; }

/* ---------- landing ---------- */
#landing {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 700px at 50% 30%, #221740, #0b0d12 72%); text-align: center;
}
#landing[hidden] { display: none; }
#landing canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; }
#landing .l-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; }
#landing .hero { width: 170px; filter: drop-shadow(0 12px 40px rgba(124,92,255,.35)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-9px); } }
#landing h1 { margin: 4px 0 0; font-size: 2rem; }
#landing h1 b { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#landing .tag { color: var(--muted); margin: 0; line-height: 1.5; }
#landing .tag b { color: var(--accent); }
#open-project {
  margin-top: 12px; padding: 14px 34px; font-size: 1.08rem; cursor: pointer; color: #fff;
  border: none; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 30px rgba(255,77,141,.35);
}
#open-project:hover { filter: brightness(1.12); }
#landing .ghost, .ghost {
  background: none; color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; cursor: pointer;
}
#landing .mini { font-size: .75rem; color: #5a6480; }

/* ---------- IDE ---------- */
#ide { display: flex; flex-direction: column; height: 100vh; }
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; background: var(--bg2); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 26px; height: 26px; }
.proj { color: var(--muted); font-size: .85rem; }
.controls { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
select { background: var(--bg3); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.off { background: #4a5062; } .dot.on { background: #3fb970; }
.dot.loading { background: #e5a53a; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

#settings-panel { display: flex; gap: 10px; padding: 10px 12px; background: var(--bg2); border-bottom: 1px solid var(--line); overflow-x: auto; }
#settings-panel .card { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: .8rem; min-width: 200px; }
#settings-panel input[type=text], #settings-panel input:not([type]) , #settings-panel input[type=password] { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: .78rem; }

main { flex: 1; display: grid; grid-template-columns: 230px 1fr 350px; min-height: 0; }

#tree { overflow: auto; background: var(--bg2); border-right: 1px solid var(--line); padding: 8px 4px; font-size: .82rem; }
#tree ul { list-style: none; margin: 0; padding-left: 14px; }
#tree summary { cursor: pointer; color: var(--muted); padding: 1px 0; }
#tree summary:hover, #tree .file:hover { color: var(--fg); }
#tree .file { cursor: pointer; display: block; padding: 1px 0; color: #b8c0d4; }

#editor-wrap { display: flex; flex-direction: column; min-width: 0; }
#tabs-bar { display: flex; background: var(--bg2); border-bottom: 1px solid var(--line); overflow-x: auto; min-height: 30px; }
.tab { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: .8rem; color: var(--muted); border-right: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--bg); color: var(--fg); box-shadow: inset 0 2px 0 var(--accent); }
.tab b { cursor: pointer; opacity: .6; } .tab b:hover { opacity: 1; color: var(--accent); }
#editor { flex: 1; min-height: 0; }
#statusbar { padding: 3px 10px; font-size: .74rem; color: var(--muted); background: var(--bg2); border-top: 1px solid var(--line); min-height: 20px; }

/* ---------- chat ---------- */
#chat { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg2); min-height: 0; }
#chat-log { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 11px; border-radius: 11px; font-size: .85rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-width: 95%; }
.msg.sys { background: linear-gradient(135deg, #1c1430, #14202e); border: 1px solid var(--line); }
.msg.user { background: var(--accent2); color: #fff; align-self: flex-end; }
.msg.assistant { background: var(--bg3); border: 1px solid var(--line); align-self: flex-start; }
.msg.err { border-color: #a03050; }
.msg.tool { color: var(--accent); font-size: .74rem; background: none; padding: 0 6px; }
.msg.tool-result { color: var(--muted); font-size: .74rem; background: none; padding: 0 6px; }
.msg.thinking { background: var(--bg3); border: 1px dashed var(--line); color: var(--muted); font-size: .8rem; }
.msg.thinking .gen { font-family: ui-monospace, monospace; font-size: .7rem; color: #5f6880; max-height: 60px; overflow: hidden; white-space: pre-wrap; }
#composer { display: flex; gap: 6px; padding: 10px; }
#prompt { flex: 1; background: var(--bg3); border: 1px solid var(--line); border-radius: 9px; color: var(--fg); padding: 9px 11px; outline: none; }
#prompt:focus { border-color: var(--accent2); }
#composer button { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; border-radius: 9px; color: #fff; padding: 0 14px; cursor: pointer; }
