/* ============================================================
   style.css — ZETA // DOOM TERMINAL '99
   black metal · geocities doomed · terminal CRT
   ============================================================ */
@font-face {
    font-family: 'Ashborn';
    src: url('fonts/Ashborn.otf') format('opentype');
}

:root {
    --negro: #000000;
    --carbon: #0a0a0a;
    --sangre: #cc0000;
    --sangre-viva: #ff0000;
    --sangre-muerta: #660000;
    --hueso: #c0c0c0;      /* plata win95 */
    --ceniza: #808080;
    --borde: #333333;
    --header-h: 96px;      /* se ajusta por JS a la altura real */
}

/* ---------- CURSOR PERSONALIZADO ---------- */

/* 1. CURSOR NORMAL (Para el fondo de la página y textos estáticos) */
body {
    cursor: url('customcursor.cur'), auto;
}

/* 2. CURSOR SANGRIENTO PARA TODO LO INTERACTIVO */
/* Agrupamos etiquetas de formularios, elementos de lista de tu sidebar y clases específicas */
a, 
button, 
input, 
select, 
textarea, 
label,
summary,
.sidebar li.group,
.sidebar a, 
.hit-title, 
#home-link, 
[role="button"],
[onclick] {
    cursor: url('bloodycursor.cur') 4 4, pointer !important;
}

/* 3. TRUCO GLOBAL (Para cualquier otra cosa que use "pointer" por culpa de otros CSS) */
*:not(body):not(html):not(#app):not(#app *) {
    /* Si algún elemento ya tiene la propiedad pointer en tu plantilla, la cambiamos por tu cursor */
    cursor: inherit; 
}

/* Excluir Webamp de estilos del site */
#app, #app * {
    cursor: auto !important;
    box-sizing: border-box;
}


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

html { scroll-behavior: smooth; }


body {
    font-family: 'Times New Roman', Times, serif;
    background: #000;
    color: var(--hueso);
    line-height: 1.5;
}

::selection { background: var(--sangre); color: #fff; }

/* ---------- SCROLLBARS OSCUROS (webkit + firefox) ---------- */
* {
    scrollbar-color: var(--sangre-muerta) #000;
    scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; border-left: 1px solid var(--borde); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--sangre-muerta), #200);
    border: 1px solid #000;
}
::-webkit-scrollbar-thumb:hover { background: var(--sangre); }
::-webkit-scrollbar-corner { background: #000; }

/* ---------- BOTON EYE ---------- */
#menu-toggle {
    display: block;          /* visible tambien en PC: colapsa la barra */
    background: #000;
    border: 2px solid var(--sangre-muerta);
    padding: 2px;
    width: 46px;
    height: 40px;
    cursor: pointer;
    line-height: 0;
}
#menu-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.6));
}
#menu-toggle:hover { background: var(--sangre-muerta); }
#menu-toggle.is-collapsed { opacity: 0.55; }
/* ---------- BOTON CORAZON (buscador en header) ---------- */
#search-jump {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    border: 2px solid var(--sangre-muerta);
    width: 44px;
    height: 38px;
    padding: 2px;
    line-height: 0;
    z-index: 60;
}
#search-jump img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.6));
}
#search-jump:hover { background: var(--sangre-muerta); box-shadow: 0 0 10px rgba(204,0,0,0.6); }

/* ---------- BUSCADOR TERMINAL ---------- */
#search-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 6px 10px;
    padding: 6px 8px;
    background: #050505;
    border: 1px solid var(--sangre-muerta);
}
#search-form .prompt {
    color: var(--sangre-viva);
    font-weight: bold;
    font-family: 'Courier New', monospace;
}
#search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--hueso);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
}
#search-input::placeholder { color: #555; }
#search-form:focus-within { border-color: var(--sangre); box-shadow: 0 0 8px rgba(204,0,0,0.35); }
#search-form button {
    background: transparent;
    border: none;
    color: var(--sangre-viva);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
#search-form button:hover { color: #fff; text-shadow: 0 0 6px var(--sangre); }

#search-status {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: var(--ceniza);
    padding: 0 10px 6px;
}

/* ---------- RESULTADOS GREP ---------- */
.grep-meta {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--ceniza);
    margin-bottom: 18px;
}
.grep-none {
    font-family: 'Courier New', monospace;
    color: var(--ceniza);
    font-style: italic;
}
.hit-file {
    border: 1px solid var(--borde);
    border-left: 5px solid var(--sangre-muerta);
    background: #070707;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.hit-title {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--sangre-viva);
    text-decoration: underline;
    cursor: pointer;
}
.hit-title:hover { color: #fff; background: var(--sangre-muerta); }
.hit-path {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: #666;
    margin: 2px 0 8px;
}
.hit-line {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--hueso);
    padding: 3px 0;
    border-top: 1px dotted #222;
    white-space: pre-wrap;
    word-break: break-word;
}
.hit-line .ln {
    color: var(--sangre-muerta);
    font-weight: bold;
    display: inline-block;
    min-width: 34px;
}
.hit-more {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--ceniza);
    padding-top: 4px;
    font-style: italic;
}
mark.hit {
    background: var(--sangre);
    color: #fff;
    padding: 0 2px;
}

/* ---------- COLAPSO DE SIDEBAR (desktop) ---------- */
.sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
    overflow: hidden;
}

/* ---------- HEADER ---------- */
header {
    position: sticky;
    /* heart button anclado aqui */
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px 10px;
    background: #000;
    border-bottom: 4px double var(--sangre);
}

header h1 {
    font-family: 'Ashborn';
    font-size: 3.1rem;
    letter-spacing: 0.35em;
    color: #ffffff;
    -webkit-text-stroke: 1.6px var(--sangre-viva);
    paint-order: stroke fill;
    text-shadow:
        0 0 10px rgba(255, 0, 0, 0.45),
        3px 3px 0 var(--sangre-muerta);
    margin: 0 auto;
    text-align: center;
    width: 100%;
}

#home-link { user-select: none; }

#menu-toggle:hover { background: var(--sangre-muerta); color: #fff; }

/* ---------- LAYOUT ---------- */
.container { display: flex; min-height: calc(100vh - var(--header-h)); }

.sidebar {
    width: 295px;
    flex-shrink: 0;
    padding: 14px 8px 60px;
    border-right: 2px solid var(--borde);
    overflow-y: auto;
    max-height: calc(100vh - var(--header-h));
    position: sticky;
    top: var(--header-h);
    background:
        repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 0, 0, 0.012) 2px 4px),
        var(--carbon);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    transition: width 0.22s ease, padding 0.22s ease;
}

#content {
    flex: 1;
    min-width: 0;
    padding: 26px clamp(16px, 4vw, 54px) 90px;
    max-width: 950px;
    margin: 0 auto;
}

#overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 40;
}
#overlay.visible { display: block; }

/* ---------- SIDEBAR (estilo file-system terminal) ---------- */
.sidebar ul { list-style: none; }

.sidebar li.group { margin: 3px 0; cursor: pointer; }

.sidebar li.group > ul {
    display: none;
    padding-left: 14px;
    margin: 3px 0 5px 6px;
    border-left: 1px dashed var(--sangre-muerta);
}
.sidebar li.group.open > ul { display: block; }
.sidebar li.group.open::before { content: '[−] '; }
.sidebar li.group::before {
    content: '[+] ';
    color: var(--sangre-viva);
    user-select: none;
}
.sidebar li.group > .group.sub { color: var(--ceniza); font-weight: bold; }
.sidebar li.group:hover::before { color: #fff; }
.sidebar li.group > .label,
.sidebar li.group { color: var(--hueso); }

.sidebar a {
    display: block;
    padding: 3px 8px;
    color: var(--sangre-viva);
    text-decoration: underline;
    transition: none;
    cursor: pointer;
    word-wrap: break-word;
    border-left: 3px solid transparent;
}
.sidebar a:hover {
    background: var(--sangre-muerta);
    color: #fff;
    text-decoration: none;
}
.sidebar a.active {
    background: var(--sangre);
    color: #fff;
    font-weight: bold;
}

.loading { color: var(--ceniza); animation: blink 1s step-start infinite; }

.error {
    color: var(--sangre-viva);
    font-weight: bold;
    background: #200;
    padding: 8px;
}

.term-banner {
    font-family: 'Courier New', Courier, monospace;
    color: var(--sangre);
    font-size: 0.85rem;
    margin-bottom: 22px;
    white-space: pre;
    overflow-x: auto;
    text-shadow: 0 0 4px rgba(204, 0, 0, 0.6);
}

.cursor { animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- MARKDOWN RENDER ---------- */
.markdown-body h1 {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.45rem;
    color: #fff;
    background: var(--sangre-muerta);
    padding: 8px 12px;
    margin: 30px 0 16px;
    letter-spacing: 0.05em;
    border-left: 8px solid var(--sangre-viva);
}
.markdown-body h1:first-of-type { margin-top: 0; }

.markdown-body h2 {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.15rem;
    color: var(--sangre-viva);
    margin: 28px 0 12px;
    border-bottom: 1px solid var(--sangre-muerta);
    padding-bottom: 4px;
}
.markdown-body h2::before { content: '// '; color: var(--sangre-muerta); }

.markdown-body h3 {
    font-family: 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: #ddd;
    margin: 20px 0 8px;
}

.markdown-body p { margin: 10px 0; font-size: 1.02rem; }

.markdown-body blockquote {
    border-left: 5px solid var(--sangre);
    background: #0d0d0d;
    padding: 10px 16px;
    margin: 14px 0;
    color: var(--ceniza);
    font-style: italic;
}

.markdown-body code {
    font-family: 'Courier New', Courier, monospace;
    background: #111;
    border: 1px solid var(--borde);
    color: #ff6666;
    padding: 1px 5px;
    font-size: 0.88em;
    word-break: break-word;
}

.markdown-body pre {
    font-family: 'Courier New', Courier, monospace;
    background: #050505;
    border: 1px dashed var(--sangre-muerta);
    padding: 12px;
    overflow-x: auto;
    margin: 14px 0;
    color: var(--hueso);
}
.markdown-body pre code { border: none; background: none; color: inherit; }

.markdown-body table {
    font-family: 'Courier New', Courier, monospace;
    width: 100%;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border-collapse: collapse;
    margin: 14px 0;
    -webkit-overflow-scrolling: touch;
    border: 2px solid var(--sangre-muerta);
    font-size: 0.82rem;
}
@media (min-width: 1100px) {
    .markdown-body table { display: table; white-space: normal; }
}

.markdown-body th, .markdown-body td {
    border: 1px solid var(--borde);
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}
.markdown-body th {
    background: var(--sangre-muerta);
    color: #fff;
    text-transform: uppercase;
}
.markdown-body tr:nth-child(even) td { background: #070707; }
.markdown-body tr:hover td { background: #140505; }

.markdown-body ul, .markdown-body ol { margin: 10px 0 10px 28px; }
.markdown-body li { margin: 4px 0; }
.markdown-body ul li::marker { content: '☠  '; color: var(--sangre); }
.markdown-body ol li::marker { color: var(--sangre); font-weight: bold; }

.markdown-body hr {
    border: 0;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--sangre) 0 12px, #000 12px 24px);
    margin: 26px 0;
}

.markdown-body strong { color: #fff; }
.markdown-body em { color: var(--ceniza); }
.markdown-body a { color: var(--sangre-viva); text-decoration: underline; }
.markdown-body a:hover { color: #fff; background: var(--sangre-muerta); }

/* ---------- WEBAMP PLAYER ---------- */
#app { z-index: 99999; }

/* ---------- MOBILE ---------- */
@media (max-width: 900px) {
    #menu-toggle { display: block; }
    header { justify-content: flex-start; }
    header h1 { font-size: 1.4rem; letter-spacing: 0.25em; margin: 0 auto; }

    .sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        z-index: 45;
        transform: translateX(-105%);
        transition: transform 0.22s steps(4);
        box-shadow: 6px 0 20px rgba(204, 0, 0, 0.3);
    }
    .sidebar.open { transform: translateX(0); }

    #content { padding: 18px 14px 80px; }

    .markdown-body h1 { font-size: 1.15rem; }
    .markdown-body h2 { font-size: 1.02rem; }
    .markdown-body th, .markdown-body td { padding: 5px 8px; font-size: 0.78rem; }
}

@media (max-width: 480px) {
    header h1 { letter-spacing: 0.18em; font-size: 1.1rem; }
    .markdown-body p { font-size: 1rem; }
}

/* ---------- LOGIN SCREEN ---------- */
#login-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000000;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#login-screen .term-container {
    position: relative;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    color: #cc0000;
    letter-spacing: 0.08em;
    text-align: center;
    padding: 8px;
}

#login-screen .cursor {
    animation: blink 1s step-start infinite;
    color: #cc0000;
}

#login-screen #pass-input {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 1.2em;
    opacity: 0.01;
    font-size: inherit;
    border: none;
    outline: none;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    z-index: 1;
}

#login-screen.shake {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

#auth-gate.locked { display: none !important; }

@media (max-width: 900px) {
    #login-screen {
        height: -webkit-fill-available;
    }
    #login-screen #pass-input {
        font-size: 16px;
    }
}
