/* ========== HELP MANUAL — "Librillo" de instrucciones ========== */
/* Estilo Windows CHM modernizado con dark theme de NutriNen       */

/* ── Overlay ── */
.help-manual-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.help-manual-overlay.active {
    display: flex;
    opacity: 1;
}

/* ── Container (split layout) ── */
.help-manual {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: #0D1117;
    overflow: hidden;
}

/* ── Sidebar (tree nav) ── */
.help-sidebar {
    width: 280px;
    min-width: 280px;
    background: #0a0e14;
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.help-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.help-sidebar-logo {
    font-size: 22px;
    line-height: 1;
}
.help-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: #e6edf3;
    letter-spacing: 0.3px;
}
.help-sidebar-version {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    margin-left: auto;
}

/* Search */
.help-search {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.help-search input {
    width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    color: #e6edf3;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.help-search input:focus {
    border-color: var(--game-green, #5ec722);
}
.help-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.4;
    pointer-events: none;
}
.help-search {
    position: relative;
}

/* Tree */
.help-tree {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    -webkit-overflow-scrolling: touch;
}
.help-tree::-webkit-scrollbar { width: 4px; }
.help-tree::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* Tree node */
.help-node {
    user-select: none;
}
.help-node-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    border-left: 2px solid transparent;
}
.help-node-row:hover {
    background: rgba(255,255,255,0.04);
}
.help-node-row.active {
    background: rgba(94, 199, 34, 0.08);
    color: var(--game-green-light, #8bef47);
    border-left-color: var(--game-green, #5ec722);
}
.help-node-arrow {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: rgba(255,255,255,0.3);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.help-node-arrow.expanded { transform: rotate(90deg); }
.help-node-arrow.leaf { visibility: hidden; }
.help-node-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.help-node-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.help-node-children {
    display: none;
    padding-left: 16px;
}
.help-node-children.expanded {
    display: block;
}

/* Nesting depth indentation */
.help-node-row[data-depth="1"] { padding-left: 16px; }
.help-node-row[data-depth="2"] { padding-left: 28px; }
.help-node-row[data-depth="3"] { padding-left: 40px; }

/* Hidden by search filter */
.help-node.search-hidden { display: none; }

/* ── Content area ── */
.help-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Top bar */
.help-topbar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 8px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}
.help-hamburger {
    display: none; /* visible only on mobile */
    background: none;
    border: none;
    color: #e6edf3;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
}
.help-hamburger:active { background: rgba(255,255,255,0.1); }
.help-breadcrumb {
    flex: 1;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.help-breadcrumb span {
    cursor: pointer;
    transition: color 0.15s;
}
.help-breadcrumb span:hover { color: var(--game-green-light, #8bef47); }
.help-breadcrumb .sep { cursor: default; margin: 0 4px; opacity: 0.4; }
.help-breadcrumb .current { color: #e6edf3; cursor: default; font-weight: 600; }
.help-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.help-close-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Content body */
.help-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 40px;
    -webkit-overflow-scrolling: touch;
}
.help-body::-webkit-scrollbar { width: 5px; }
.help-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; }

/* Typography in content */
.help-body h1 {
    font-size: 22px;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 6px;
    line-height: 1.3;
}
.help-body .help-page-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin: 0 0 20px;
    font-style: italic;
}
.help-body h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--game-green-light, #8bef47);
    margin: 24px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.help-body h3 {
    font-size: 14px;
    font-weight: 600;
    color: #e6edf3;
    margin: 16px 0 6px;
}
.help-body p {
    font-size: 13px;
    color: rgba(255,255,255,0.72);
    line-height: 1.65;
    margin: 0 0 10px;
}
.help-body ul, .help-body ol {
    padding-left: 20px;
    margin: 0 0 12px;
}
.help-body li {
    font-size: 13px;
    color: rgba(255,255,255,0.72);
    line-height: 1.65;
    margin-bottom: 4px;
}
.help-body strong { color: #e6edf3; }
.help-body code {
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--game-green-light, #8bef47);
    font-family: monospace;
}
.help-body .help-tip {
    background: rgba(94,199,34,0.08);
    border-left: 3px solid var(--game-green, #5ec722);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin: 12px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}
.help-body .help-tip strong { color: var(--game-green-light, #8bef47); }
.help-body .help-warning {
    background: rgba(255,170,0,0.08);
    border-left: 3px solid var(--game-gold, #ffaa00);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin: 12px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}
.help-body .help-warning strong { color: var(--game-gold-light, #ffd700); }
.help-body .help-keys {
    display: inline-flex;
    gap: 4px;
    margin: 0 2px;
}
.help-body kbd {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-family: inherit;
}
/* Tables inside help content */
.help-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 14px;
    font-size: 13px;
}
.help-body th {
    color: #e6edf3;
    background: rgba(255,255,255,0.06);
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.help-body td {
    color: rgba(255,255,255,0.78);
    padding: 5px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.help-body tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* Nav footer (prev/next) */
.help-nav-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
}
.help-nav-btn {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    max-width: 45%;
    color: inherit;
}
.help-nav-btn:hover {
    background: rgba(94,199,34,0.06);
    border-color: rgba(94,199,34,0.2);
}
.help-nav-btn .nav-dir {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.help-nav-btn .nav-label {
    font-size: 13px;
    color: var(--game-green-light, #8bef47);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.help-nav-btn.next { align-items: flex-end; margin-left: auto; }

/* ── (i) info button — reusable across the app ── */
.help-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
}
.help-info-btn:hover,
.help-info-btn:active {
    border-color: var(--game-green, #5ec722);
    color: var(--game-green-light, #8bef47);
    background: rgba(94,199,34,0.1);
}

/* ── Mobile responsive ── */
@media (max-width: 700px) {
    .help-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    .help-sidebar.open {
        transform: translateX(0);
    }
    .help-manual {
        position: relative;
    }
    .help-hamburger {
        display: flex;
    }
    /* Backdrop when sidebar is open on mobile */
    .help-sidebar-backdrop {
        display: none;
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 5;
    }
    .help-sidebar-backdrop.active {
        display: block;
    }
    .help-body {
        padding: 18px 16px 32px;
    }
    .help-body h1 { font-size: 19px; }
}

/* Small phones */
@media (max-width: 380px) {
    .help-sidebar {
        width: 260px;
    }
    .help-body {
        padding: 14px 12px 28px;
    }
}
