:root {
    --bg-color: #0d1117;
    --sidebar-bg: #161b22;
    --neon-green: #00ff41;
    --neon-blue: #00ff41;/*#007acc;*/
    --text-main: #c9d1d9;
    --keyword: #ff7b72;
    --string: #a5d6ff;
    --comment: #8b949e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Fira Code', monospace;
    overflow: hidden;
    width: 100%;
    /* Soporte para Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) var(--sidebar-bg);
}

/* Custom Scrollbar - Neon Green */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 10px;
    border: 2px solid var(--sidebar-bg); /* Crea un efecto de separación */
    box-shadow: 0 0 15px var(--neon-green);
}

::-webkit-scrollbar-thumb:hover {
    background: #50ff80;
    box-shadow: 0 0 20px var(--neon-green);
}

/* Efecto de monitor antiguo */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

.app-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100vh;
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        width: 100vw;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    body.sidebar-active .sidebar {
        left: 0;
    }

    .code-content { 
        padding: 10px 5px; /* Reducimos padding lateral para ganar espacio */
        max-width: 100%;
        overflow-x: hidden; /* Evitamos el scroll horizontal general al usar wrap */
    }
    .code-text { 
        font-size: 12px; /* Fuente ligeramente más pequeña en móvil */
        min-width: 0; /* Permite que el contenido se contraiga en flexbox */
        flex: 1;
    }
    .line-numbers {
        display: none; /* Ocultar números de línea en móviles para ganar espacio */
    }
    .code-block {
        padding: 10px; /* Padding más compacto */
        margin-bottom: 10px;
        overflow-x: hidden;
    }

    /* Aplicamos el "text-break" (wrap) al código en móviles */
    .code-block code,
    .markdown-body pre code {
        white-space: pre-wrap !important;
        word-break: break-word;
        width: 100% !important;
    }

    /* Landing page */
    .glitch-title {
        font-size: 2rem;
    }
    .landing-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    .btn-landing {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Button adjustments */
    .btn-run {
        margin-left: 20px;
    }
    .btn-demo-request,
    .btn-source,
    .btn-more-info {
        width: 100%;
        justify-content: center;
    }

    .terminal-window {
        width: 95%;
    }
    .gallery-thumbnails {
        height: 80px;
    }
    .gallery-thumbnails img {
        height: 50px;
        max-width: 80px;
    }
    .markdown-body {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .glitch-title {
        font-size: 1.5rem;
    }
    .landing-subtitle {
        font-size: 0.85rem;
    }
    .landing-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .btn-landing {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    .code-content {
        padding: 10px 6px;
        font-size: 12px;
    }
    .line-numbers {
        display: none;
    }
    .btn-run {
        margin-left: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid #30363d;
    padding: 15px 0;
    overflow-y: auto;
}

.sidebar-header {
    font-size: 11px;
    padding: 0 20px 10px;
    color: var(--comment);
    letter-spacing: 1px;
}

.file-list li {
    padding: 5px 20px;
    font-size: 13px;
    cursor: pointer;
    color: #8b949e;
}

.file-list li.file-item, .file-list li.folder-child {
    display: flex;
    align-items: center;
}

.file-list li.file-item span.file-name-span {
    padding-left: 0;
    width: auto;
}

.folder-icon, .folder-icon-static {
    margin-right: 8px;
    font-size: 14px;
}

.file-list li:hover:not(.disabled), .file-list li.active {
    background: #21262d;
    color: white;
}

.file-list li.disabled {
    pointer-events: none;
    opacity: 0.4;
    cursor: default;
}

/* Editor */
.editor { 
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
}

.tabs {
    background: var(--sidebar-bg);
    display: flex;
    flex-shrink: 0;
}

.tab {
    padding: 10px 20px;
    background: var(--bg-color);
    border-right: 1px solid #30363d;
    font-size: 12px;
}

.code-content {
    display: flex;
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    overflow-y: auto; 
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex-grow: 1;
}

.line-numbers {
    color: #484f58;
    text-align: right;
    padding-right: 15px;
    user-select: none;
}



.keyword { color: var(--keyword); }
.string { color: var(--string); }
.comment { color: var(--comment); font-style: italic; }

.btn-run {
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 8px 15px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 0 5px var(--neon-green);
    transition: 0.3s;
    margin-top: 15px;
        margin-left: 50px;
}

.btn-run:hover {
    background: var(--neon-green);
    color: black;
    box-shadow: 0 0 20px var(--neon-green);
}

.btn-whatsapp {
    background: transparent;
    border: 1px solid #25d366;
    color: #25d366;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 0 5px #25d366;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-whatsapp:hover {
    background: #25d366;
    color: black;
    box-shadow: 0 0 20px #25d366;
}

.btn-demo-request {
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 8px 15px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 0 5px var(--neon-green);
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-demo-request:hover {
    background: var(--neon-green);
    color: black;
    box-shadow: 0 0 20px var(--neon-green);
}

.btn-source {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 8px 15px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 0 5px var(--neon-blue);
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-source:hover {
    background: var(--neon-blue);
    color: black;
    box-shadow: 0 0 20px var(--neon-blue);
}

.btn-more-info {
    background: transparent;
    border: 1px solid #58a6ff;
    color: #58a6ff;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(88, 166, 255, 0.3);
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-more-info:hover {
    background: #58a6ff;
    color: black;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
}

/* Modal Terminal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: none; justify-content: center; align-items: center;
    z-index: 20;
}

.terminal-window {
    width: 80%;
    max-width: 800px;
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(0, 122, 204, 0.3);
}

.terminal-header {
    background: #333;
    padding: 10px;
    display: flex;
    align-items: center;
}

.dot { width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.terminal-title { font-size: 12px; color: #ccc; margin-left: 10px; }

.terminal-body {
    padding: 20px;
    color: var(--neon-green);
    font-size: 14px;
    min-height: 300px;
}

.demo-placeholder {
    margin-top: 20px;
    border-top: 1px dashed var(--neon-green);
    padding-top: 20px;
    color: white;
    text-align: center;
}

/* Markdown Styles */
.markdown-body {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    padding-bottom: 30px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
    color: var(--neon-blue);
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 500;
    line-height: 1.25;
}

.markdown-body h1, .markdown-body h2 {
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.3em;
}

.markdown-body a {
    color: var(--neon-green);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body p, .markdown-body blockquote, .markdown-body ul, .markdown-body ol, .markdown-body dl, .markdown-body table, .markdown-body pre, .markdown-body details {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(110, 118, 129, 0.4);
    border-radius: 6px;
    color: var(--keyword);
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: var(--sidebar-bg);
    border-radius: 6px;
    border: 1px solid #30363d;
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
    color: var(--text-main);
}

.markdown-body blockquote {
    padding: 0 1em;
    color: var(--comment);
    border-left: 0.25em solid #30363d;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 2em;
}

.markdown-body img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: var(--bg-color);
    position: relative;
    z-index: 20;
    cursor: zoom-in;
    border-radius: 4px;
}

/* Gallery Modal */
#modal-gallery {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    display: none; flex-direction: column; justify-content: center; align-items: center;
    z-index: 30;
}

.gallery-main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
    position: relative;
}

.gallery-main img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border: 1px solid var(--neon-green);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--neon-green);
    font-size: 30px;
    cursor: pointer;
    font-family: monospace;
    z-index: 100;
}

.gallery-thumbnails {
    height: 100px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: #000;
    border-top: 1px solid #333;
    overflow-x: auto;
    padding: 0 20px;
}

.gallery-thumbnails img {
    height: 70px;
    max-width: 120px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    border: 1px solid transparent;
    transition: 0.3s;
}

.gallery-thumbnails img:hover, .gallery-thumbnails img.active {
    opacity: 1;
    border-color: var(--neon-green);
}


/* index */

/* Estilos específicos para la sección de perfil técnico */
.portfolio-profile {
    padding: 10px;
    width: 100%;
}

.terminal-hr {
    border: 0;
    border-top: 1px dashed #30363d;
    margin: 25px 0;
}

.stack-title {
    color: var(--comment);
    font-size: 16px;
    margin-bottom: 10px;
}

.stack-desc {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 20px;
}

.skill-item h4 {
    font-size: 14px;
    color: var(--neon-blue);
    margin: 15px 0 5px 0;
}

/* Contenedores de código */
.code-block {
    background: #050505;
    border: 1px solid #21262d;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    max-width: 100%;
    overflow-x: auto; /* Scroll horizontal interno */
    -webkit-overflow-scrolling: touch; /* Scroll suave en móviles */
}

.code-block pre {
    margin: 0;
    display: block;
}

.code-block code {
    display: block;
    width: max-content; /* Importante para que el fondo cubra todo el ancho al scrollear */
    min-width: 100%;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: var(--text-main);
}

/* Clases de resaltado (Syntax Highlighting) */
.variable { color: #ff7b72; }
.function { color: #d2a8ff; }
.prompt { color: var(--neon-green); user-select: none; }

/* Logs de consola */
.log-info { color: #58a6ff; }
.log-success { color: var(--neon-green); text-shadow: 0 0 4px rgba(0, 255, 65, 0.4); }

/* Language Tabs */
.readme-lang-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 10px;
}

.lang-tab {
    background: transparent;
    border: 1px solid #30363d;
    color: var(--comment);
    padding: 5px 15px;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    transition: 0.3s;
}

.lang-tab:hover {
    color: var(--text-main);
    border-color: #8b949e;
}

.lang-tab.active {
    background: #21262d;
    color: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.2);
}

/* Folder items in sidebar */
.folder-item {
    padding: 5px 20px;
    font-size: 13px;
    cursor: pointer;
    color: #8b949e;
    list-style: none;
    user-select: none;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
}

.folder-item:hover {
    background: #21262d;
    color: white;
}

.folder-item.open {
    color: var(--neon-green);
}

.folder-label {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-item span {
    padding-left: 0;
    width: auto;
    position: static;
}

.folder-arrow {
    font-size: 9px;
    color: var(--comment);
    flex-shrink: 0;
    margin-left: 8px;
}

.folder-icon {
    font-size: 14px;
    flex-shrink: 0;
    filter: grayscale(0.3);
}

.folder-count {
    font-size: 11px;
    color: var(--comment);
}

.folder-content {
    list-style: none;
    padding: 0;
    margin: 0;
}

.folder-content .folder-child {
    padding-left: 38px;
}

/* Landing Page Overlay */
.intro-landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at center, #161b22 0%, var(--bg-color) 100%);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.intro-landing.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.landing-content {
    text-align: center;
    z-index: 2;
}

.glitch-title {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 10px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.landing-subtitle {
    font-size: 1.2rem;
    color: var(--comment);
    margin-bottom: 40px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
}

.landing-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-landing {
    padding: 15px 30px;
    font-size: 1rem;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
}

.btn-comercial {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
}

.btn-comercial:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
}

.btn-tecnico {
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
}

.btn-tecnico:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
}
/* Colores Neón */
.neon-text-green {
    color: var(--neon-green);
    text-transform: none;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
    margin-bottom: 20px;
}