/* 
   KNOWLEDGE CORE - SHARED STYLE SYSTEM
   Theme: Cyber-Luxe (Hot Green Primary, Hot Pink Secondary)
   Base: charcoal grey (#121214) / black (#000000)
*/

:root {
    --bg-color: #121214;
    --card-bg: #000000;
    --text-color: #e2e2e7;
    --accent-color: #00ff88;
    /* Hot Green */
    --secondary-color: #ff007f;
    /* Hot Pink */
    --border-color: #1e1e22;
    --muted-text: #a0a0aa;
    --header-bg: #000000;
    --code-bg: #0a0a0c;
    --nav-height: 70px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

code,
pre,
.mono {
    font-family: 'Fira Code', monospace;
}

/* --- NAVIGATION --- */
nav {
    background: var(--header-bg);
    padding: 0 40px;
    height: var(--nav-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand span {
    color: var(--secondary-color);
    filter: drop-shadow(0 0 10px rgba(255, 0, 127, 0.3));
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--muted-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

.container {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    color: #fff;
    margin-top: 0;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.03em;
    margin-bottom: 32px;
}

/* --- GALLERY VIEW --- */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.asset-card {
    aspect-ratio: 16 / 10;
    background: #0b0b0d;
    /* Slightly darker than base for depth */
    border: 2px solid var(--accent-color);
    /* Default: Green border for completed */
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: block;
    /* Ghost Identity Pattern for empty/loading cards */
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

/* Processing state: Gold border */
.asset-card.processing {
    border-color: #f7bb05;
    box-shadow: 0 0 20px rgba(247, 187, 5, 0.1);
}

.asset-card:hover {
    border-color: var(--secondary-color);
    /* Hot pink on hover */
    box-shadow: 0 0 40px rgba(255, 0, 127, 0.25);
    transform: scale(1.02);
}

.asset-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.asset-card:hover img {
    transform: scale(1.05);
}

.asset-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

.asset-card:hover .asset-overlay {
    opacity: 1;
}

.asset-id {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--accent-color);
}

/* --- DETAIL VIEW --- */
.detail-container {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 150px;
}

.asset-header {
    margin-bottom: 60px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    text-align: center;
}

.asset-header h2 {
    font-family: 'Fira Code', monospace;
    font-size: 1.6rem;
    color: var(--accent-color);
}

.hero-media {
    width: 100%;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 80px;
    display: flex;
    justify-content: center;
}

.hero-media img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    object-fit: contain;
}

.expert-section {
    margin-bottom: 60px;
}

.intel-card {
    background: #000;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 40px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.intel-card-header {
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.intel-card-header h3 {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.intel-card-header h3 span {
    color: var(--secondary-color);
    margin-left: 12px;
    font-size: 0.8em;
    opacity: 0.8;
}

.intel-card-body {
    padding: 32px;
}

/* --- MARKDOWN RENDERING --- */
/* --- MARKDOWN RENDERING --- */
.raw-intel-source {
    display: none;
}

.markdown-rendered {
    color: #d1d1d8;
    font-size: 1.15rem;
    line-height: 1.8;
    font-weight: 300;
}

.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3 {
    color: var(--accent-color);
    margin: 2.5rem 0 1.2rem 0;
}

.markdown-rendered p {
    margin-bottom: 1.5rem;
}

.markdown-rendered ul,
.markdown-rendered ol {
    margin-bottom: 1.8rem;
    padding-left: 1.5rem;
}

.markdown-rendered li {
    margin-bottom: 0.8rem;
}

.markdown-rendered a {
    color: var(--accent-color);
}

.markdown-rendered table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(0, 0, 0, 0.3);
}

.markdown-rendered th,
.markdown-rendered td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
}

.markdown-rendered th {
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
}

.markdown-rendered code {
    background: #000;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: #f7bb05;
    font-size: 0.85em;
}

/* --- UTILITIES --- */
.btn {
    background: var(--accent-color);
    color: #000;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.btn:hover {
    background: #00cc6e;
    transform: translateY(-1px);
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn.secondary:hover {
    background: var(--secondary-color);
    color: #000;
}

.scanline {
    width: 100%;
    height: 100px;
    z-index: 10;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.1;
    position: fixed;
    bottom: 100%;
    animation: scan 10s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% {
        bottom: 100%;
    }

    100% {
        bottom: -10%;
    }
}

/* --- PRINT LAYOUT (Ctrl+P) --- */
/* --- PRINT LAYOUT (Ctrl+P) --- */
@media print {

    /* Reset Colors to White/Black for Ink Saving */
    :root {
        --bg-color: #ffffff;
        --card-bg: #ffffff;
        --text-color: #000000;
        --accent-color: #000000;
        --secondary-color: #333333;
        --border-color: #ccc;
        --muted-text: #555;
        --header-bg: #fff;
        --code-bg: #f8f8f8;
    }

    body {
        background: #fff;
        color: #000;
        /* Elegant Serif for Body Text */
        font-family: 'Merriweather', 'Georgia', 'Times New Roman', serif;
        font-size: 11pt;
        /* Readable size */
        line-height: 1.6;
        text-shadow: none !important;
        margin: 0;
    }

    /* Hide UI Elements */
    nav,
    .scanline,
    .btn,
    .nav-breadcrumb,
    .asset-header,
    /* Hide specific Technical Asset Fingerprint header */
    .intel-card-header .runtime-info {
        display: none !important;
    }

    /* Print-Friendly Hero Image */
    .hero-media {
        display: block !important;
        border: 1px solid #ccc;
        margin-bottom: 2em;
        text-align: center;
        page-break-inside: avoid;
    }

    .hero-media img {
        max-height: 40vh;
        /* Limit height to save paper */
        width: auto;
        max-width: 100%;
    }

    /* Layout Adjustments */
    .container,
    .detail-container,
    .paper-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Remove all shadows */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Markdown Specifics */
    /* Markdown Specifics */
    .markdown-rendered {
        color: #000;
        font-size: 10pt;
        /* Reduced to standard academic size */
        text-align: justify;
        hyphens: auto;
    }

    /* Headlines */
    .markdown-rendered h1,
    .markdown-rendered h2,
    .markdown-rendered h3 {
        color: #000;
        font-family: 'Inter', sans-serif;
        page-break-after: avoid;
        break-after: avoid;
        margin-top: 1.2em;
        margin-bottom: 0.6em;
    }

    .markdown-rendered h1 {
        font-size: 18pt;
        /* Only break before H1 if it's not the very top title */
        page-break-before: auto;
        break-before: auto;
        border-bottom: 2px solid #000;
        padding-bottom: 0.2em;
    }

    /* Force break before major H1s, but rely on natural flow mostly */
    .markdown-rendered h1:not(:first-child) {
        margin-top: 2em;
        border-top: 1px solid #ccc;
        /* Visual separation instead of page break */
        padding-top: 1em;
    }

    .markdown-rendered h2 {
        font-size: 14pt;
        border-bottom: 1px solid #ddd;
        padding-bottom: 0.1em;
        /* CRITICAL FIX: Remove forced page break before H2 */
        page-break-before: auto;
        break-before: auto;
    }

    .markdown-rendered h3 {
        font-size: 12pt;
        font-weight: 700;
        border-bottom: none;
    }

    .markdown-rendered p,
    .markdown-rendered li {
        color: #000;
        margin-bottom: 0.6em;
        orphans: 3;
        widows: 3;
        line-height: 1.5;
    }

    /* Code Blocks */
    .markdown-rendered pre {
        background: #f8f8f8 !important;
        border: 1px solid #ddd;
        border-radius: 4px;
        page-break-inside: avoid;
        font-size: 9pt;
        padding: 10px;
        font-family: 'Fira Code', monospace;
    }

    .markdown-rendered code {
        background: #f8f8f8 !important;
        color: #333 !important;
        border: 1px solid #eee;
        font-size: 9pt;
        font-family: 'Fira Code', monospace;
        padding: 0.1em 0.3em;
        border-radius: 2px;
    }

    /* Tables */
    .markdown-rendered table {
        page-break-inside: auto;
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
        margin: 1.5em 0;
        font-family: 'Inter', sans-serif;
        /* Tables often better in Sans */
    }

    .markdown-rendered tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .markdown-rendered th,
    .markdown-rendered td {
        border: 1px solid #ccc;
        padding: 6px 10px;
        color: #000;
        text-align: left;
    }

    .markdown-rendered th {
        background: #f0f0f0 !important;
        font-weight: 700;
        border-bottom: 2px solid #aaa;
    }

    /* Images */
    .markdown-rendered img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
        border: 1px solid #eee;
        margin: 1em 0;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    /* Details/Summary */
    details {
        border: 1px solid #ddd;
        padding: 10px;
        margin: 1em 0;
        page-break-inside: avoid;
        border-radius: 4px;
    }

    summary {
        font-weight: bold;
        list-style: none;
        font-family: 'Inter', sans-serif;
        cursor: pointer;
    }

    summary::-webkit-details-marker {
        display: none;
    }

    summary::before {
        content: "▶ ";
        font-size: 0.8em;
        color: #555;
    }

    details[open] summary::before {
        content: "▼ ";
    }

    /* Links */
    a {
        text-decoration: none;
        color: #000 !important;
        border-bottom: 1px dotted #999;
    }
}