/* ============================================
   SISTEMA DE NAVEGACIÓN - EL ARCHIVO INFINITO
   ============================================ */

/* Botón hamburger con símbolos △◯ */
.nav-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0f0;
    cursor: pointer;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.nav-toggle:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

.nav-toggle .symbol-line {
    width: 25px;
    height: 2px;
    background: #0f0;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.nav-toggle.active .symbol-line:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.nav-toggle.active .symbol-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .symbol-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Panel lateral tipo terminal */
.nav-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    border-left: 2px solid #0f0;
    z-index: 1999;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: -5px 0 30px rgba(0, 255, 0, 0.2);
    backdrop-filter: blur(10px);
}

.nav-panel.active {
    right: 0;
}

/* Efecto glitch en el panel */
.nav-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 255, 0, 0.03) 50%,
        transparent 100%
    );
    pointer-events: none;
    animation: panel-scan 3s linear infinite;
}

@keyframes panel-scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Header del panel */
.nav-header {
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    position: relative;
}

.nav-header .terminal-prompt {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #0f0;
    opacity: 0.6;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.nav-header .terminal-title {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #0f0;
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.nav-header .access-level {
    font-size: 0.65rem;
    color: #0ff;
    opacity: 0.7;
    margin-top: 5px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    font-size: 0.7rem;
    color: #0f0;
    opacity: 0.6;
    font-family: 'Courier New', monospace;
}

.breadcrumbs a {
    color: #0f0;
    text-decoration: none;
    transition: all 0.2s;
}

.breadcrumbs a:hover {
    color: #0ff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.breadcrumbs .separator {
    margin: 0 8px;
    opacity: 0.4;
}

.breadcrumbs .current {
    color: #0ff;
}

/* Secciones del menú */
.nav-section {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}

.nav-section-title {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #0f0;
    opacity: 0.5;
    letter-spacing: 0.2em;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Enlaces del menú */
.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #0f0;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::before {
    content: '>';
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.nav-links a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.nav-links a:hover {
    background: rgba(0, 255, 0, 0.05);
    border-color: #0f0;
    padding-left: 20px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.nav-links a.active {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0ff;
    color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.nav-links a.visited {
    opacity: 0.7;
}

.nav-links a.visited::after {
    content: '✓';
    margin-left: auto;
    font-size: 0.7rem;
    color: #0f0;
}

/* Iconos de estado */
.nav-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0f0;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    flex-shrink: 0;
}

.nav-icon.locked {
    background: #f00;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.nav-icon.new {
    background: #0ff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Progreso de exploración */
.nav-progress {
    padding: 20px;
    background: rgba(0, 255, 0, 0.03);
}

.progress-title {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #0f0;
    opacity: 0.6;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #0f0;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0f0, #0ff);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #0ff;
    margin-top: 8px;
    text-align: center;
}

/* Terminal de comandos */
.nav-terminal {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(0, 255, 0, 0.3);
}

.terminal-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.terminal-prompt-symbol {
    color: #0f0;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    outline: none;
    padding: 5px;
}

.terminal-input::placeholder {
    color: rgba(0, 255, 0, 0.3);
}

.terminal-help {
    margin-top: 10px;
    font-size: 0.7rem;
    color: #0f0;
    opacity: 0.5;
    line-height: 1.6;
}

/* Sección de ayuda de comandos */
.commands-help {
    padding: 10px 0;
}

.command-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    margin-bottom: 5px;
    background: rgba(0, 255, 0, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

.command-item:hover {
    background: rgba(0, 255, 0, 0.08);
    border-color: rgba(0, 255, 0, 0.3);
    transform: translateX(3px);
}

.command-name {
    color: #0ff;
    font-weight: bold;
    letter-spacing: 0.05em;
    min-width: 100px;
}

.command-desc {
    color: #0f0;
    opacity: 0.7;
    font-size: 0.7rem;
    text-align: right;
}

/* Overlay oscuro */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Breadcrumbs en la parte superior de las páginas */
.page-breadcrumbs {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #0f0;
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(5px);
}

.page-breadcrumbs a {
    color: #0f0;
    text-decoration: none;
    transition: all 0.2s;
}

.page-breadcrumbs a:hover {
    color: #0ff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.page-breadcrumbs .separator {
    margin: 0 8px;
    opacity: 0.4;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-panel {
        width: 100%;
        right: -100%;
    }
    
    .nav-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .page-breadcrumbs {
        top: 15px;
        left: 15px;
        font-size: 0.65rem;
        padding: 8px 12px;
    }
    
    .command-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .command-name {
        min-width: auto;
    }
    
    .command-desc {
        text-align: left;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .nav-toggle {
        width: 40px;
        height: 40px;
    }
    
    .nav-toggle .symbol-line {
        width: 20px;
    }
    
    .page-breadcrumbs {
        font-size: 0.6rem;
        padding: 6px 10px;
    }
    
    .command-item {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    
    .command-desc {
        font-size: 0.6rem;
    }
}


/* ============================================
   NAVEGACIÓN ENTRE CAPÍTULOS
   ============================================ */

.chapter-navigation {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2rem;
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 255, 0, 0.3);
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}

.chapter-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(0, 255, 0, 0.03);
    border: 1px solid rgba(0, 255, 0, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chapter-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.chapter-nav-btn:hover::before {
    left: 100%;
}

.chapter-nav-btn:hover {
    background: rgba(0, 255, 0, 0.08);
    border-color: #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

.chapter-nav-btn.prev-chapter {
    justify-content: flex-start;
}

.chapter-nav-btn.next-chapter {
    justify-content: flex-end;
}

.nav-arrow {
    font-size: 2rem;
    color: #0f0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chapter-nav-btn:hover .nav-arrow {
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.prev-chapter:hover .nav-arrow {
    transform: translateX(-5px);
}

.next-chapter:hover .nav-arrow {
    transform: translateX(5px);
}

.nav-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prev-chapter .nav-info {
    align-items: flex-start;
    text-align: left;
}

.next-chapter .nav-info {
    align-items: flex-end;
    text-align: right;
}

.nav-label {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #0f0;
    opacity: 0.6;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.nav-title {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #0f0;
    font-weight: bold;
    line-height: 1.4;
}

.chapter-nav-btn:hover .nav-title {
    color: #0ff;
}

.chapter-nav-spacer {
    flex: 1;
}

/* Responsive para navegación de capítulos */
@media (max-width: 768px) {
    .chapter-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .chapter-nav-btn {
        width: 100%;
    }
    
    .chapter-nav-spacer {
        display: none;
    }
    
    .nav-arrow {
        font-size: 1.5rem;
    }
    
    .nav-title {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .chapter-navigation {
        margin: 2rem 0;
        padding: 1.5rem 0;
    }
    
    .chapter-nav-btn {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .nav-arrow {
        font-size: 1.2rem;
    }
    
    .nav-label {
        font-size: 0.65rem;
    }
    
    .nav-title {
        font-size: 0.75rem;
    }
}
