/* === THEME-DOSSIER.CSS === */
/* Styles specific to the "Connected + Guardian" / High-Tech Lab look */

[data-theme="dossier"] body {
    --text-primary: #1a1f2e;
    --text-secondary: #4a5568;
    --bg-primary: #f2f3f7;
    --bg-card: #ffffff;
    --border-subtle: #e2e8f0;

    background-color: var(--bg-primary);
    /* Faint Grid Lines (Graph Paper) */
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Oxanium', sans-serif;
}

[data-theme="dossier"] .terminal-only {
    display: none !important;
}

[data-theme="dossier"] .dossier-only {
    display: block;
}

/* Typography Overrides */
[data-theme="dossier"] h1,
[data-theme="dossier"] h2,
[data-theme="dossier"] h3 {
    color: #1a1f2e;
    /* Dark Headers */
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Clean Panel Style */
[data-theme="dossier"] .dossier-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    /* Sharper corners for documents */
    box-shadow: var(--shadow-base);
    position: relative;
    overflow: hidden;
}

/* Decorative "Paper" details */
[data-theme="dossier"] .dossier-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-secondary), transparent);
    opacity: 0.5;
}

/* Buttons in Dossier Mode */
[data-theme="dossier"] .btn-primary {
    background: var(--accent-secondary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

[data-theme="dossier"] .nav-link {
    color: var(--text-secondary);
}

[data-theme="dossier"] .nav-link:hover,
[data-theme="dossier"] .nav-link.active {
    color: var(--accent-secondary);
    background: rgba(108, 92, 231, 0.05);
}

[data-theme="dossier"] .nav-link.active {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    text-shadow: 0 0 8px rgba(108, 92, 231, 0.4);
}


/* === GLITCH & OVERLAY === */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

.glitch-overlay.active {
    opacity: 1;
    pointer-events: all;
    animation: glitch-bg 0.2s infinite;
}

.glitch-text {
    font-family: var(--font-hud);
    font-size: 2rem;
    color: #fff;
    position: relative;
}

@keyframes glitch-bg {
    0% {
        background-color: #000;
    }

    25% {
        background-color: #111;
    }

    50% {
        background-color: #0d0d0d;
    }

    75% {
        background-color: #050505;
    }

    100% {
        background-color: #000;
    }
}

/* === DOSSIER MINT OVERRIDES (Allow Funnel to look good in Light Mode) === */

/* Ensure Funnel Section is visible but styled differently */
[data-theme="dossier"] .funnel-section {
    background: transparent !important;
    /* Remove dark background */
}

/* Fix Headline Glitch & Remove Black Bar */
[data-theme="dossier"] .funnel-headline {
    color: var(--text-primary);
    text-shadow: none;
}

[data-theme="dossier"] .headline-accent {
    color: var(--accent-secondary);
}

[data-theme="dossier"] .glitch::before,
[data-theme="dossier"] .glitch::after {
    content: none !important;
}

/* Dossier Frame Styling */
[data-theme="dossier"] .funnel-display-port {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(108, 92, 231, 0.45);
    box-shadow: var(--shadow-base);
    clip-path: var(--cut-corner);
    position: relative;
    backdrop-filter: none;
}

[data-theme="dossier"] .funnel-display-port::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    clip-path: var(--cut-corner-sm);
    pointer-events: none;
}


/* Tabs: Transparent Backgrounds */
/* Tabs: Boxed Style */
[data-theme="dossier"] .funnel-tab-btn {
    background: #fff !important;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    clip-path: var(--cut-corner-sm);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    padding: 14px 22px;
}

[data-theme="dossier"] .funnel-tab-btn.active {
    color: #fff;
    background: var(--accent-secondary) !important;
    border-color: rgba(108, 92, 231, 0.65);
    box-shadow: 0 10px 24px rgba(108, 92, 231, 0.18);
}


[data-theme="dossier"] .funnel-subhead,
[data-theme="dossier"] .funnel-content-body {
    color: var(--text-secondary);
}

/* Remove Grey Boxes from Content Panels */
/* Remove Grey Boxes from Content Panels */
[data-theme="dossier"] .funnel-content {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

[data-theme="dossier"] .funnel-bottom-section {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(108, 92, 231, 0.22);
    clip-path: var(--cut-corner-sm);
    padding: 18px;
}

[data-theme="dossier"] .novel-teaser-text {
    font-family: var(--font-hud);
    font-size: 1.4rem;
    line-height: 1.1;
    color: var(--text-primary);
}

[data-theme="dossier"] .novel-teaser-text span {
    color: var(--accent-primary);
    font-size: 1.8rem;
}

[data-theme="dossier"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(108, 92, 231, 0.10), transparent 40%) top left,
        linear-gradient(225deg, rgba(108, 92, 231, 0.08), transparent 40%) top right;
    background-repeat: no-repeat;
    background-size: 420px 420px;
    opacity: 1;
    z-index: 0;
}

[data-theme="dossier"] body>* {
    position: relative;
    z-index: 1;
}

/* Fix Header Z-Index being crushed by above rule */
[data-theme="dossier"] .unified-header {
    z-index: 10000 !important;
    position: fixed !important;
    /* Restore fixed positioning overridden by body > * */
}


/* Code Blocks: Inverted for Paper look */
[data-theme="dossier"] .code-block {
    background: #fff;
    border: 1px solid var(--border-subtle);
    color: #333;
    box-shadow: var(--shadow-sm);
}

[data-theme="dossier"] .code-content {
    color: #555;
    font-family: 'Courier New', monospace;
}

[data-theme="dossier"] .code-line {
    border-bottom: 1px solid #eee;
    color: var(--accent-primary);
    /* Keep accent color */
}

/* Tabs */


/* Back Button needs to stand out */
[data-theme="dossier"] .dossier-only.container {
    margin-bottom: 20px;
}

/* Logo filter for Dossier Mode (Lavender #8c61ff) */
[data-theme="dossier"] .brand-logo img {
    filter: brightness(0) saturate(100%) invert(56%) sepia(38%) saturate(5427%) hue-rotate(227deg) brightness(100%) contrast(102%);
}

/* === LOADOUT PAGE SPECIFIC === */

/* Left Stats Panel */
.dossier-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 Columns */
    gap: 16px;
    margin-top: 20px;
}

.dossier-stat-box {
    background: #fff;
    border: 1px solid var(--border-subtle);
    padding: 10px;
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 70px;
}

/* Fancy brackets for stats */
.dossier-stat-box::before,
.dossier-stat-box::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid var(--text-muted);
    opacity: 0.3;
}

.dossier-stat-box::before {
    top: 4px;
    left: 4px;
    border-bottom: none;
    border-right: none;
}

.dossier-stat-box::after {
    bottom: 4px;
    right: 4px;
    border-top: none;
    border-left: none;
}

.dossier-stat-box .stat-value {
    font-family: var(--font-hud);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-primary);
    line-height: 1;
}

.dossier-stat-box .stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}

/* Right Slots Panel */
.dossier-slot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.dossier-slot-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-left: 4px solid #ddd;
    /* Default empty state */
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dossier-slot-card:hover {
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-left-color: var(--accent-secondary);
}

.dossier-slot-card.active-slot {
    border-left-color: var(--accent-primary);
    /* Active/Filled color */
    background: #fdfdff;
}

.dossier-slot-content h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dossier-slot-content div {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 2px;
}

.dossier-slot-icon {
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 0.9rem;
}

.dossier-slot-card:hover .dossier-slot-icon {
    opacity: 1;
    color: var(--accent-secondary);
}

/* Open Claim Station Button */
.btn-claim-station {
    width: 100%;
    background: var(--accent-secondary);
    color: white;
    font-family: var(--font-hud);
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px;
    border: none;
    border-radius: 4px;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
    transition: transform 0.2s;
}

.btn-claim-station:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.4);
}

/* === DOSSIER THEME OVERRIDES FOR TEXT PAGES (About, How-To-Play) === */
[data-theme="dossier"] .guide-title,
[data-theme="dossier"] .protocol-title,
[data-theme="dossier"] h1,
[data-theme="dossier"] h2,
[data-theme="dossier"] .btn-back {
    color: var(--text-primary) !important;
    /* Dark text */
    text-shadow: none !important;
    background: none !important;
    /* Remove gradient text */
    -webkit-text-fill-color: var(--text-primary) !important;
}

[data-theme="dossier"] .guide-subtitle,
[data-theme="dossier"] .protocol-subtitle {
    color: var(--text-secondary) !important;
}

[data-theme="dossier"] .guide-section,
[data-theme="dossier"] .protocol-section {
    background: rgba(255, 255, 255, 0.95) !important;
    /* Light ceramic look */
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="dossier"] .guide-section h2,
[data-theme="dossier"] .guide-section h3,
[data-theme="dossier"] .guide-section strong,
[data-theme="dossier"] .protocol-section h2,
[data-theme="dossier"] .protocol-section h3,
[data-theme="dossier"] .protocol-section strong {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-subtle);
}

[data-theme="dossier"] .guide-section p,
[data-theme="dossier"] .guide-section li,
[data-theme="dossier"] .protocol-section p,
[data-theme="dossier"] .protocol-section li {
    color: var(--text-secondary) !important;
}

[data-theme="dossier"] .guide-highlight {
    background: rgba(0, 0, 0, 0.05) !important;
    border-left-color: var(--primary-accent);
    color: var(--text-primary) !important;
}

[data-theme="dossier"] table,
[data-theme="dossier"] th,
[data-theme="dossier"] td {
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

/* === TRAIT INFLUENCE GUIDE & FACTIONS (Dossier Theme) === */
[data-theme="dossier"] .tig-wrapper,
[data-theme="dossier"] .tig-content {
    background: transparent !important;
    background-image: none !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
    border: none !important;
}

[data-theme="dossier"] .tig-wrapper::before {
    display: none !important;
}

[data-theme="dossier"] .tig-title {
    background: none !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

[data-theme="dossier"] .tig-subtitle,
[data-theme="dossier"] .tig-guidance,
[data-theme="dossier"] .tig-panel-header,
[data-theme="dossier"] .tig-tier-cue,
[data-theme="dossier"] .tig-neutral-title {
    color: var(--text-primary) !important;
}

[data-theme="dossier"] .tig-panel-header {
    border-bottom-color: var(--border-subtle) !important;
}

[data-theme="dossier"] .tig-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
}

[data-theme="dossier"] .tig-card-title,
[data-theme="dossier"] .tig-card-style,
[data-theme="dossier"] .tig-card-influences,
[data-theme="dossier"] .tig-card-influences strong {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

[data-theme="dossier"] .faction-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="dossier"] .faction-name,
[data-theme="dossier"] .faction-code {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

[data-theme="dossier"] .stat-label,
[data-theme="dossier"] .stat-value,
[data-theme="dossier"] .faction-lore {
    color: var(--text-primary) !important;
}

[data-theme="dossier"] .stat-track {
    background: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="dossier"] .tig-legend-item {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: var(--border-subtle) !important;
}
/* === FOOTER OVERRIDES FOR DOSSIER === */
[data-theme="dossier"] .system-footer {
    background: #fff;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
}

[data-theme="dossier"] .footer-left a {
    color: var(--text-secondary);
}

[data-theme="dossier"] .footer-left a:hover {
    color: var(--accent-secondary);
}

[data-theme="dossier"] .system-caution {
    color: var(--accent-secondary); /* Purple for caution in Dossier? Or stick to orange? User said match styling. */
    /* Let's stick to Orange/Warning for 'Caution' generally, but maybe darker for visibility on light bg */
    color: #e67e22; 
}
/* Invert logo for light mode if it's white-only svg */
[data-theme="dossier"] .footer-brand-logo {
    filter: invert(1) brightness(0.2); 
}
