/* GEOINT DOCS STYLE SYSTEM */
:root {
    --primary: #ff6800;
    --primary-dim: rgba(255, 104, 0, 0.4);
    --bg-dark: #050505;
    --bg-panel: rgba(10, 10, 10, 0.95);
    --border-color: #333;
    --border-active: #ff6800;
    --font-mono: 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: #ccc;
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- BACKGROUND FX --- */
.scanlines {
    display: none;
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(transparent 95%, rgba(255, 104, 0, 0.05) 95%),
        linear-gradient(90deg, transparent 95%, rgba(255, 104, 0, 0.05) 95%);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* --- LAYOUT --- */
/* --- LAYOUT --- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    /* z-index removed to allow children to stack independently */
}

/* HEADER */
header.top-bar {
    height: 60px;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--border-active);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 0 20px rgba(255, 104, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Above scanlines */
}

.brand {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    display: flex;
    gap: 10px;
    align-items: center;
}

.brand a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.brand a:hover {
    opacity: 0.8;
    text-shadow: 0 0 15px var(--primary);
}

.top-nav {
    display: flex;
    align-items: center;
}

.top-nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 15px;
    border: 1px solid var(--primary);
    margin-left: 10px;
    text-transform: uppercase;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.8);
}

.top-nav a:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary);
}

/* MAIN BODY */
.main-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* SIDEBAR */
aside.sidebar {
    width: 280px;
    background: rgba(5, 5, 5, 0.9);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 25px;
}

.nav-header {
    padding: 5px 20px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #222;
    margin-bottom: 10px;
}

.nav-item {
    display: block;
    padding: 8px 20px;
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    /* Keep bold for readability */
    transition: all 0.2s;
    border-left: 2px solid transparent;
    letter-spacing: 1px;
    background: transparent;
    /* No boxy background */
    margin-bottom: 2px;
}

.nav-item:hover,
.nav-item.active {
    color: #fff;
    /* Bright white */
    background: transparent;
    /* Keep transparent */
    text-shadow: 0 0 8px var(--primary-dim);
    /* Glow instead of box */
    padding-left: 25px;
    transform: scale(1.02);
    transform-origin: left center;
}

/* Restore Brackets for Theme */
.nav-item::before {
    content: '[';
    opacity: 0;
    margin-right: 8px;
    color: var(--primary);
    transition: opacity 0.2s;
    display: inline-block;
}

.nav-item::after {
    content: ']';
    display: inline-block;
    opacity: 0;
    margin-left: 8px;
    /* Spacing */
    color: var(--primary);
    transition: opacity 0.2s;
}

.nav-item:hover::before,
.nav-item.active::before,
.nav-item:hover::after,
/* Restore after bracket hover */
.nav-item.active::after {
    opacity: 1;
}

/* CONTENT AREA */
main.content {
    flex: 1;
    padding: 5px 60px 40px 60px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: radial-gradient(circle at center, rgba(20, 20, 20, 0.5) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.doc-section {
    margin-bottom: 60px;
    max-width: 900px;
    animation: fadeIn 0.5s ease-out;
}

.legal-footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    margin-bottom: 20px;
    border-top: 1px solid rgba(255, 104, 0, 0.2);
    width: 100%;
}

.legal-footer a {
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.legal-footer a:hover {
    color: var(--primary);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 30px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--primary-dim);
    letter-spacing: 2px;
}

h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-top: 40px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

h3 {
    font-size: 1.2rem;
    color: #ddd;
    margin-top: 25px;
    text-transform: uppercase;
}

p {
    margin-bottom: 20px;
    color: #bbb;
    font-size: 1rem;
    max-width: 800px;
}

/* CODE BLOCKS */
pre {
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    position: relative;
    margin: 20px 0;
}

pre::before {
    content: "SHELL";
    position: absolute;
    top: 0;
    right: 0;
    background: #222;
    color: #777;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-bottom-left-radius: 4px;
}

code {
    font-family: 'Courier New', monospace;
    color: var(--primary);
}

.inline-code {
    background: rgba(255, 104, 0, 0.1);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.9em;
    border: 1px solid rgba(255, 104, 0, 0.2);
}

/* BLOCKQUOTES as "Mission Notes" */
blockquote {
    margin: 30px 0;
    background: rgba(255, 104, 0, 0.03);
    border: 1px dashed var(--primary);
    padding: 20px;
    color: #ddd;
    position: relative;
}

blockquote::before {
    content: "! NOTE";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #000;
    color: var(--primary);
    padding: 0 10px;
    font-weight: bold;
    font-size: 0.8rem;
}

/* --- COMPONENT UTILITIES --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    padding: 20px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 104, 0, 0.05);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.feature-card h4 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: bold;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    background: #333;
    color: #ccc;
    border: 1px solid transparent;
}

.tag-mil {
    background: rgba(255, 104, 0, 0.2);
    color: var(--primary);
    border-color: var(--primary);
}

.tag-alert {
    background: rgba(255, 50, 50, 0.2);
    color: #ff3333;
    border-color: #ff3333;
}

.tag-dim {
    background: #222;
    color: #666;
    border-color: #444;
}

.text-orange {
    color: var(--primary);
}

.text-red {
    color: #ff3333;
}

.text-dim {
    color: #666;
}

/* Data Table Styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--primary);
    color: var(--primary);
    text-transform: uppercase;
}

.data-table td {
    padding: 10px;
    border-bottom: 1px solid #222;
    color: #bbb;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* FOOTER STATUS BAR */
.status-bar {
    height: 30px;
    background: #111;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 0.75rem;
    color: #666;
    justify-content: space-between;
}

.status-item {
    margin-right: 20px;
}

.status-value {
    color: var(--primary);
    margin-left: 5px;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #444;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .app-container {
        height: auto;
    }

    .main-content-wrapper {
        flex-direction: column;
        background: radial-gradient(circle at center, rgba(20, 20, 20, 0.5) 0%, rgba(0, 0, 0, 0.8) 100%);
        overflow: visible;
    }

    aside.sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        background: var(--bg-panel);
        position: sticky;
        top: 60px;
        z-index: 999;
        padding: 5px 20px;
        overflow: visible;
        max-height: none;
        border: none;
        border-bottom: 2px solid var(--primary);
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }

    /* Accordion Logic - iOS Safari compatible */
    .nav-toggle {
        position: absolute;
        left: -9999px;
        opacity: 0;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        -webkit-appearance: none;
        appearance: none;
    }

    .nav-group {
        margin-bottom: 0;
        position: relative;
    }

    .nav-header {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-align: center;
        -webkit-align-items: center;
        align-items: center;
        width: 100%;
        padding: 4px 15px 4px 0;
        background: transparent;
        border: none;
        margin-bottom: 0;
        cursor: pointer;
        color: var(--primary);
        font-weight: bold;
        font-size: 12px;
        letter-spacing: 1px;
        -webkit-transition: all 0.2s;
        transition: all 0.2s;
    }

    /* Arrow Icon */
    .nav-header::before {
        content: '>>';
        display: inline-block;
        margin-right: 5px;
        -webkit-transition: -webkit-transform 0.2s ease;
        transition: transform 0.2s ease;
        -webkit-transform: scaleY(1.5) scaleX(0.7);
        transform: scaleY(1.5) scaleX(0.7);
        letter-spacing: -1px;
        -webkit-transform-origin: center center;
        transform-origin: center center;
    }

    .nav-toggle:checked~.nav-header::before {
        -webkit-transform: rotate(90deg) scaleY(1.5) scaleX(0.7);
        transform: rotate(90deg) scaleY(1.5) scaleX(0.7);
    }

    .nav-item {
        display: none;
        background: transparent;
        border: none;
        margin-bottom: 0;
        padding: 3px 15px 3px 30px;
        font-size: 12px;
    }

    .nav-item::before {
        content: none;
    }

    .nav-item::after {
        content: none;
    }

    .nav-item.active::before {
        content: '■';
        margin-right: 8px;
        color: var(--primary);
    }

    .nav-item:hover {
        background: rgba(255, 104, 0, 0.1);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-toggle:checked~.nav-item {
        display: block;
    }

    /* Hide Old Global Toggle Elements */
    .sidebar-toggle-input,
    .sidebar-toggle-label,
    .sidebar-content {
        display: none !important;
    }

    main.content {
        padding: 10px 20px 20px 20px;
        background: transparent;
        font-size: 0.9rem;
        overflow-y: visible;
    }

    main.content h1 {
        font-size: 1.6rem;
    }

    main.content h2 {
        font-size: 1.2rem;
    }

    main.content h3 {
        font-size: 1rem;
    }

    main.content p,
    main.content li {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .top-nav a {
        padding: 6px 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 38px;
        box-sizing: border-box;
    }

    .return-link span {
        display: none;
    }

    .return-link svg {
        display: block;
    }

    .top-nav .return-link {
        padding: 6px 10px;
    }

    .brand a:first-child {
        display: none;
    }

    .desktop-text {
        display: none;
    }

    .mobile-docs-text {
        display: inline;
    }

    .desktop-docs-text {
        display: none;
    }
}

@media (min-width: 769px) {
    .return-link svg {
        display: none;
    }

    .mobile-docs-text {
        display: none;
    }
}

/* Desktop default for toggle */
@media (min-width: 769px) {
    .nav-toggle {
        display: none;
    }

    .nav-header {
        pointer-events: none;
        /* Ensure no pointer on desktop - sidebar is always visible */
    }
}

/* Utility Colors */
.text-orange {
    color: #ff6800;
}

.text-cyan {
    color: #00ffff;
}

.text-green {
    color: #00ff00;
}

.text-purple {
    color: #bf00ff;
}

.text-turquoise {
    color: #40e0d0;
}

.text-red {
    color: #ff3333;
}

.text-grey {
    color: #888;
}

/* Highlight Utilities */
.highlight-orange {
    background-color: #ff6800;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-purple {
    background-color: #bf00ff;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-turquoise {
    background-color: #40e0d0;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-grey {
    background-color: #888;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-green {
    background-color: #00ff00;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-cyan {
    background-color: #00ffff;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-red {
    background-color: #ff3333;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-blue {
    background-color: #007fff;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-teal {
    background-color: #00ffd0;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

.highlight-magenta {
    background-color: #ff00ff;
    color: #000;
    padding: 0 4px;
    border-radius: 2px;
}

/* EXTERNAL LINKS */
.external-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.external-link:hover,
.external-link:active {
    color: var(--primary);
    border-bottom: 1px solid var(--primary);
}
/* INFO ICON STYLE */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: bold;
    border: 1px solid var(--primary);
    border-radius: 2px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
    margin: 0 4px;
    background: rgba(255, 104, 0, 0.1);
}
