/* Manifesto Page Specific Styles */

/* Strong CSS Reset for Navigation */
nav.chapter-nav,
nav.chapter-nav *,
nav.chapter-nav *:before,
nav.chapter-nav *:after {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 100% !important;
    font: inherit !important;
    vertical-align: baseline !important;
    box-sizing: border-box !important;
}

nav.chapter-nav a,
nav.chapter-nav a:link,
nav.chapter-nav a:visited,
nav.chapter-nav a:hover,
nav.chapter-nav a:active {
    color: inherit !important;
    text-decoration: none !important;
    background: none !important;
    border: none !important;
    outline: none !important;
}

/* Logo link styling */
.logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

/* Reset all default link styles for chapter navigation */
.chapter-nav *,
.chapter-nav *::before,
.chapter-nav *::after {
    box-sizing: border-box;
}

.chapter-nav a {
    color: inherit !important;
    text-decoration: none !important;
    outline: none !important;
    border: none !important;
    background: transparent !important;
}

/* Chapter Navigation Sidebar */
.chapter-nav {
    position: fixed !important;
    top: 90px !important;
    left: 0 !important;
    width: 280px !important;
    height: calc(100vh - 110px) !important;
    background: rgba(10, 10, 10, 0.98) !important;
    border-right: 1px solid rgba(255, 0, 0, 0.3) !important;
    z-index: 50 !important;
    overflow-y: auto !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5) !important;
    font-family: 'Inter', sans-serif !important;
    transition: transform 0.3s ease !important;
    transform: translateX(-100%) !important; /* Start hidden by default */
}

.chapter-nav.hidden {
    transform: translateX(-100%) !important;
}

.chapter-nav:not(.hidden) {
    transform: translateX(0) !important; /* Show when not hidden */
}

.chapter-nav-header {
    padding: 1.5rem 1rem 1rem !important;
    margin-top: 1rem !important;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3) !important;
    background: rgba(255, 0, 0, 0.1) !important;
}

.chapter-nav-header h3 {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 1.1rem !important;
    color: #ff0000 !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    margin: 0 !important;
    text-align: center !important;
    text-decoration: none !important;
}

.chapter-nav-content {
    padding: 1rem 0 !important;
}

.chapter-nav-part {
    margin-bottom: 1.5rem !important;
}

.chapter-nav-part h4 {
    margin: 0.5rem 0 0.5rem 0 !important;
    padding: 0.5rem 1rem !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    color: var(--accent-color);
}

.chapter-nav-part h4 a {
    color: #ff0000 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    font-weight: 600 !important;
    display: block !important;
}

.chapter-nav-part h4 a:hover {
    color: #ffffff !important;
}

.chapter-nav-part ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.chapter-nav-part li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.chapter-nav-part li a {
    display: block !important;
    padding: 0.6rem 1rem 0.6rem 1.5rem !important;
    color: #cccccc !important;
    text-decoration: none !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent !important;
    position: relative !important;
    background: transparent !important;
}

.chapter-nav-part li a:hover {
    color: #ffffff !important;
    background: rgba(255, 0, 0, 0.08) !important;
    border-left-color: #ff0000 !important;
    padding-left: 2rem !important;
}

.chapter-nav-part li a.active {
    color: #ff0000 !important;
    background: rgba(255, 0, 0, 0.12) !important;
    border-left-color: #ff0000 !important;
    font-weight: 600 !important;
}

.chapter-nav-part li a.active::before {
    content: '▶' !important;
    position: absolute !important;
    left: 0.5rem !important;
    color: #ff0000 !important;
    font-size: 0.7rem !important;
}

/* Custom scrollbar for chapter nav */
.chapter-nav::-webkit-scrollbar {
    width: 6px;
}

.chapter-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.chapter-nav::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chapter-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 0, 0.8);
}

/* Responsive design for chapter navigation */
@media (max-width: 1024px) {
    .chapter-nav {
        width: 260px;
    }

    .manifesto-main {
        margin-left: 260px;
    }
}

/* Terminal Loading Screen */
.terminal-screen {
    position: fixed;
    top: 80px; /* Leave space for header */
    left: 0;
    width: 100vw;
    height: calc(100vh - 80px); /* Adjust height to account for header */
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 50%, var(--bg-darker) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Lower z-index so header stays on top */
    font-family: 'JetBrains Mono', monospace;
}

.terminal-window {
    width: 80%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(255, 0, 0, 0.3), 0 0 0 1px rgba(255, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.terminal-header {
    background: rgba(255, 0, 0, 0.1);
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.terminal-button.close {
    background: #ff5555;
}

.terminal-button.minimize {
    background: #ffff55;
}

.terminal-button.maximize {
    background: #55ff55;
}

.terminal-title {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.terminal-body {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    min-height: 300px;
    color: #00ff00;
    font-size: 0.95rem;
    line-height: 1.6;
}

.terminal-line {
    margin-bottom: 1rem;
}

.terminal-prompt {
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 0.5rem;
}

.terminal-command {
    color: #00ff00;
}

.terminal-cursor {
    color: #00ff00;
    animation: terminal-blink 1s infinite;
    font-weight: bold;
}

@keyframes terminal-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.terminal-output {
    margin-top: 1rem;
}

.terminal-output-line {
    margin-bottom: 0.5rem;
    color: #cccccc;
}

.terminal-output-line.success {
    color: #00ff00;
}

.terminal-output-line.warning {
    color: #ffff00;
}

.terminal-output-line.error {
    color: #ff5555;
}

.terminal-output-line.info {
    color: #55ffff;
}

/* Hide mobile navigation on desktop */
.mobile-chapter-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Hide desktop side navigation */
    .chapter-nav {
        display: none;
    }

    /* Show mobile top chapter navigation */
    .mobile-chapter-nav {
        display: block;
        position: sticky;
        top: 70px;
        width: 100%;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--primary-color);
        z-index: 1000;
        transition: all 0.3s ease;
    }

    .mobile-chapter-current {
        padding: 1rem 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.9rem;
        width: 100%;
        text-align: left;
    }

    .mobile-chapter-current:hover {
        background: rgba(255, 0, 0, 0.1);
    }

    .mobile-chapter-title {
        flex: 1;
        font-weight: 600;
    }

    .mobile-chapter-arrow {
        transition: transform 0.3s ease;
        color: var(--primary-color);
        font-size: 1.2rem;
    }

    .mobile-chapter-nav.expanded .mobile-chapter-arrow {
        transform: rotate(180deg);
    }

    .mobile-chapter-dropdown {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: rgba(0, 0, 0, 0.98);
    }

    .mobile-chapter-nav.expanded .mobile-chapter-dropdown {
        max-height: 60vh;
        overflow-y: auto;
    }

    .mobile-chapter-item {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 0, 0, 0.1);
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .mobile-chapter-item:hover {
        background: rgba(255, 0, 0, 0.15);
    }

    .mobile-chapter-item.active {
        background: rgba(255, 0, 0, 0.2);
        border-left: 3px solid var(--primary-color);
    }

    .mobile-chapter-part {
        font-size: 1rem;
        color: var(--accent-color);
        font-weight: 600;
        margin-bottom: 0.1rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-family: 'JetBrains Mono', monospace;
    }

    .mobile-chapter-name {
        font-size: 0.95rem;
        color: var(--text-primary);
        font-weight: 500;
    }

    /* Special styling for part header items */
    .mobile-chapter-item.part-header {
        background: rgba(255, 255, 0, 0.08);
        border-left: 3px solid var(--accent-color);
        padding: 0.6rem 1.5rem;
    }

    .mobile-chapter-item.part-header:hover {
        background: rgba(255, 255, 0, 0.12);
    }

    .manifesto-main {
        margin-left: 0 !important;
        padding: 0;
        width: 100vw;
        min-height: 100vh;
    }

    .manifesto-hero {
        padding: 6rem 1rem 4rem;
        width: 100%;
    }

    .chapter {
        padding: 2rem 1rem;
        width: 100%;
        margin: 0;
    }

    .container {
        max-width: none;
        padding: 0 1rem;
        width: 100%;
    }
}

/* Adjust main content to accommodate sidebar and evidence links */
.manifesto-main {
    position: relative;
    padding-top: 90px;
    margin-left: 280px;
    margin-right: 0;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.manifesto-hero {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 50%, var(--bg-darker) 100%);
    padding: 4rem 0 6rem;
    text-align: center;
    position: relative;
}

.manifesto-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(255, 0, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.manifesto-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.manifesto-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

.manifesto-intro {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.3rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-style: italic;
    border-left: 4px solid var(--primary-color);
    padding-left: 2rem;
    text-align: left;
}

.manifesto-content {
    background: var(--bg-dark);
    padding: 4rem 0;
}

/* Override global container constraints specifically for manifesto */
.manifesto-main .manifesto-content .container {
    max-width: none !important;
    width: 100% !important;
    padding: 0 2rem 0 2rem !important;
    margin: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

.manifesto-content .container > * {
    width: 100% !important;
    max-width: none !important;
}

.manifesto-content .container section,
.manifesto-content .container article,
.manifesto-content .container .manifesto-part,
.manifesto-content .container .chapter {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}


.manifesto-hero .container {
    max-width: none;
    width: 100%;
    padding: 0 2rem;
    margin: 0;
}

.manifesto-part {
    margin-bottom: 4rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}


.part-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 1rem;
}

.part-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}


.chapter-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.chapter-section {
    margin-bottom: 2.5rem;
    position: relative;
}

.chapter-section-with-evidence {
    position: relative;
    overflow: visible;
    margin-bottom: 4rem;
}

.chapter-section-content {
    width: 100%;
}

.evidence-links {
    position: absolute;
    right: -340px;
    top: 0;
    bottom: 0;
    width: 320px;
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    overflow-y: auto;
    z-index: 40;
    backdrop-filter: blur(10px);
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.2);
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.evidence-links h5 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.evidence-links ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.evidence-links li {
    margin-bottom: 0.5rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.evidence-links a {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    display: block !important;
    padding: 0.3rem 0 !important;
    transition: color 0.3s ease !important;
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
}

.evidence-links a:hover {
    color: var(--primary-color) !important;
}

.evidence-links a::before {
    content: "→";
    color: var(--primary-color);
    margin-right: 0.5rem;
    font-size: 0.7rem;
}

.evidence-category {
    margin-bottom: 1.5rem;
}

.evidence-category:last-child {
    margin-bottom: 0;
}

/* Custom scrollbar for evidence links */
.evidence-links::-webkit-scrollbar {
    width: 4px;
}

.evidence-links::-webkit-scrollbar-track {
    background: rgba(255, 0, 0, 0.1);
}

.evidence-links::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 0, 0.4);
    border-radius: 2px;
}

.evidence-links::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 0, 0.6);
}

.chapter-section h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.chapter-section ul {
    list-style: none;
    padding: 0;
}

.chapter-section li {
    background: rgba(255, 0, 0, 0.05);
    border-left: 3px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    border-radius: 0 5px 5px 0;
}

.chapter-section li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.manifesto-conclusion {
    background: var(--bg-darker);
    padding: 4rem 0;
    border-top: 2px solid var(--primary-color);
}

.conclusion-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 2px;
}

.conclusion-content {
    max-width: 900px;
    margin: 0 auto;
}

.conclusion-content h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 2rem 0 1rem;
    letter-spacing: 1px;
}

.conclusion-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.conclusion-content ul {
    list-style: none;
    padding: 0;
}

.conclusion-content li {
    background: rgba(255, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    border-radius: 0 5px 5px 0;
}

.revolution-call {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(255, 255, 0, 0.05));
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.revolution-call h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.revolution-call p {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-style: italic;
    margin: 0;
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    width: 100%;
}

.nav-logo a {
    color: inherit;
    text-decoration: none;
}

/* Responsive Design for Evidence Links */
@media (max-width: 1400px) {
    .evidence-links {
        width: 280px;
        right: 15px;
    }
}

@media (max-width: 1200px) {
    .evidence-links {
        width: 250px;
        right: 10px;
    }
}

@media (max-width: 1024px) {
    .manifesto-main {
        margin-right: 20px;
    }

    .evidence-links {
        position: relative;
        right: auto;
        top: auto;
        max-height: none;
        width: 100%;
        margin: 2rem 0;
        backdrop-filter: none;
        box-shadow: none;
    }

    .chapter-section-with-evidence .evidence-links {
        margin-top: 1.5rem;
    }
}

/* Responsive Design for Manifesto */
@media (max-width: 768px) {
    .manifesto-intro {
        padding-left: 1rem;
        text-align: left;
    }

    .chapter {
        padding: 2rem 1.5rem;
    }

    .chapter-section li {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .manifesto-title {
        font-size: 2.5rem;
    }

    .manifesto-subtitle {
        font-size: 1.3rem;
    }

    .evidence-links {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .evidence-links h5 {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .manifesto-hero {
        padding: 2rem 0 3rem;
    }

    .part-title {
        font-size: 1.8rem;
    }

    .chapter-title {
        font-size: 1.4rem;
    }

    .conclusion-title {
        font-size: 2.2rem;
    }
}