/* =============================================================================
   prism-jsol.css
   Motor de color y conmutación semántica de comentarios para JSOL REPL.
   ============================================================================= */

/* 1. Mapeo de tokens de PrismJS a las variables nativas del Theme de JSOL */
code[class*="language-"], pre[class*="language-"] {
    color: var(--jsol-text);
    text-shadow: none;
    font-family: monospace;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
    line-height: 1.5;
    tab-size: 4;
    hyphens: none;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: var(--jsol-text-muted);
    font-style: italic;
}

.token.punctuation { color: var(--jsol-text-muted); }
.token.namespace { opacity: .7; }

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: var(--jsol-accent);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: var(--jsol-success);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: var(--jsol-text);
}

.token.atrule,
.token.attr-value,
.token.keyword { color: var(--jsol-accent); }
.token.function,
.token.class-name { color: var(--jsol-accent-input, #e6a200); }
.token.regex,
.token.important,
.token.variable { color: var(--jsol-accent); }


/* 2. REGLA MAESTRA DE OCULTAMIENTO DE COMENTARIOS Y ESPACIOS MUERTOS */
[data-j0-pane-group="repl-views"][data-comments-visible="false"] code[class*="language-"] .token.comment,
[data-j0-pane-group="repl-views"][data-comments-visible="false"] code[class*="language-"] .j0ui-comment-gap,
[data-j0-pane-group="repl-views"][data-comments-visible="false"] code[class*="language-"] .j0ui-blank-line {
    display: none;
}


/* 3. Ajustes de UI para Botones Flotantes y Contenedor */
[data-j0-pane-group="repl-views"] .j0ui-code-pane-wrapper {
    position: relative;
    margin-top: 0;
}

.j0ui-code-actions-floating {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    gap: 8px;
    opacity: 0.2;
    transition: opacity 0.2s ease;
}

[data-j0-pane-group="repl-views"] .j0ui-code-pane-wrapper:hover .j0ui-code-actions-floating,
[data-j0-pane-group="repl-views"] .j0ui-code-pane-wrapper .j0ui-code-actions-floating:focus-within {
    opacity: 1;
}

[data-j0-pane-group="repl-views"] pre.jsol-repl-source-code {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding-top: 3.5rem; 
    border-top: none; 
}


/* 4. Overrides de Espaciado Estructural (j0ui Base) */
[data-j0-pane-group="repl-views"] .j0ui-tab-pane,
[data-j0-pane-group="repl-views"] [data-j0-panel] {
    padding: 0;
    gap: 0;
}

.jsol-repl-container {
    --j0ui-bg-panel: var(--jsol-surface);
    --j0ui-bg-dropdown: var(--jsol-surface);
    --j0ui-border-subtle: var(--jsol-border);
}