/* --- Global Styles & User Aesthetic --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* background: linear-gradient(to bottom, #111, #000); */ /* Kept original black */
    background-color: #050505; /* Slightly off-black for less harshness */
    color: #00ffff; /* User's base cyan */
    font-family: 'Consolas', 'Menlo', 'Courier New', monospace; /* Monospace stack */
    font-size: 1.1em; /* Adjusted slightly from user's 1.2em for balance */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative; /* For pseudo-element overlay */
}

body::before {
    /* Pseudo-element for glitch/scanline effect - From User CSS */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0, 255, 255, 0.03) 2px, /* Slightly increased visibility */
        rgba(0, 255, 255, 0.03) 4px
    ); /* Subtle cyan scanlines */
    opacity: 0.5; /* Adjusted opacity */
    pointer-events: none; /* Make sure it doesn't interfere with clicks */
    z-index: -1; /* Ensure it's behind content */
}

a {
    color: #7fdbff; /* Light cyan/blue from generated */
    text-decoration: none;
}

a:hover {
    color: #ffffff;
    text-decoration: underline;
}

img {
    /* Combined styles */
    max-width: 100%;
    height: auto;
    display: block; /* From generated */
    box-shadow: 0 0 0.2em rgba(255, 255, 255, 0.2) inset; /* From user */
    border: 1px solid #444; /* From user */
    border-radius: 3px; /* From user */
}

small {
    font-size: 0.85em;
}

/* --- Header Styles - Primarily from User CSS --- */
#header {
    background-color: #111111;
    padding: 0; /* Let container handle padding */
    position: relative;
    margin-bottom: 0.5em;
    border-bottom: 1px solid #333; /* Added subtle border */
}

.header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5em 1em; /* Adjusted padding */
    max-width: 1200px; /* Center content */
    margin: 0 auto; /* Center content */
}

.logo-container {
    flex: 0 0 auto;
    /* max-width: 90px; */ /* Let image size dictate */
    margin-right: 1em;
}

.logo-image {
    max-height: 50px; /* Adjusted from user's 68px */
    width: auto; /* Maintain aspect ratio */
    margin-left: 1px;
    border: none; /* Override general img border */
    box-shadow: none; /* Override general img shadow */
}

.nav-container {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1em; /* Increased gap */
    padding: 0.5em 0; /* Padding only top/bottom */
    /* Keep user's background */
    background-image: url("/images/vortex0b.gif"); /* Path from user css */
    background-repeat: repeat-x;
    background-position: top center;
    min-height: 40px; /* Ensure space for GIF */
}

.nav-container select, /* Style the select menu */
.nav-container .site-menu { /* Apply to our specific ID too */
    background-color: #222; /* Darker background */
    color: #ccc; /* Lighter text */
    border: 1px solid #444; /* Subtle border */
    padding: 6px 10px; /* Adjusted padding */
    border-radius: 3px; /* Consistent radius */
    font-family: inherit;
    min-width: 150px;
    cursor: pointer;
}
.nav-container .site-menu:focus {
    outline: 1px solid #7fdbff;
    box-shadow: 0 0 5px rgba(127, 219, 255, 0.5); /* Glow on focus */
}

/* Button styles if needed in nav - from User CSS */
.nav-container .button {
    background-color: #555;
    color: #fff;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid #777;
}
.nav-container .button:hover {
    background-color: #777;
}

.header-message {
    /* Keep user's background */
    background-image: url("/images/thin_horizontal_lines.gif"); /* Path from user css */
    background-position: 40px 0px;
    background-repeat: repeat-x;
    color: #99ffff; /* User's color */
    padding: 0.4em 1em; /* Adjusted padding */
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-align: center; /* Center text */
    border-top: 1px dashed #444; /* Add separator */
}

.header-message small {
    white-space: nowrap;
    overflow: hidden;
    display: inline-block; /* Ensure it centers correctly */
}

/* --- Main Layout - Using New Structure --- */
.main-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto; /* Center content */
    padding: 0 1em; /* Consistent padding */
    gap: 20px; /* Space between sidebar and content */
    min-height: calc(100vh - 200px); /* Adjust based on header/footer height */
}

/* --- Sidebar --- */
.sidebar {
    width: 30%; /* Adjusted width */
    flex-shrink: 0;
    /* background-color: #202020; */ /* User's color - Apply if needed, current body bg might suffice */
    padding: 1em;
    border: 1px solid #222; /* Subtle border */
    background-color: rgba(16, 16, 16, 0.7); /* Slightly transparent dark bg */
    backdrop-filter: blur(2px); /* Optional: blur background behind sidebar */

}

.cryptic-text {
    color: #7fdbff; /* Cyan */
    margin-bottom: 20px;
    padding: 10px;
    border: 1px dashed #333; /* Subtle border */
    line-height: 1.4;
    word-wrap: break-word;
    background-color: rgba(0, 0, 0, 0.3); /* Darker background for text */
}

/* --- Category Navigation Tree Styles --- */
.category-nav ul {
    list-style: none;
}

.category-nav .category-item {
    margin-bottom: 5px;
}

.category-nav .category-toggle,
.category-nav .category-link-main {
    display: block;
    padding: 8px 12px; /* Slightly more padding */
    background-color: rgba(34, 34, 34, 0.5); /* Semi-transparent dark */
    color: #cccccc; /* Light grey text */
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
    border-left: 3px solid transparent; /* For active state */
    border-radius: 2px;
}
.category-nav .category-link-main {
    cursor: pointer; /* Ensure main links also look clickable */
}

.category-nav .category-toggle:hover,
.category-nav .category-link-main:hover {
    background-color: rgba(51, 51, 51, 0.7);
    color: #ffffff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.5); /* Subtle white glow on hover */
}

/* Style for active category/link - Use Cyan Theme */
.category-nav .category-item.active > .category-toggle,
.category-nav .category-item.active > .category-link-main,
.category-nav .subcategory-list li a.active {
    background-color: rgba(0, 100, 100, 0.6); /* Darker cyan background */
    color: #e0ffff; /* Brighter cyan text */
    border-left-color: #00ffff; /* Bright cyan border */
    text-shadow: 0 0 5px #00ffff, 0 0 8px rgba(0, 255, 255, 0.5); /* Cyan glow */
}
.category-nav .subcategory-list li a.active:hover {
    background-color: rgba(0, 130, 130, 0.7); /* Slightly lighter on hover */
}

/* Toggle Icons (+/- or >/v) */
.category-item.has-children > .category-toggle::before {
    content: '[+] '; /* Collapsed state - more techy */
    display: inline-block;
    margin-right: 5px;
    font-weight: normal; /* Use normal weight */
    color: #777; /* Dimmer icon color */
    transition: color 0.2s ease;
}
.category-item.has-children.open > .category-toggle::before {
    content: '[-] '; /* Expanded state */
    color: #00ffff; /* Cyan when open */
}
.category-item.has-children > .category-toggle:hover::before {
    color: #ccc; /* Lighter icon on hover */
}
.category-item.has-children.open > .category-toggle:hover::before {
     color: #fff;
}


/* Subcategory List */
.subcategory-list {
    display: none; /* Hidden by default */
    padding-left: 25px; /* Indent subitems more */
    margin-top: 5px;
    border-left: 1px dotted #444; /* Dotted line */
    margin-left: 8px; /* Align better */
}

.category-item.open > .subcategory-list {
    display: block; /* Show when parent is open */
}

.subcategory-list li {
    margin-bottom: 3px;
}

.subcategory-list a {
    display: block;
    padding: 6px 10px;
    color: #aaaaaa; /* Slightly dimmer than main categories */
    transition: background-color 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
    border-left: 3px solid transparent; /* For active state */
    margin-left: -3px; /* Align border */
    border-radius: 2px;
    font-size: 0.95em; /* Slightly smaller */
}

.subcategory-list a:hover {
    background-color: rgba(51, 51, 51, 0.5);
    color: #eeeeee;
    text-decoration: none;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.4);
}

/* --- Content Area --- */
.content-area {
    flex: 1; /* Takes remaining space */
    padding: 1.5em; /* More padding */
    background-color: rgba(10, 10, 10, 0.8); /* User's color semi-transparent */
    border: 1px solid #222;
    backdrop-filter: blur(2px); /* Optional: blur background behind content */
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px; /* More space */
    width: 100%; /* Ensure it spans width */
}

#content-title {
    color: #e0ffff; /* Bright Cyan */
    font-size: 1.6em; /* Make title larger */
    font-weight: normal;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.6); /* Cyan glow */
}

.cloud-top-link {
    font-size: 0.75em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cloud-top-link:hover {
    color: #999;
}

/* Styling for content loaded into #content-body */
#content-body {
    color: #cccccc; /* Default text color for content */
}

#content-body h3 {
    color: #99ffff; /* Header color within content */
    margin-bottom: 0.8em;
    border-bottom: 1px dashed #333;
    padding-bottom: 0.3em;
}

#content-body p {
    margin-bottom: 1em;
    line-height: 1.7; /* Slightly more line height for readability */
}

#content-body ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1em;
}

#content-body li {
    margin-bottom: 8px;
    padding-left: 25px; /* Indent list items */
    position: relative;
}

#content-body li::before {
    content: '»'; /* Custom bullet */
    color: #00ffff; /* Bullet color - Bright Cyan */
    position: absolute;
    left: 5px; /* Adjust position */
    top: 1px;
    font-size: 1.1em;
    text-shadow: 0 0 3px #00ffff;
}

/* --- Footer Styles - From User CSS --- */
#fhft { /* Footer container ID from user css */
    display: flex;
    background: #0a0a0a; /* Slightly lighter than pure black */
    padding: 1em 1.5em; /* More padding */
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #333;
    max-width: 1200px; /* Center content */
    margin: 20px auto 0 auto; /* Spacing and centering */
}

#logo_nf { /* Footer logo ID from user css */
    margin: 0;
    padding: 0;
}

#logo_nf a span {
    color: #aaa; /* Dimmer color for footer logo */
    text-decoration: none;
    padding-right: 0.2em;
    font-weight: bold;
    transition: color 0.2s ease;
}
#logo_nf a:hover span {
    color: #fff;
}

#fhft nav { /* Footer nav container */
    display: flex;
    align-items: center;
}

#fhft ul { /* Footer nav list */
    display: flex;
    list-style-type: none;
    padding: 0;
    margin: 0;
    gap: 1em;
}

#fhft li a { /* Footer nav links */
    color: #888; /* Dimmer footer links */
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid #333;
    border-radius: 3px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

#fhft li a:hover {
    color: #fff;
    background-color: #222;
    border-color: #555;
}
#fhft li a .opt { /* Optional text styling */
     opacity: 0.7;
}


/* --- Text Rain Styles - From User CSS --- */
#text-rain-container {
    position: fixed; /* Fixed position to cover viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Hide raindrops that go out of bounds */
    pointer-events: none; /* Make it non-interactive */
    z-index: -2; /* Place behind body::before scanlines */
}

.raindrop {
    position: absolute; /* Position each raindrop */
    top: -50px; /* Start above the screen */
    white-space: nowrap;
    font-family: monospace;
    color: #00ffff; /* Cyan color */
    text-shadow: 0 0 3px #00ffff, 0 0 5px rgba(0, 255, 255, 0.5); /* Neon glow */
    opacity: 0; /* Start invisible */
    font-size: 1.1em; /* Size based on body font */
    animation: rain linear infinite;
    animation-delay: var(--delay); /* Use CSS variable for delay */
    animation-duration: var(--duration); /* Use CSS variable for duration */
    will-change: transform, opacity; /* Performance hint */
}

@keyframes rain {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
         opacity: 0.6; /* Fade in */
    }
    90% {
         opacity: 0.4; /* Start fading out */
    }
    100% {
        transform: translateY(105vh); /* Fall past the bottom */
        opacity: 0;
    }
}

/* --- Miscellaneous Styles --- */
::marker {
    /* Default browser marker styling often sufficient */
    /* unicode-bidi: isolate; */
    /* font-variant-numeric: tabular-nums; */
    /* text-transform: none; */
    /* text-indent: 0px !important; */
    /* text-align: start !important; */
    /* text-align-last: start !important; */
    /* Keep if specific marker styling is needed */
}

.splash-page { /* From User CSS */
    text-shadow: 0 0 0.1em #ff00ff, 0 0 0.2em #ff00ff, 0 0 0.3em #ff00ff; /* Magenta glow */
}

/* --- Removed/Replaced Styles --- */
/* #main, main, .content (Replaced by .main-container, .content-area) */
/* #categories-container (Replaced by .category-nav structure) */
/* #footer, .footer-container, .footer-logo, .footer-nav (Replaced by #fhft structure) */

/* In your main style.css, update or add these rules: */

/* Styling for content loaded into #content-body */
#content-body {
    color: #cccccc; /* Default text color for content - already set, good */
    line-height: 1.7; /* Ensure good line height */
}

#content-body h1, /* If essays can have their own H1 */
#content-body h2,
#content-body h3,
#content-body h4 { /* Extend to other heading levels if used */
    color: #00ffff; /* Main cyan for headings */
    font-weight: normal; /* Monospace often looks better without bold */
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5); /* Cyan glow */
    line-height: 1.3;
    margin-top: 1.8em;
    margin-bottom: 0.75em;
    padding-bottom: 0.3em;
    border-bottom: 1px dashed #333; /* Consistent border style */
}

#content-body h1 { /* Main title of the loaded essay */
    font-size: 1.6em; /* Match #content-title size from main page */
    margin-top: 0; /* No top margin if it's the first element */
}
#content-body h2 { font-size: 1.4em; }
#content-body h3 { font-size: 1.25em; } /* Your existing style for h3 is good */

#content-body p {
    /* color: #cccccc; is inherited */
    margin-bottom: 1.2em;
    text-align: left; /* Prefer left-align for readability over justify in monospace */
    /* line-height: 1.7; is inherited */
}

#content-body .thesis {
    font-style: normal;
    background-color: rgba(0, 50, 50, 0.3); /* Dark cyan, semi-transparent */
    border-left: 4px solid #00ffff; /* Bright cyan accent */
    padding: 15px 20px;
    margin: 25px 0;
    color: #cceeff; /* Lighter cyan/white text for thesis */
    border-radius: 0 3px 3px 0;
    line-height: 1.6;
}

#content-body .thesis strong {
    font-style: normal;
    color: #00ffff; /* Bright cyan for "Thesis:" label */
    font-weight: normal;
}

#content-body a {
    color: #7fdbff;
    text-decoration: none;
}

#content-body a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-shadow: 0 0 3px #ffffff;
}

/* Your existing #content-body ul, li, li::before styles are good for a dark theme */
#content-body ul {
    list-style: none;
    padding-left: 0; /* Reset default */
    margin-bottom: 1em;
}

#content-body li {
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
}

#content-body li::before {
    content: '»';
    color: #00ffff;
    position: absolute;
    left: 5px;
    top: 1px; /* Adjust if line-height changes affect alignment */
    font-size: 1.1em;
    text-shadow: 0 0 3px #00ffff;
}

#content-body blockquote { /* If blockquotes are used in essays */
    border-left: 3px solid #447777; /* Muted cyan border */
    padding-left: 15px;
    margin: 1em 0 1em 5px; /* Add some left margin to indent */
    color: #bbbbbb;
    font-style: normal;
}