:root {
    /* Default Theme (Matrix/Hacker Green) */
    --bg-color: #0d1117;
    --term-color: #00ff00;
    --term-dim: #008f00;
    --accent-color: #00ffcc;
    --error-color: #ff0033;
    --font-mono: 'Fira Code', monospace;
    --scanline-color: rgba(0, 255, 0, 0.05);
}

[data-theme="cyberpunk"] {
    --bg-color: #0b0014;
    --term-color: #ff00ff;
    --term-dim: #8f008f;
    --accent-color: #00ffff;
    --error-color: #ff3333;
    --scanline-color: rgba(255, 0, 255, 0.05);
}

[data-theme="retro"] {
    --bg-color: #1a1a1a;
    --term-color: #ffb000;
    --term-dim: #996600;
    --accent-color: #ffcc00;
    --error-color: #cc3300;
    --scanline-color: rgba(255, 176, 0, 0.05);
}

[data-theme="bsod"] {
    --bg-color: #0000aa;
    --term-color: #ffffff;
    --term-dim: #aaaaaa;
    --accent-color: #ffffff;
    --error-color: #ffffff;
    --scanline-color: rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--bg-color);
    color: var(--term-color);
    font-family: var(--font-mono);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    line-height: 1.5;
}

/* Scanline Effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.6;
}

.scanline::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg,
            rgba(255, 0, 0, 0.06),
            rgba(0, 255, 0, 0.02),
            rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Terminal Container */
.terminal-container {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid var(--term-dim);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Terminal Header */
.terminal-header {
    background: #161b22;
    padding: 10px 15px;
    border-bottom: 1px solid var(--term-dim);
    display: flex;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.buttons {
    display: flex;
    gap: 8px;
}

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

.close {
    background: #ff5f56;
}

.minimize {
    background: #ffbd2e;
}

.maximize {
    background: #27c93f;
}

.title {
    flex-grow: 1;
    text-align: center;
    color: #8b949e;
    font-size: 0.9rem;
}

/* Terminal Body */
.terminal-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: var(--font-mono);
    scrollbar-width: thin;
    scrollbar-color: var(--term-dim) var(--bg-color);
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.terminal-body::-webkit-scrollbar-thumb {
    background-color: var(--term-dim);
    border-radius: 4px;
}

/* Input Line */
.input-line {
    display: flex;
    padding: 10px 20px;
    background: #0d1117;
    border-top: 1px solid var(--term-dim);
    border-radius: 0 0 8px 8px;
    align-items: center;
}

.prompt {
    color: var(--accent-color);
    margin-right: 10px;
    white-space: nowrap;
}

#command-input {
    background: transparent;
    border: none;
    color: var(--term-color);
    font-family: var(--font-mono);
    font-size: 1rem;
    flex-grow: 1;
    outline: none;
    caret-color: var(--term-color);
}

/* Content Styles */
.welcome-message pre {
    color: var(--term-color);
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 0 5px var(--term-color);
}

.command-highlight {
    color: var(--accent-color);
    font-weight: bold;
}

.output-line {
    margin-bottom: 10px;
    animation: fadeIn 0.2s ease-in-out;
}

.command-echo {
    color: #8b949e;
    margin-bottom: 5px;
}

.error-msg {
    color: var(--error-color);
}

.success-msg {
    color: var(--term-color);
}

/* Section Specifics */
.section-title {
    color: var(--accent-color);
    border-bottom: 1px dashed var(--term-dim);
    padding-bottom: 5px;
    margin: 15px 0 10px 0;
    display: inline-block;
}

.skill-bar {
    margin: 5px 0;
}

.social-link {
    color: var(--term-color);
    text-decoration: none;
    margin-right: 15px;
    transition: color 0.2s;
}

.social-link:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .terminal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }

    .terminal-header {
        border-radius: 0;
    }

    .welcome-message pre {
        font-size: 0.6rem;
    }
}

/* Boot Screen */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    z-index: 9999;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.boot-line {
    margin-bottom: 5px;
}

/* Nano Editor */
#nano-editor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000033;
    color: #fff;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    font-family: monospace;
}

.nano-header {
    background: #fff;
    color: #000;
    padding: 5px 10px;
    text-align: center;
    font-weight: bold;
}

.nano-content {
    flex-grow: 1;
    padding: 10px;
    outline: none;
    white-space: pre-wrap;
    overflow-y: auto;
}

.nano-footer {
    background: #fff;
    color: #000;
    padding: 5px 10px;
}

.nano-help {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

/* Top Command Table */
.top-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: monospace;
}

.top-header {
    background: #333;
    color: #fff;
    text-align: left;
}

.top-header th {
    padding: 5px;
}

.top-row td {
    padding: 2px 5px;
}

/* Crash Screen (BSOD) */
#crash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0078d7;
    color: #fff;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: none;
}

.crash-content {
    max-width: 600px;
}

.crash-content h1 {
    font-size: 100px;
    margin-bottom: 20px;
    font-weight: normal;
}

.crash-content p {
    font-size: 20px;
    margin-bottom: 10px;
}

.crash-details {
    font-size: 14px;
    margin-top: 20px;
}

/* Neofetch Styles */
.neofetch-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 10px;
    flex-wrap: wrap;
}

.neofetch-art {
    color: var(--accent-color);
    font-weight: bold;
    line-height: 1.2;
    white-space: pre;
}

.neofetch-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.neofetch-title {
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 5px;
}

.neofetch-row {
    margin-bottom: 2px;
}

.neofetch-key {
    color: var(--term-color);
    font-weight: bold;
}

.neofetch-val {
    color: #8b949e;
}

/* Matrix Effect */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
    display: none;
    /* Hidden by default */
}

body.matrix-active #matrix-canvas {
    display: block;
}

/* Snake Game Overlay */
#snake-game {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    color: var(--term-color);
}

.snake-header {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--term-color);
}

#snake-canvas {
    border: 2px solid var(--term-color);
    background: #000;
    box-shadow: 0 0 20px var(--term-dim);
}

.snake-footer {
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.8;
}

/* New Themes */
[data-theme="amber"] {
    --bg-color: #1a1000;
    --term-color: #ffb000;
    --term-dim: #996600;
    --accent-color: #ffcc00;
    --error-color: #cc3300;
    --scanline-color: rgba(255, 176, 0, 0.05);
}

[data-theme="ubuntu"] {
    --bg-color: #300a24;
    --term-color: #ffffff;
    --term-dim: #dd4814;
    --accent-color: #e95420;
    --error-color: #ff3333;
    --scanline-color: rgba(233, 84, 32, 0.05);
}