﻿:root {
    --bg-desktop: #0a0c10;
    --window-bg: #1e1e24;
    --border-light: #3a3f4b;
    --border-dark: #0f1115;
    --title-bar-bg: #000000;
    --title-bar-text: #f0f3f8;
    --panel-bg: #15171d;
    --sidebar-hover-bg: #2a6f6f;
    --sidebar-hover-text: #ffffff;
    --tab-active-bg: #2a2e3a;
    --tab-inactive-bg: #101216;
    --accent-warning: #f5c542;
    --accent-primary: #4f9da6;

    --text-primary: #e8ecf5;
    --text-secondary: #b8bece;
    --text-muted: #7a7f8c;

    --taskbar-height: 44px;
    --window-min-top: 10px;
    --window-min-left: 10px;
    --window-margin-bottom: 10px;

    /* Typography scale */
    --font-base: 13px;
    --font-sm:   11px;
    --font-xs:   10px;
    --line-base: 1.65;
    --line-tight: 1.4;
}

/* =========================
   BASE
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-desktop);
    font-family: 'Courier New', 'Fira Code', 'Source Code Pro', monospace;
    font-size: var(--font-base);
    font-weight: 500;
    overflow: hidden;
    height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

p {
    margin: 4px 0;
    line-height: var(--line-base);
    color: var(--text-secondary);
}

li {
    line-height: var(--line-base);
    color: var(--text-secondary);
}

label {
    color: var(--accent-primary);
    font-size: var(--font-sm);
    display: block;
    margin-top: 6px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

h1, h2, h3, h4, .title-text, button, label {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}

h3 {
    margin: 0 0 8px 0;
    font-size: var(--font-base);
    border-left: 3px solid var(--accent-primary);
    padding-left: 6px;
    color: var(--accent-warning);
    line-height: var(--line-tight);
}

h4 {
    margin: 8px 0 4px 0;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* =========================
   ASCII BACKGROUND (FONDO ESTÁTICO)
========================= */

.ascii-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: monospace;
    font-size: 15px;
    line-height: 15px;
    white-space: pre;
    color: var(--accent-primary);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    text-align: center;
    margin: 0;
    max-width: 90vw;
    overflow: hidden;
}

/* =========================
   DESKTOP (ICONOS)
========================= */

#desktop {
    position: relative;
    z-index: 1;
    top: 0;
    bottom: var(--taskbar-height);
    left: 0;
    right: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    grid-auto-rows: 88px;
    gap: 20px;
    overflow-y: auto;
    height: calc(100vh - var(--taskbar-height));
}

/* =========================
   ICONOS
========================= */

.icon {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.1s ease;
}

.icon-img {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 2px var(--accent-primary));
}

.icon-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
    max-width: 76px;
    word-wrap: break-word;
    font-weight: bold;
}

.icon:hover .icon-label {
    background: var(--sidebar-hover-bg);
    color: white;
    padding: 2px 4px;
    border-radius: 0px;
}

.icon:active {
    transform: translateY(2px);
}

/* =========================
   VENTANAS (BRUTALISTAS)
========================= */

.window {
    position: absolute;
    background: var(--window-bg);
    border: 2px solid var(--border-dark);
    box-shadow: 6px 6px 0px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    min-width: 360px;
    min-height: 280px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - var(--taskbar-height) - 24px);
    overflow: hidden;
    z-index: 10;
}

/* =========================
   BARRA DE TÍTULO
========================= */

.title-bar {
    background: var(--title-bar-bg);
    color: var(--title-bar-text);
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-sm);
    cursor: move;
    flex-shrink: 0;
    border-bottom: 1px solid var(--accent-primary);
}

.title-text {
    flex: 1;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--title-bar-text);
}

.window-controls {
    display: flex;
    gap: 4px;
}

.window-controls button {
    width: 22px;
    height: 22px;
    background: #2a2e3a;
    border: 1px solid var(--border-light);
    color: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-controls button:active {
    background: var(--accent-warning);
    color: black;
    border-color: black;
}

/* =========================
   CONTENIDO (SCROLL)
========================= */

.content {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    background: #111318;
    color: var(--text-primary);
    font-size: var(--font-base);
    line-height: var(--line-base);
}

/* =========================
   PANELES (ESTILO BRUTALISTA)
========================= */

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-light);
    padding: 12px;
    box-shadow: inset 0 0 0 1px #2a2e3a, 2px 2px 0px black;
    color: var(--text-primary);
}

.panel h3 {
    margin-top: 0;
    color: var(--accent-warning);
}

.panel p {
    color: var(--text-secondary);
    line-height: var(--line-base);
}

.panel li {
    color: var(--text-secondary);
    line-height: var(--line-base);
}

.panel span {
    color: var(--text-secondary);
}

.panel-raised {
    background: #1b1d26;
    border: 1px solid var(--accent-primary);
    padding: 8px;
}

.panel.scroll {
    overflow-y: auto;
}

/* =========================
   LAYOUT (GRID, STACK, SPLIT)
========================= */

.split {
    display: grid;
    gap: 12px;
    height: 100%;
    min-height: 0;
}

.split-30-70 {
    grid-template-columns: 380px 1fr;
}

.split-70-30 {
    grid-template-columns: 1fr 380px;
}

.split-50 {
    grid-template-columns: 1fr 1fr;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
}

.scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* =========================
   EXPLORADOR DE ARCHIVOS (TABS Y SIDEBAR)
========================= */

#file-tabs {
    background: #0a0c10;
    border: 1px solid var(--border-dark);
    padding: 4px;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.tab {
    padding: 5px 14px;
    background: var(--tab-inactive-bg);
    border: 1px solid var(--border-light);
    cursor: pointer;
    font-family: monospace;
    font-size: var(--font-sm);
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.tab.active {
    background: var(--tab-active-bg);
    border-bottom: 2px solid var(--accent-primary);
    color: var(--accent-warning);
}

#file-sidebar {
    background: #101218;
    border: 1px solid var(--border-dark);
    padding: 6px;
    overflow-y: auto;
}

#file-sidebar div {
    padding: 7px 8px;
    border-left: 2px solid transparent;
    margin-bottom: 2px;
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: var(--line-tight);
}

#file-sidebar div:hover {
    background: var(--sidebar-hover-bg);
    color: white;
    border-left-color: var(--accent-warning);
}

#file-content {
    background: #111318;
    border: 1px solid var(--border-dark);
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-primary);
}

/* =========================
   FORMULARIOS (INPUTS, SELECTS, TEXTAREA)
========================= */

input, textarea, select {
    background: #0a0c10;
    border: 1px solid var(--border-light);
    padding: 7px 8px;
    font-family: monospace;
    font-size: var(--font-base);
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
    line-height: var(--line-tight);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(79,157,166,0.25);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: var(--line-base);
}

label {
    color: var(--accent-primary);
    font-size: var(--font-sm);
    display: block;
    margin-bottom: 4px;
}

/* =========================
   BOTONES (BRUTALISTAS)
========================= */

button {
    background: #1e1e24;
    border: 1px solid var(--border-light);
    padding: 7px 14px;
    cursor: pointer;
    font-family: monospace;
    font-size: var(--font-sm);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-primary);
    transition: all 0.05s linear;
}

button:hover {
    background: var(--sidebar-hover-bg);
    color: white;
    border-color: var(--accent-warning);
}

button:active {
    transform: translate(1px, 1px);
    background: var(--accent-primary);
    color: black;
}

/* =========================
   TASKBAR (ESTILO INDUSTRIAL)
========================= */

#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: var(--bg-desktop);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    box-sizing: border-box;
    z-index: 1000;
    border-top: 2px solid var(--accent-primary);
    gap: 12px;
}

#clock {
    margin-left: auto;
    min-width: 100px;
    text-align: center;
    background: #000000;
    border: 1px solid var(--border-light);
    padding: 4px 10px;
    font-family: monospace;
    font-size: var(--font-sm);
    color: var(--accent-warning);
    letter-spacing: 1px;
}

/* =========================
   TOOLTIP GLOBAL
========================= */

#tooltip {
    position: fixed;
    z-index: 9999;
    background: #000000;
    border: 1px solid var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: var(--font-sm);
    line-height: 1.65;
    padding: 7px 11px;
    max-width: 260px;
    pointer-events: none;
    display: none;
    box-shadow: 3px 3px 0 rgba(79, 157, 166, 0.2);
    letter-spacing: 0.3px;
    text-transform: none;
    font-weight: normal;
}

/* Elementos con tooltip: cursor de ayuda + subrayado punteado sutil */
[data-tooltip] {
    cursor: help;
}

b[data-tooltip],
span[data-tooltip] {
    border-bottom: 1px dotted var(--accent-primary);
}

label[data-tooltip] {
    color: var(--accent-warning);
}

h3[data-tooltip] {
    border-left-color: var(--accent-warning);
}

/* =========================
   CONCEPT LABELS (BADGES)
========================= */

.concept-label {
    display: inline-block;
    font-size: 9px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 2px 6px;
    margin-right: 6px;
    cursor: help;
    vertical-align: middle;
    flex-shrink: 0;
}

.concept-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    font-size: var(--font-base);
    color: var(--text-secondary);
    line-height: var(--line-tight);
}

/* =========================
   FIELD HINT (CLASS/MBTI INLINE DESCRIPTION)
========================= */

.field-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 6px;
    min-height: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    font-style: italic;
    font-family: 'Courier New', monospace;
    font-weight: normal;
    padding-left: 4px;
    border-left: 2px solid var(--border-light);
    transition: color 0.1s;
}

.field-hint:not(:empty) {
    color: var(--text-muted);
    border-left-color: var(--accent-primary);
}

/* =========================
   SKILL TREE
========================= */

.skill-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.skill-node {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--font-base);
    line-height: var(--line-tight);
    color: var(--text-secondary);
}

.skill-badge {
    display: inline-block;
    font-size: 9px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 2px 6px;
    flex-shrink: 0;
    vertical-align: middle;
    margin-top: 1px;
    white-space: nowrap;
}

.skill-badge-base {
    background: var(--accent-primary);
    color: #000000;
    border: 1px solid var(--accent-primary);
}

.skill-badge-path {
    color: var(--accent-warning);
    border: 1px solid var(--accent-warning);
    background: transparent;
}

/* Branch lines from base to paths */
.skill-paths {
    border-left: 2px solid var(--accent-primary);
    margin-left: 26px;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 3px;
    padding-top: 2px;
    padding-bottom: 2px;
}

/* Each path row gets a small horizontal branch line */
.skill-path-node {
    position: relative;
}

.skill-path-node::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 10px;
    width: 10px;
    height: 1px;
    background: var(--accent-primary);
    opacity: 0.6;
}

/* Skill tree section header */
.skill-section-header {
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
}

/* Skill tree inside editor panel */
.active-fields {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.active-fields .path-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.path-connector {
    font-size: 11px;
    color: var(--accent-primary);
    margin-left: 4px;
    margin-right: 2px;
    opacity: 0.7;
    flex-shrink: 0;
}