/* Estilos base para la Wiki (Estilo Terminal) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #02050A; /* Negro puro para terminal */
    --panel-bg: rgba(16, 30, 60, 0.4);
    --panel-border: rgba(56, 189, 248, 0.3);
    
    --primary: #F59E0B; /* Ámbar Terminal */
    --primary-glow: rgba(245, 158, 11, 0.3);
    
    --secondary: #10B981; /* Verde Terminal/Hacker */
    --secondary-glow: rgba(16, 185, 129, 0.4);
    
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Efecto Scanlines de terminal clásico */
.terminal-scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.3;
}

/* Sidebar Navigation */
.wiki-sidebar {
    width: 300px;
    background: rgba(5, 10, 20, 0.95);
    border-right: 1px solid var(--panel-border);
    height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 50;
}

.wiki-sidebar .logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wiki-sidebar .logo::before {
    content: '>_';
    color: var(--secondary);
}

.nav-group {
    margin-bottom: 2rem;
}

.nav-group-title {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.nav-item {
    display: block;
    color: var(--text-main);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border-left: 2px solid var(--secondary);
}

/* Main Content Area */
.wiki-content {
    flex: 1;
    padding: 3rem 5%;
    max-width: 1000px;
}

.wiki-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
}

.search-bar {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--panel-border);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    width: 300px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.search-bar:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary-glow);
}

/* Markdown Styles */
.markdown-body h1 {
    font-size: 2.8rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.markdown-body h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.markdown-body p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.markdown-body code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0,0,0,0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.9em;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.markdown-body pre {
    background: #000;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.markdown-body pre code {
    background: transparent;
    border: none;
    color: var(--secondary);
    font-size: 0.95rem;
    padding: 0;
}

.info-box {
    background: rgba(16, 185, 129, 0.05);
    border-left: 4px solid var(--secondary);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
}

/* Mobile Menu Toggle (Floating Button) */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--secondary);
    color: #000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
    z-index: 10000;
    transition: all 0.3s;
}
.mobile-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.close-mobile-menu {
    display: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Responsive Wiki */
@media (max-width: 992px) {
    body {
        flex-direction: column;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .wiki-sidebar {
        position: fixed;
        top: 0;
        left: -100%; /* Oculto fuera de la pantalla por defecto */
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: rgba(5, 10, 20, 0.98);
        border-right: 1px solid var(--panel-border);
        padding: 2rem 1.5rem;
        display: flex;
        flex-direction: column;
        z-index: 10001;
        transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
        overflow-y: auto;
        box-shadow: 20px 0 50px rgba(0,0,0,0.8);
    }
    .wiki-sidebar.active {
        left: 0; /* Aparece desde la izquierda */
    }
    .close-mobile-menu {
        display: block;
    }
    .wiki-sidebar .logo {
        width: 100%;
        margin-bottom: 1rem;
    }
    .wiki-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .wiki-header {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .search-bar {
        width: 100%;
    }
    .markdown-body h1 {
        font-size: 2rem;
    }
    .markdown-body h2 {
        font-size: 1.5rem;
    }
    footer {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    footer > div {
        text-align: center !important;
        margin-right: 0 !important;
        justify-content: center;
    }
}
