/* ============================================================================
   LOREBENCH DOSSIER THEME
   ============================================================================
   80s/90s Detective Case File aesthetic. Manila folders, typewriter text,
   cork boards, polaroids, coffee stains, and red string connecting the clues.
   "The truth is in the evidence..."
   ============================================================================ */

:root[data-theme="dossier"] {
    /* Paper and folder colors */
    --dos-paper: #f4e4bc;
    --dos-paper-dark: #d4c4a0;
    --dos-manila: #e8d4a8;
    --dos-manila-dark: #c8b488;
    --dos-cork: #a67c52;
    --dos-cork-dark: #8b6542;

    /* Ink colors */
    --dos-ink: #2c2416;
    --dos-ink-faded: #5c4a36;
    --dos-ink-light: #7c6a56;

    /* Accent colors */
    --dos-red: #8b0000;
    --dos-red-light: #a52a2a;
    --dos-green: #2a6e2a;
    --dos-blue: #a0c4e8;

    /* Decorative colors */
    --dos-polaroid: #f5f5f0;
    --dos-tape: rgba(255, 245, 200, 0.7);
    --dos-coffee: rgba(101, 67, 33, 0.15);
    --dos-sticky: #fff740;
    --dos-paperclip: #888888;

    /* PRIMARY ACCENT COLOR - classic red ink */
    --lb-accent-primary: var(--dos-red);
    --lb-accent-primary-light: var(--dos-red-light);
    --lb-accent-primary-dark: #6b0000;
    --lb-accent-primary-darker: #4b0000;

    /* BACKGROUND COLORS - desk/cork board surface */
    --lb-bg-base: #5c4a36;
    --lb-bg-elevated: var(--dos-manila);
    --lb-bg-elevated-1: var(--dos-paper);
    --lb-bg-elevated-2: var(--dos-paper-dark);
    --lb-bg-elevated-3: var(--dos-manila-dark);
    --lb-bg-input: #fff8e8;
    --lb-bg-hover: rgba(139, 0, 0, 0.08);
    --bg-tertiary: var(--dos-manila);
    --bg-primary: var(--dos-paper);

    /* BORDER COLORS */
    --lb-border-subtle: var(--dos-ink-light);
    --lb-border-default: var(--dos-ink-faded);
    --lb-border-strong: var(--dos-ink);
    --lb-border-focus: var(--dos-red);

    /* TEXT COLORS - typewriter ink */
    --lb-text-primary: var(--dos-ink);
    --lb-text-secondary: var(--dos-ink-faded);
    --lb-text-muted: var(--dos-ink-light);
    --lb-text-subtle: #9c8a76;
    --lb-text-inverse: var(--dos-paper);

    /* STATE COLORS */
    --lb-success: var(--dos-green);
    --lb-error: var(--dos-red);
    --lb-error-bg: #f4e0e0;
    --lb-error-border: #d4a0a0;
    --lb-warning: #cc8800;
    --lb-info: #4a6e8a;

    /* COMPONENT-SPECIFIC */
    --lb-card-bg: var(--dos-paper);
    --lb-card-border: var(--dos-ink-faded);
    --lb-card-header-bg: linear-gradient(180deg, var(--dos-manila) 0%, var(--dos-manila-dark) 100%);

    /* INTERACTIVE ELEMENTS */
    --lb-button-primary-bg: var(--dos-red);
    --lb-button-primary-hover: var(--dos-red-light);
    --lb-button-primary-text: var(--dos-paper);
    --lb-button-secondary-bg: var(--dos-paper-dark);
    --lb-button-secondary-hover: var(--dos-manila);
    --lb-button-secondary-text: var(--dos-ink);

    /* RATING SYSTEM */
    --lb-rating-fill: var(--dos-red);
    --lb-rating-empty: var(--dos-paper-dark);
    --lb-rating-hover: var(--dos-red-light);

    /* SHADOWS - paper stack effect */
    --lb-shadow-sm: 2px 2px 4px rgba(0, 0, 0, 0.2);
    --lb-shadow-md: 3px 3px 8px rgba(0, 0, 0, 0.25);
    --lb-shadow-lg: 5px 5px 15px rgba(0, 0, 0, 0.3);

    /* ========================================================================
       BACKWARDS COMPATIBILITY MAPPINGS
       ======================================================================== */
    --primary-color: var(--dos-red);
    --primary-hover: var(--dos-red-light);
    --bg-secondary: var(--dos-manila);
    --bg-card: var(--dos-paper);
    --bg-hover: var(--lb-bg-hover);
    --border-color: var(--lb-border-default);
    --text-primary: var(--lb-text-primary);
    --text-secondary: var(--lb-text-secondary);
    --text-muted: var(--lb-text-muted);

    /* UX Component Mappings */
    --ux-bg: var(--lb-bg-base);
    --ux-text: var(--lb-text-primary);
}

/* ============================================================================
   DOSSIER SPECIFIC STYLING
   ============================================================================ */

/* Wooden desk surface background */
:root[data-theme="dossier"] body {
    background: #4a3728;
    background-image:
        /* Wood grain texture */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(0, 0, 0, 0.02) 50px,
            rgba(0, 0, 0, 0.02) 100px
        ),
        linear-gradient(180deg, #5a4738 0%, #3a2718 100%);
}

/* Main layout as open case file folder on desk */
:root[data-theme="dossier"] .ww-layout {
    background: var(--dos-paper);
    min-height: 100vh;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 100px rgba(0, 0, 0, 0.03);
    position: relative;
    margin: 0 auto;
    border-left: 15px solid var(--dos-manila);
    border-right: 3px solid var(--dos-manila-dark);
}

/* Folder tab at top */
:root[data-theme="dossier"] .ww-layout::before {
    content: 'CASE FILE';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dos-manila);
    padding: 4px 30px 8px 30px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 3px;
    color: var(--dos-ink);
    border: 2px solid var(--dos-ink-faded);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Paper texture overlay */
:root[data-theme="dossier"] .ww-layout::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* Typewriter font for most text */
:root[data-theme="dossier"] body {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.5px;
}

/* Cards look like paper documents */
:root[data-theme="dossier"] .ux-card,
:root[data-theme="dossier"] .collapsible-section,
:root[data-theme="dossier"] .infobox {
    background: var(--dos-paper);
    border: none;
    border-radius: 0;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.25);
    position: relative;
}

/* Slight rotation for organic feel */
:root[data-theme="dossier"] .ux-card:nth-child(odd) {
    transform: rotate(-0.5deg);
}

:root[data-theme="dossier"] .ux-card:nth-child(even) {
    transform: rotate(0.5deg);
}

:root[data-theme="dossier"] .ux-card:hover,
:root[data-theme="dossier"] .collapsible-section:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
}

/* Buttons look like stamps or labels */
:root[data-theme="dossier"] .btn,
:root[data-theme="dossier"] button {
    background: var(--dos-paper-dark);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
    color: var(--dos-ink);
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

:root[data-theme="dossier"] .btn:hover,
:root[data-theme="dossier"] button:hover {
    background: var(--dos-manila);
    border-color: var(--dos-ink);
    transform: translateY(-1px);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dossier"] .btn:active,
:root[data-theme="dossier"] button:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Primary buttons look like red stamps */
:root[data-theme="dossier"] .btn-primary,
:root[data-theme="dossier"] .ww-btn-create {
    background: var(--dos-red);
    border: 2px solid var(--dos-red);
    color: var(--dos-paper);
}

:root[data-theme="dossier"] .btn-primary:hover,
:root[data-theme="dossier"] .ww-btn-create:hover {
    background: var(--dos-red-light);
    border-color: var(--dos-red-light);
}

/* Inputs look like form fields */
:root[data-theme="dossier"] input,
:root[data-theme="dossier"] textarea,
:root[data-theme="dossier"] select,
:root[data-theme="dossier"] .form-control {
    background: #fff8e8;
    border: none;
    border-bottom: 2px solid var(--dos-ink-faded);
    border-radius: 0;
    color: var(--dos-ink);
    font-family: 'Courier New', Courier, monospace;
    padding: 8px 4px;
}

:root[data-theme="dossier"] input::placeholder,
:root[data-theme="dossier"] textarea::placeholder {
    color: var(--dos-ink-light);
    font-style: italic;
}

:root[data-theme="dossier"] input:focus,
:root[data-theme="dossier"] textarea:focus,
:root[data-theme="dossier"] select:focus {
    border-bottom-color: var(--dos-red);
    outline: none;
    background: #fffef8;
}

/* Links look like handwritten annotations */
:root[data-theme="dossier"] a {
    color: var(--dos-red);
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 2px;
}

:root[data-theme="dossier"] a:hover {
    color: var(--dos-red-light);
    text-decoration-style: solid;
}

/* Logo as case file header */
:root[data-theme="dossier"] .ww-logo {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dos-ink);
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

/* Header bar as folder tab */
:root[data-theme="dossier"] .ww-topbar {
    background: var(--dos-manila);
    border-bottom: 3px solid var(--dos-ink-faded);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Folder tab effect */
:root[data-theme="dossier"] .ww-topbar::before {
    content: 'CASE FILE';
    position: absolute;
    top: -20px;
    left: 40px;
    background: var(--dos-manila);
    padding: 4px 20px;
    border-radius: 8px 8px 0 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: bold;
    color: var(--dos-ink);
    letter-spacing: 2px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Navigation links */
:root[data-theme="dossier"] .ww-nav-link {
    color: var(--dos-ink-faded);
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
}

:root[data-theme="dossier"] .ww-nav-link:hover {
    color: var(--dos-red);
    background: rgba(139, 0, 0, 0.08);
}

:root[data-theme="dossier"] .ww-nav-link.active {
    color: var(--dos-red);
    border-bottom: 2px solid var(--dos-red);
}

/* Badges look like evidence tags */
:root[data-theme="dossier"] .pillar-badge,
:root[data-theme="dossier"] .badge,
:root[data-theme="dossier"] .collapsible-count {
    background: var(--dos-red);
    color: var(--dos-paper);
    border-radius: 0;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 8px;
}

/* Section headers look like typewritten labels */
:root[data-theme="dossier"] h1,
:root[data-theme="dossier"] h2,
:root[data-theme="dossier"] h3,
:root[data-theme="dossier"] h4,
:root[data-theme="dossier"] h5,
:root[data-theme="dossier"] h6 {
    font-family: 'Courier New', Courier, monospace;
    color: var(--dos-ink);
    letter-spacing: 1px;
    text-transform: uppercase;
}

:root[data-theme="dossier"] h1,
:root[data-theme="dossier"] h2 {
    border-bottom: 2px solid var(--dos-ink);
    padding-bottom: 8px;
    display: inline-block;
}

/* Collapsible sections as file folders */
:root[data-theme="dossier"] .collapsible-header {
    background: linear-gradient(180deg, var(--dos-manila) 0%, var(--dos-manila-dark) 100%);
    border-bottom: 1px solid var(--dos-ink-faded);
}

:root[data-theme="dossier"] .collapsible-header:hover {
    background: linear-gradient(180deg, var(--dos-paper) 0%, var(--dos-manila) 100%);
}

:root[data-theme="dossier"] .collapsible-title {
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dos-ink);
}

/* Tables as evidence logs */
:root[data-theme="dossier"] table,
:root[data-theme="dossier"] .table {
    background: var(--dos-paper);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
}

:root[data-theme="dossier"] th {
    background: var(--dos-manila);
    color: var(--dos-ink);
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--dos-ink);
}

:root[data-theme="dossier"] td {
    border-bottom: 1px solid var(--dos-ink-light);
    color: var(--dos-ink);
}

:root[data-theme="dossier"] tr:hover td {
    background: rgba(139, 0, 0, 0.05);
}

/* Entity cards as index cards */
:root[data-theme="dossier"] .entity-card,
:root[data-theme="dossier"] .ux-entity-card {
    background: linear-gradient(
        var(--dos-paper) 0px,
        var(--dos-paper) 24px,
        var(--dos-blue) 24px,
        var(--dos-blue) 25px,
        var(--dos-paper) 25px
    );
    background-size: 100% 25px;
    border: none;
    border-radius: 0;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
    padding-top: 28px;
}

:root[data-theme="dossier"] .entity-card:hover,
:root[data-theme="dossier"] .ux-entity-card:hover {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3);
}

/* Footer as document stamp */
:root[data-theme="dossier"] .ww-footer {
    background: var(--dos-manila-dark);
    border-top: 2px solid var(--dos-ink-faded);
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dos-ink-faded);
}

/* Search input */
:root[data-theme="dossier"] .ww-search-input {
    background: #fff8e8;
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
    font-family: 'Courier New', Courier, monospace;
}

:root[data-theme="dossier"] .ww-search-input:focus {
    border-color: var(--dos-red);
}

/* Theme switcher */
:root[data-theme="dossier"] .ww-theme-toggle {
    background: var(--dos-paper-dark);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
}

:root[data-theme="dossier"] .ww-theme-menu {
    background: var(--dos-paper);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dossier"] .ww-theme-item {
    color: var(--dos-ink-faded);
    font-family: 'Courier New', Courier, monospace;
}

:root[data-theme="dossier"] .ww-theme-item:hover,
:root[data-theme="dossier"] .ww-theme-item.active {
    background: var(--dos-manila);
    color: var(--dos-red);
}

/* Scrollbars - subtle leather/paper look */
:root[data-theme="dossier"] ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

:root[data-theme="dossier"] ::-webkit-scrollbar-track {
    background: var(--dos-manila-dark);
}

:root[data-theme="dossier"] ::-webkit-scrollbar-thumb {
    background: var(--dos-ink-light);
    border: 2px solid var(--dos-manila-dark);
}

:root[data-theme="dossier"] ::-webkit-scrollbar-thumb:hover {
    background: var(--dos-ink-faded);
}

/* Selection */
:root[data-theme="dossier"] ::selection {
    background: var(--dos-red);
    color: var(--dos-paper);
}

/* ============================================================================
   MODAL STYLING - Case File Folders
   ============================================================================ */

:root[data-theme="dossier"] .rp-overlay,
:root[data-theme="dossier"] .aem-overlay,
:root[data-theme="dossier"] .uxdesc-modal-overlay,
:root[data-theme="dossier"] .stat-modal-overlay {
    background: rgba(92, 74, 54, 0.9);
}

:root[data-theme="dossier"] .rp-modal,
:root[data-theme="dossier"] .aem-modal-wide,
:root[data-theme="dossier"] .uxdesc-modal,
:root[data-theme="dossier"] .stat-modal {
    background: var(--dos-manila);
    border: none;
    border-radius: 0;
    box-shadow: 8px 8px 24px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dossier"] .rp-header,
:root[data-theme="dossier"] .aem-header,
:root[data-theme="dossier"] .stat-modal-header {
    background: linear-gradient(180deg, var(--dos-manila) 0%, var(--dos-manila-dark) 100%);
    border-bottom: 2px solid var(--dos-ink-faded);
}

:root[data-theme="dossier"] .rp-title,
:root[data-theme="dossier"] .aem-title,
:root[data-theme="dossier"] .stat-modal-title {
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--dos-ink);
}

:root[data-theme="dossier"] .rp-body,
:root[data-theme="dossier"] .aem-body,
:root[data-theme="dossier"] .stat-modal-body {
    background: var(--dos-paper);
}

:root[data-theme="dossier"] .rp-footer,
:root[data-theme="dossier"] .aem-footer,
:root[data-theme="dossier"] .stat-modal-footer {
    background: var(--dos-manila-dark);
    border-top: 2px solid var(--dos-ink-faded);
}

/* ============================================================================
   DECORATIVE OVERLAY ELEMENTS
   ============================================================================ */

/* Paper clip decoration - positioned on elements */
.dos-paperclip {
    position: absolute;
    width: 20px;
    height: 50px;
    border: 3px solid #888;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    z-index: 100;
    pointer-events: none;
    top: -15px;
    left: 20px;
}

.dos-paperclip::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 3px;
    width: 8px;
    height: 30px;
    border: 2px solid #888;
    border-radius: 5px 5px 0 0;
    border-bottom: none;
}

/* Coffee stain decoration */
.dos-coffee-stain {
    position: fixed;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, transparent 30%, var(--dos-coffee) 50%, transparent 70%);
    pointer-events: none;
    z-index: 99;
}

/* Tape decoration */
.dos-tape {
    position: fixed;
    width: 60px;
    height: 20px;
    background: var(--dos-tape);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 100;
}

/* Stamp decorations */
.dos-stamp {
    position: fixed;
    border: 3px solid var(--dos-red);
    border-radius: 4px;
    padding: 6px 16px;
    color: var(--dos-red);
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 100;
}

.dos-stamp-active {
    border-width: 4px;
    opacity: 0.85;
    box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.1);
}

.dos-stamp-classified {
    font-size: 11px;
    padding: 3px 10px;
    border-width: 2px;
    opacity: 0.6;
    color: var(--dos-ink-faded);
    border-color: var(--dos-ink-faded);
}

/* Red pushpin decoration - used on cards */
.dos-pushpin {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, #ff4444 0%, #cc0000 50%, #880000 100%);
    border-radius: 50%;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none;
}

.dos-pushpin::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}

/* Red string (for cork board sections) */
.dos-red-string {
    position: absolute;
    height: 2px;
    background: #cc0000;
    transform-origin: left center;
    opacity: 0.6;
    pointer-events: none;
    z-index: 50;
}

/* ============================================================================
   HOME PAGE DOSSIER STYLING
   ============================================================================ */

/* Hero section */
:root[data-theme="dossier"] .hero {
    background: var(--dos-manila);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
    position: relative;
}

:root[data-theme="dossier"] .hero h1 {
    font-family: 'Times New Roman', Times, serif;
    color: var(--dos-ink);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 2.5rem;
    border-bottom: none;
    display: block;
}

:root[data-theme="dossier"] .hero-subtitle {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
    font-size: 1rem;
    font-style: italic;
}

/* Quick stats */
:root[data-theme="dossier"] .stat-card {
    background: var(--dos-paper);
    border: 1px solid var(--dos-ink-light);
    border-radius: 0;
}

:root[data-theme="dossier"] .stat-value {
    color: var(--dos-red);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

:root[data-theme="dossier"] .stat-label {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dos-ink-faded);
}

:root[data-theme="dossier"] .stat-card.create-card {
    background: linear-gradient(135deg, var(--dos-manila) 0%, var(--dos-paper) 100%);
    border-color: var(--dos-red);
}

/* Section headers */
:root[data-theme="dossier"] .section-header {
    border-bottom: 2px solid var(--dos-ink);
    padding-bottom: 0.5rem;
}

:root[data-theme="dossier"] .section-title {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Featured banner */
:root[data-theme="dossier"] .featured-banner {
    background: var(--dos-manila);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
    position: relative;
}

:root[data-theme="dossier"] .featured-banner::before {
    content: 'PRIORITY';
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--dos-red);
    color: var(--dos-paper);
    padding: 2px 12px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 5;
}

:root[data-theme="dossier"] .featured-tag {
    font-family: 'Courier New', monospace;
    color: var(--dos-red);
}

:root[data-theme="dossier"] .featured-title {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink);
    text-transform: uppercase;
}

:root[data-theme="dossier"] .featured-desc {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
}

:root[data-theme="dossier"] .featured-image {
    background: var(--dos-paper-dark);
    border-left: 2px solid var(--dos-ink-faded);
}

/* Universe and content cards as polaroids/documents */
:root[data-theme="dossier"] .universe-card,
:root[data-theme="dossier"] .content-card {
    background: var(--dos-paper);
    border: none;
    border-radius: 0;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.25);
    padding-top: 12px;
}

:root[data-theme="dossier"] .universe-card:hover,
:root[data-theme="dossier"] .content-card:hover {
    transform: translateY(-4px) rotate(0deg);
}

:root[data-theme="dossier"] .universe-hero,
:root[data-theme="dossier"] .content-hero {
    background: var(--dos-paper-dark);
    border-bottom: 2px solid var(--dos-ink-faded);
}

:root[data-theme="dossier"] .universe-hero::after,
:root[data-theme="dossier"] .content-hero::after {
    background: linear-gradient(to top, rgba(244, 228, 188, 0.9), transparent);
}

:root[data-theme="dossier"] .universe-name,
:root[data-theme="dossier"] .content-title {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink);
    text-transform: uppercase;
}

:root[data-theme="dossier"] .universe-creator {
    font-family: 'Courier New', monospace;
    font-style: italic;
    color: var(--dos-ink-faded);
}

:root[data-theme="dossier"] .universe-desc,
:root[data-theme="dossier"] .content-desc {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
}

:root[data-theme="dossier"] .content-type {
    font-family: 'Courier New', monospace;
    color: var(--dos-red);
    border: 1px solid var(--dos-red);
    padding: 1px 6px;
    display: inline-block;
}

:root[data-theme="dossier"] .universe-stats,
:root[data-theme="dossier"] .content-stats {
    border-top: 1px dashed var(--dos-ink-light);
}

:root[data-theme="dossier"] .stat-num {
    color: var(--dos-red);
    font-family: 'Courier New', monospace;
}

:root[data-theme="dossier"] .stat-text {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
}

/* Navigation buttons as file tabs */
:root[data-theme="dossier"] .nav-btn {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid transparent;
    border-radius: 0;
}

:root[data-theme="dossier"] .nav-btn:hover,
:root[data-theme="dossier"] .nav-btn.active {
    background: var(--dos-manila);
    border-color: var(--dos-ink-faded);
    color: var(--dos-red);
}

/* Content section background (cork board effect) */
:root[data-theme="dossier"] .content-section {
    background: var(--dos-cork);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

:root[data-theme="dossier"] .content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.15;
    pointer-events: none;
}

:root[data-theme="dossier"] .content-section .section-header {
    background: var(--dos-manila);
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 2px solid var(--dos-ink);
}

:root[data-theme="dossier"] .content-section .section-title {
    color: var(--dos-ink);
}

:root[data-theme="dossier"] .content-section .section-title::before {
    content: '📁';
    margin-right: 8px;
}

/* Grid spacing adjustments for cork board */
:root[data-theme="dossier"] .universe-grid,
:root[data-theme="dossier"] .content-grid {
    gap: 2rem;
}

/* ============================================================================
   PROFILE PAGE DOSSIER STYLING
   ============================================================================ */

/* Profile page main container */
:root[data-theme="dossier"] .profile-page {
    margin-top: 80px;
}

/* Profile header as subject dossier */
:root[data-theme="dossier"] .profile-header-card {
    background: var(--dos-manila);
    border: 3px solid var(--dos-ink);
    border-radius: 0;
    position: relative;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dossier"] .profile-header-card::before {
    content: 'SUBJECT DOSSIER';
    position: absolute;
    top: -14px;
    left: 30px;
    background: var(--dos-manila);
    padding: 4px 16px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--dos-ink);
    border: 2px solid var(--dos-ink);
}

:root[data-theme="dossier"] .profile-header-card::after {
    content: 'ACTIVE';
    position: absolute;
    top: 20px;
    right: 30px;
    padding: 4px 12px;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--dos-red);
    border: 3px solid var(--dos-red);
    transform: rotate(-5deg);
    opacity: 0.8;
}

/* Avatar as mugshot photo */
:root[data-theme="dossier"] .avatar-box {
    border: 3px solid var(--dos-ink);
    border-radius: 0;
    background: var(--dos-paper);
    padding: 4px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dossier"] .avatar-box img,
:root[data-theme="dossier"] .avatar-placeholder {
    border-radius: 0;
}

:root[data-theme="dossier"] .avatar-placeholder {
    background: var(--dos-paper-dark);
    color: var(--dos-ink);
    font-family: 'Courier New', monospace;
}

/* Profile name as subject name */
:root[data-theme="dossier"] .header-info h1 {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: none;
    display: inline;
}

/* Stats as evidence summary */
:root[data-theme="dossier"] .stats-grid .stat-card {
    background: var(--dos-paper);
    border: 1px solid var(--dos-ink-light);
    border-radius: 0;
}

:root[data-theme="dossier"] .stats-grid .stat-card:hover {
    border-color: var(--dos-red);
    transform: translateY(-2px);
}

:root[data-theme="dossier"] .stats-grid .v {
    color: var(--dos-red);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

:root[data-theme="dossier"] .stats-grid .l {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
}

/* Bio as subject notes */
:root[data-theme="dossier"] .bio {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
    font-style: italic;
    padding: 8px;
    background: var(--dos-paper);
    border-left: 3px solid var(--dos-red);
}

/* Follow stats */
:root[data-theme="dossier"] .follow-stats {
    font-family: 'Courier New', monospace;
}

:root[data-theme="dossier"] .follow-stat strong {
    color: var(--dos-red);
}

/* User number badge */
:root[data-theme="dossier"] .user-number {
    font-family: 'Courier New', monospace;
    background: var(--dos-ink);
    color: var(--dos-paper);
    padding: 2px 8px;
    border-radius: 0;
}

/* Joined date */
:root[data-theme="dossier"] .joined-date {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
}

/* Tab navigation as file dividers */
:root[data-theme="dossier"] .tab-nav {
    background: var(--dos-manila-dark);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
}

:root[data-theme="dossier"] .tab-btn {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 0;
    color: var(--dos-ink-faded);
}

:root[data-theme="dossier"] .tab-btn:hover {
    background: var(--dos-manila);
    color: var(--dos-ink);
}

:root[data-theme="dossier"] .tab-btn.active {
    background: var(--dos-paper);
    color: var(--dos-red);
    border-bottom: 2px solid var(--dos-red);
}

/* Tab content as case files */
:root[data-theme="dossier"] .tab-content {
    background: var(--dos-paper);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
}

/* Badges styling */
:root[data-theme="dossier"] .badges-list {
    background: var(--dos-paper);
}

:root[data-theme="dossier"] .badge-card {
    background: var(--dos-manila);
    border: 1px solid var(--dos-ink-light);
    border-radius: 0;
}

/* ============================================================================
   ENTITY DETAILS PAGE DOSSIER STYLING
   ============================================================================ */

/* Main details shell */
:root[data-theme="dossier"] .ww-details-shell {
    position: relative;
}

/* Add SUBJECT line using page title - shows entity name */
:root[data-theme="dossier"] .ww-details-shell::before {
    content: 'SUBJECT: ' attr(data-subject);
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 8px 16px;
    margin-bottom: 1rem;
    background: var(--dos-manila);
    border-bottom: 2px solid var(--dos-ink);
    color: var(--dos-ink);
    letter-spacing: 1px;
}

/* PRIORITY stamp on details page */
:root[data-theme="dossier"] .ww-details-shell::after {
    content: 'PRIORITY';
    position: absolute;
    top: 10px;
    right: 20px;
    padding: 4px 14px;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--dos-red);
    border: 3px solid var(--dos-red);
    transform: rotate(-8deg);
    opacity: 0.75;
    z-index: 10;
    pointer-events: none;
}

/* Infobox card - the left column with image */
:root[data-theme="dossier"] .infobox {
    background: var(--dos-paper);
    border: 2px solid var(--dos-ink);
    border-radius: 0;
    position: relative;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.25);
}

/* Infobox header (entity type badge) */
:root[data-theme="dossier"] .infobox-pillar-badge {
    background: var(--dos-red);
    color: var(--dos-paper);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 0;
}

/* Entity hero image - slanted polaroid with paperclip */
:root[data-theme="dossier"] .infobox-hero {
    position: relative;
    background: var(--dos-paper);
    padding: 8px;
    border: 1px solid var(--dos-ink-light);
    transform: rotate(-2deg);
    margin: 10px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.3);
}

/* Paperclip on the image */
:root[data-theme="dossier"] .infobox-hero::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 15px;
    width: 18px;
    height: 45px;
    border: 3px solid #777;
    border-radius: 9px 9px 0 0;
    border-bottom: none;
    z-index: 20;
    transform: rotate(5deg);
}

:root[data-theme="dossier"] .infobox-hero::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 19px;
    width: 8px;
    height: 28px;
    border: 2px solid #777;
    border-radius: 5px 5px 0 0;
    border-bottom: none;
    z-index: 21;
    transform: rotate(5deg);
}

:root[data-theme="dossier"] .infobox-hero img {
    border-radius: 0;
}

/* Entity name styling */
:root[data-theme="dossier"] .infobox-name {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    border-bottom: 2px solid var(--dos-ink);
    padding-bottom: 4px;
}

/* Owner/creator info */
:root[data-theme="dossier"] .infobox-meta {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
    font-size: 0.85rem;
}

/* Attributes section */
:root[data-theme="dossier"] .infobox-attributes {
    border-top: 1px dashed var(--dos-ink-light);
}

:root[data-theme="dossier"] .infobox-attr-label {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-faded);
    text-transform: uppercase;
    font-size: 0.8rem;
}

:root[data-theme="dossier"] .infobox-attr-value {
    font-family: 'Courier New', monospace;
    color: var(--dos-red);
    font-weight: bold;
}

/* Summary card */
:root[data-theme="dossier"] .summary-card {
    background: var(--dos-paper);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
}

:root[data-theme="dossier"] .summary-text {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink);
    line-height: 1.6;
}

:root[data-theme="dossier"] .placeholder {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink-light);
    font-style: italic;
}

/* Collapsible sections (Attributes, Relationships) */
:root[data-theme="dossier"] .collapsible-section {
    background: var(--dos-paper);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
}

:root[data-theme="dossier"] .collapsible-header {
    background: var(--dos-manila);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

:root[data-theme="dossier"] .collapsible-title {
    color: var(--dos-ink);
}

:root[data-theme="dossier"] .collapsible-count {
    background: var(--dos-red);
    color: var(--dos-paper);
    border-radius: 0;
    font-family: 'Courier New', monospace;
}

/* UX Cards general styling */
:root[data-theme="dossier"] .ux-card {
    background: var(--dos-paper);
    border: 2px solid var(--dos-ink-faded);
    border-radius: 0;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dossier"] .ux-card-header {
    background: var(--dos-manila);
    border-bottom: 2px solid var(--dos-ink-faded);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

:root[data-theme="dossier"] .ux-card-title {
    color: var(--dos-ink);
}

/* Description section */
:root[data-theme="dossier"] .ux-description {
    font-family: 'Courier New', monospace;
    color: var(--dos-ink);
    line-height: 1.7;
}

/* Media gallery */
:root[data-theme="dossier"] .media-gallery-grid {
    gap: 1rem;
}

:root[data-theme="dossier"] .media-item {
    background: var(--dos-paper);
    border: 3px solid var(--dos-paper);
    border-radius: 0;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
    transform: rotate(var(--rotation, 0deg));
}

:root[data-theme="dossier"] .media-item:nth-child(odd) {
    --rotation: -1.5deg;
}

:root[data-theme="dossier"] .media-item:nth-child(even) {
    --rotation: 1.5deg;
}

:root[data-theme="dossier"] .media-item:hover {
    transform: rotate(0deg) scale(1.02);
}
