/* General Setup & NEW Color Palette */
:root {
    --background: #1e2124;
    --window-bg: #282c34;
    --titlebar-bg: #3a3f4b;
    --text-color: #dcdfe4;
    --highlight: #81a1c1; /* Muted accent blue */
    --paper-bg: #dcd8d0;
    --paper-text: #2e3440;
    --status-active-color: #d08770; /* Muted orange for status */
}

body {
    background-color: var(--background);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    margin: 0;
}

/* NEW: Grain overlay for the entire screen */
body::after {
    content: "";
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39tbW1paWhzc3NQEAAAAFVJREFUeNpiYGBhMGAwYJBMAggZgSgYGEzADwYBGMAR3QdFtBPODAAAAAElFTkSuQmCC');
    animation: grain 8s steps(10) infinite;
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}


.hidden { display: none !important; }

/* Boot Sequence */
#boot-sequence { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; animation: fadeIn 1s ease-in; }
#boot-logo { width: 120px; animation: pulse 2s infinite ease-in-out; filter: grayscale(50%) opacity(0.8); }
#boot-text { margin-top: 20px; font-family: 'Courier New', monospace; letter-spacing: 1px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.03); opacity: 1; } }

/* OS Container & Background */
#os-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: url('closedsys.png') no-repeat center center;
    background-size: cover;
    position: relative;
}

/* Taskbar */
#taskbar { position: fixed; bottom: 0; left: 0; right: 0; height: 40px; background-color: rgba(30, 33, 36, 0.7); backdrop-filter: blur(5px); border-top: 1px solid #434c5e; display: flex; align-items: center; padding: 0 10px; justify-content: space-between; }
#start-button { padding: 5px; cursor: pointer; }
#start-button img { height: 30px; filter: grayscale(80%) opacity(0.7); }
#taskbar-clock { font-size: 14px; font-weight: 500; }

/* Desktop & Icons */
#desktop { flex-grow: 1; padding: 20px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 20px; }
.desktop-icon { width: 90px; text-align: center; cursor: pointer; filter: drop-shadow(0 0 3px rgba(0,0,0,0.5)); }
.desktop-icon img { width: 50px; height: 50px; }
.desktop-icon span { display: block; font-size: 13px; color: white; text-shadow: 1px 1px 3px black; margin-top: 8px; word-wrap: break-word; }

/* Window Styling */
.window { position: absolute; width: min(850px, 85vw); height: 85vh; background-color: var(--window-bg); border: 1px solid #434c5e; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: flex; flex-direction: column; top: 50px; left: 100px; resize: both; overflow: hidden; }
.title-bar { height: 32px; background-color: var(--titlebar-bg); display: flex; flex-direction: column; justify-content: center; padding: 0 10px; cursor: move; border-bottom: 1px solid #434c5e; flex-shrink: 0; }
.title-bar-main { display: flex; justify-content: space-between; align-items: center; }
.title-bar-text { font-weight: 600; font-size: 14px; }
.title-bar-path { font-size: 11px; color: #8893a7; font-family: 'Courier New', monospace; margin-top: -2px; }
.title-bar-controls button { background: none; border: none; color: var(--text-color); font-size: 18px; cursor: pointer; padding: 0 5px; opacity: 0.7; }
.title-bar-controls button:hover { opacity: 1; }
.window-body { flex-grow: 1; padding: 10px; overflow-y: auto; }

/* Folder Window Content */
.folder-content { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 15px; padding: 10px; }
.folder-content .desktop-icon { width: 80px; }
.folder-content .desktop-icon span { color: var(--text-color); text-shadow: none; font-size: 12px; }

/* Scanned Document & Report Styling */
.report-document { background: var(--paper-bg); color: var(--paper-text); font-family: 'Times New Roman', Times, serif; padding: 30px 40px; margin: 10px auto; width: 95%; box-shadow: 0 0 10px rgba(0,0,0,0.2); border: 1px solid #c9c5bd; }
.report-header { display: flex; gap: 25px; border-bottom: 2px solid #a39e93; padding-bottom: 20px; margin-bottom: 20px; align-items: flex-start; }
.report-header img { border: 1px solid #b4b0a8; background: #c9c5bd; flex-shrink: 0; }
.report-info-table { border-collapse: collapse; width: 100%; }
.report-info-table td { border: 1px solid #b4b0a8; padding: 8px; font-size: 14px; }
.report-info-table td:first-child { font-weight: bold; background-color: #d1ccc1; width: 100px; }
.report-body { font-size: 16px; line-height: 1.7; font-family: 'Courier New', 'Lucida Console', monospace;}

/* Clickable Entities - UPDATED STYLE */
.clickable-org, .clickable-person, .clickable-incident {
    background-color: transparent;
    color: #4c566a; /* Darker blue for read text */
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #4c566a;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.clickable-org:hover, .clickable-person:hover, .clickable-incident:hover {
    background-color: rgba(129, 161, 193, 0.15);
    color: var(--highlight);
    text-decoration-color: var(--highlight);
}
.redacted { background-color: #000; color: #000; padding: 0 5px; user-select: none; border: 1px dashed #333;}

/* HUD Panel Styling - UPDATED COLORS */
.hud-panel { position: absolute; background-color: rgba(30, 33, 36, 0.7); backdrop-filter: blur(5px); border: 1px solid #434c5e; border-radius: 4px; padding: 10px 15px; font-family: 'Courier New', monospace; font-size: 13px; color: #9aa1ad; width: 250px; }
.hud-panel h4 { margin: 0 0 10px 0; color: var(--highlight); border-bottom: 1px solid #434c5e; padding-bottom: 5px; font-weight: normal; }
.hud-panel p { margin: 5px 0; }
.hud-panel strong { color: var(--text-color); font-weight: normal;}
.hud-panel .status-active { color: var(--status-active-color); font-weight: bold; }
.top-right { top: 20px; right: 20px; }
.bottom-left { bottom: 60px; left: 20px; }