/* Root Variables - Dark Mode */
:root {
    --bg-primary: #1e1e2e;
    --bg-secondary: #2d2d44;
    --bg-terminal: #1a1a1a;
    --bg-terminal-body: #0a0a0a;
    --text-primary: #00ff00;
    --text-secondary: #abb2bf;
    --border-color: #3a3a3a;
    --header-bg: #2d2d2d;
    
    /* Terminal colors - dark mode */
    --terminal-green: #00ff00;
    --terminal-blue: #61afef;
    --terminal-red: #ff6b6b;
    --terminal-yellow: #e5c07b;
    --terminal-cyan: #56b6c2;
    --terminal-magenta: #c678dd;
    --terminal-text: #abb2bf;
    
    /* Web view colors - dark mode */
    --web-text: #e6edf3;
    --web-text-secondary: #9198a1;
    --web-link: #58a6ff;
    --web-link-hover: #79c0ff;
    --web-heading: #ffffff;
}

/* Light Mode Variables - VSCode Light Theme inspired */
body.light-mode {
    --bg-primary: #f3f3f3;
    --bg-secondary: #e8e8e8;
    --bg-terminal: #ffffff;
    --bg-terminal-body: #ffffff;
    --text-primary: #000000;
    --text-secondary: #6a737d;
    --border-color: #e1e4e8;
    --header-bg: #f6f8fa;
    
    /* Terminal-specific light mode colors (VSCode-like) */
    --terminal-green: #008000;
    --terminal-blue: #0000ff;
    --terminal-red: #cd3131;
    --terminal-yellow: #795e26;
    --terminal-cyan: #007acc;
    --terminal-magenta: #af00db;
    --terminal-text: #333333;
    
    /* Web view colors - separate from terminal */
    --web-text: #24292e;
    --web-text-secondary: #586069;
    --web-link: #0366d6;
    --web-link-hover: #005cc5;
    --web-heading: #1a1a1a;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* View Controls - iOS Style */
.view-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    background: rgba(120, 120, 128, 0.16);
    backdrop-filter: blur(20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--terminal-cyan);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.light-mode .control-btn {
    background: rgba(120, 120, 128, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.control-btn:hover {
    background: rgba(120, 120, 128, 0.24);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

body.light-mode .control-btn:hover {
    background: rgba(120, 120, 128, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.control-btn:active {
    transform: translateY(0);
    background: rgba(120, 120, 128, 0.3);
}

.control-btn .icon {
    font-size: 13px;
    display: flex;
    align-items: center;
}

/* Terminal Container */
.terminal-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background: var(--bg-terminal);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-container.hidden {
    display: none;
}

/* Terminal Header */
.terminal-header {
    background: var(--header-bg);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.btn.close {
    background: #ff5f56;
}

.btn.minimize {
    background: #ffbd2e;
}

.btn.maximize {
    background: #27c93f;
}

.terminal-title {
    color: #a0a0a0;
    font-size: 13px;
    flex: 1;
    text-align: center;
}

.terminal-controls {
    margin-left: auto;
}

/* Terminal Body */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-terminal-body);
    font-size: 14px;
    line-height: 1.6;
}

#terminal-output {
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-line {
    margin-bottom: 4px;
}

.output-line.command {
    color: var(--terminal-green);
}

.output-line.error {
    color: var(--terminal-red);
}

.output-line.info {
    color: var(--terminal-blue);
}

.output-line.success {
    color: #98c379;
}

body.light-mode .output-line.success {
    color: var(--terminal-green);
}

.output-line.warning {
    color: var(--terminal-yellow);
}

.directory {
    color: var(--terminal-blue);
    font-weight: bold;
}

.file {
    color: var(--terminal-text);
}

.executable {
    color: #98c379;
}

body.light-mode .executable {
    color: var(--terminal-cyan);
}

/* Input Line */
.input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #98c379;
    margin-right: 8px;
    flex-shrink: 0;
}

body.light-mode .prompt {
    color: var(--terminal-cyan);
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-green);
    font-family: inherit;
    font-size: inherit;
    caret-color: var(--terminal-green);
}

body.light-mode #terminal-input {
    color: var(--terminal-text);
    caret-color: var(--terminal-text);
}

/* Vim Viewer */
.vim-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1e1e1e;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: #d4d4d4;
}

body.light-mode .vim-viewer {
    background: #ffffff;
    color: #333333;
}

.vim-viewer.hidden {
    display: none;
}

.vim-header {
    background: #2d2d2d;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
}

body.light-mode .vim-header {
    background: #f6f8fa;
    border-bottom: 1px solid #e1e4e8;
}

.vim-filename {
    color: #61afef;
    font-weight: bold;
}

body.light-mode .vim-filename {
    color: #007acc;
}

.vim-help {
    color: #888;
    font-size: 12px;
}

body.light-mode .vim-help {
    color: #6a737d;
}

.vim-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #1e1e1e;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

body.light-mode .vim-content {
    background: #ffffff;
    color: #333333;
}

.vim-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    margin: 0;
    font-family: inherit;
}

.vim-footer {
    background: #2d2d2d;
    padding: 5px 15px;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #3a3a3a;
}

body.light-mode .vim-footer {
    background: #f6f8fa;
    color: #6a737d;
    border-top: 1px solid #e1e4e8;
}

/* Content Styling in Vim Viewer */
.vim-content h1 {
    color: #61afef;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
}

.vim-content h2 {
    color: #c678dd;
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: bold;
}

.vim-content h3 {
    color: #e5c07b;
    font-size: 16px;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: bold;
}

.vim-content p {
    color: #abb2bf;
    margin-bottom: 10px;
    line-height: 1.6;
}

.vim-content a {
    color: #61afef;
    text-decoration: none;
}

.vim-content a:hover {
    text-decoration: underline;
}

.vim-content .meta {
    color: #5c6370;
    font-style: italic;
    margin-bottom: 5px;
}

.vim-content .divider {
    border-top: 1px solid #3a3a3a;
    margin: 20px 0;
}

.vim-content strong {
    color: #e06c75;
    font-weight: bold;
}

/* Link styling */
a {
    color: #61afef;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Scrollbar styling */
.terminal-body::-webkit-scrollbar,
.vim-content::-webkit-scrollbar,
.plain-view::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track,
.vim-content::-webkit-scrollbar-track,
.plain-view::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.light-mode .terminal-body::-webkit-scrollbar-track,
body.light-mode .vim-content::-webkit-scrollbar-track,
body.light-mode .plain-view::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.terminal-body::-webkit-scrollbar-thumb,
.vim-content::-webkit-scrollbar-thumb,
.plain-view::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

body.light-mode .terminal-body::-webkit-scrollbar-thumb,
body.light-mode .vim-content::-webkit-scrollbar-thumb,
body.light-mode .plain-view::-webkit-scrollbar-thumb {
    background: #c0c0c0;
}

.terminal-body::-webkit-scrollbar-thumb:hover,
.vim-content::-webkit-scrollbar-thumb:hover,
.plain-view::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body.light-mode .terminal-body::-webkit-scrollbar-thumb:hover,
body.light-mode .vim-content::-webkit-scrollbar-thumb:hover,
body.light-mode .plain-view::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Animations */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.cursor {
    animation: blink 1s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .terminal-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .terminal-body {
        font-size: 12px;
        padding: 15px;
    }

    .vim-content {
        padding: 15px;
        font-size: 13px;
    }

    .vim-help {
        display: none;
    }
    
    .terminal-title {
        font-size: 11px;
    }
    
    .terminal-controls .control-btn {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .terminal-controls .control-btn .icon {
        font-size: 11px;
    }
}

/* ============================================
   PLAIN VIEW STYLES
   ============================================ */

.plain-view {
    display: none;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-terminal-body);
}

.plain-view.active {
    display: block;
}

.plain-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: var(--web-text);
}

/* Plain Header */
.plain-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.plain-header .name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--web-heading);
    margin: 0;
    letter-spacing: -0.02em;
}

.plain-nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--web-text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--web-link);
}

.nav-link.active {
    color: var(--web-link);
    border-bottom-color: var(--web-link);
}

/* Plain Content */
.plain-content {
    margin-bottom: 3rem;
    color: var(--web-text);
}

.plain-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--web-heading);
}

.plain-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    margin-top: 2rem;
    color: var(--web-heading);
}

.plain-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--web-text);
}

.plain-content a {
    color: var(--web-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.plain-content a:hover {
    color: var(--web-link-hover);
    text-decoration: underline;
}

/* Publication/Experience Items */
.item {
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
}

.item:last-child {
    margin-bottom: 0;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--web-heading);
    margin-bottom: 0.5rem;
}

.item-meta {
    font-size: 0.95rem;
    color: var(--web-text-secondary);
    margin-bottom: 0.5rem;
}

.item-links {
    margin-top: 0.8rem;
}

.item-links a {
    margin-right: 1rem;
    font-size: 0.9rem;
}

/* Plain Footer */
.plain-footer {
    padding-top: 2rem;
    margin-top: 3rem;
    text-align: center;
    color: var(--web-text-secondary);
}

.plain-footer .social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.plain-footer .social-links a {
    color: var(--web-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.plain-footer .social-links a:hover {
    color: var(--web-link);
}

/* Mobile Responsive for Plain View */
@media (max-width: 768px) {
    .plain-container {
        padding: 20px 15px;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .plain-header .name {
        font-size: 2rem;
    }
    
    .view-controls {
        gap: 8px;
    }
    
    .control-btn {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    .control-btn .icon {
        font-size: 12px;
    }
    
    .plain-nav {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
}

