/* The Last Employee - Corporate Gothic Theme */

/* === CSS Variables for Theming === */
:root {
    /* Light Theme (Default) */
    --bg-primary: #f5f5f0;
    --bg-secondary: #e8e8e0;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #777777;
    --accent: #2d5a5a;
    --accent-hover: #3d7a7a;
    --border-color: #c0c0b8;
    --link-color: #2d5a5a;
    --link-hover: #3d7a7a;
    --shadow: rgba(0, 0, 0, 0.1);
    --font-body: 'Georgia', 'Times New Roman', serif;
    --font-heading: 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    --line-height: 1.8;
    --font-size-base: 18px;
    --content-max-width: 720px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-card: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --accent: #5a9a9a;
    --accent-hover: #7ababa;
    --border-color: #444444;
    --link-color: #5a9a9a;
    --link-hover: #7ababa;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Matrix Theme (Server Room) */
[data-theme="matrix"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0f0f0f;
    --bg-card: #000000;
    --text-primary: #00ff88;
    --text-secondary: #00cc6a;
    --text-muted: #008844;
    --accent: #00ff88;
    --accent-hover: #33ffaa;
    --border-color: #00ff88;
    --link-color: #00ff88;
    --link-hover: #33ffaa;
    --shadow: rgba(0, 255, 136, 0.1);
    --font-body: 'Courier New', Consolas, monospace;
    --font-heading: 'Courier New', monospace;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: var(--line-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Matrix-specific effects */
[data-theme="matrix"] body {
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

/* === Navigation === */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

.theme-toggle {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.theme-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
}

.theme-btn.active {
    opacity: 1;
    background: var(--accent);
    border-color: var(--accent);
}

/* === Main Content === */
main {
    flex: 1;
}

.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* === Footer === */
.main-footer {
    background: var(--bg-secondary);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.main-footer p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}

/* === Chapter Reader Styles === */
.chapter-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.chapter-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.chapter-number {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.chapter-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.chapter-body {
    font-size: 1.1rem;
    line-height: 1.9;
}

.chapter-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.chapter-body h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    color: var(--accent);
}

.chapter-body h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.chapter-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.chapter-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 3rem 0;
}

/* Chat log styling */
.chat-log {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.chat-entry {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.chat-entry:last-child {
    margin-bottom: 0;
}

/* === Chapter Navigation === */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.chapter-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chapter-nav a:hover {
    text-decoration: underline;
}

.chapter-nav a.disabled {
    color: var(--text-muted);
    pointer-events: none;
}

/* === Chapters List === */
.chapters-list {
    display: grid;
    gap: 1rem;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.chapter-item:hover {
    border-color: var(--accent);
    transform: translateX(5px);
}

.chapter-item .chapter-number {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 100px;
}

.chapter-item .chapter-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

/* Progress bar */
.progress-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* === Responsive === */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .theme-toggle {
        margin-left: 0;
    }
    
    .container {
        padding: 2rem 1.5rem;
    }
    
    .chapter-title {
        font-size: 1.7rem;
    }
    
    .chapter-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .chapter-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .chapter-item .chapter-number {
        min-width: auto;
    }
}
