/* Terminal Portfolio Styles */
:root {
    --bg-color: #0a0a0a;
    --terminal-bg: #1a1a2e;
    --text-color: #0f0;
    --text-dim: #0a0;
    --accent-color: #00ff88;
    --error-color: #ff4444;
    --warning-color: #ffaa00;
    --info-color: #44aaff;
    --header-bg: #2d2d44;
    --border-color: #3d3d5c;
}

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

body {
    background: var(--bg-color);
    font-family: 'JetBrains Mono', monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

/* CRT Effect Overlay */
#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
}

#crt-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

/* Terminal Container */
#terminal-container {
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    background: var(--terminal-bg);
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.2),
                0 0 100px rgba(0, 255, 136, 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

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

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

.btn-close { background: #ff5f56; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #27ca40; }

.terminal-title {
    flex: 1;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

/* Terminal Body */
#terminal {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.6;
}

#terminal::-webkit-scrollbar {
    width: 8px;
}

#terminal::-webkit-scrollbar-track {
    background: var(--terminal-bg);
}

#terminal::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Output Styling */
#output {
    white-space: pre-wrap;
    word-wrap: break-word;
}

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

.output-command {
    color: var(--accent-color);
}

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

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

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

.output-success {
    color: var(--accent-color);
}

.output-dim {
    color: var(--text-dim);
}

.output-highlight {
    color: #fff;
    font-weight: bold;
}

/* ASCII Art */
.ascii-art {
    color: var(--accent-color);
    font-size: 10px;
    line-height: 1.2;
}

/* Input Line */
#input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.prompt {
    color: var(--accent-color);
    white-space: nowrap;
}

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

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--text-color);
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

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

/* Links in Terminal */
.terminal-link {
    color: var(--info-color);
    text-decoration: underline;
    cursor: pointer;
}

.terminal-link:hover {
    color: #66ccff;
}

/* Progress Bar */
.progress-bar {
    display: inline-block;
    width: 200px;
    height: 12px;
    background: var(--terminal-bg);
    border: 1px solid var(--border-color);
    margin: 0 10px;
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--terminal-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.3);
}

.modal-wide {
    max-width: 1200px;
    width: 95%;
}

.modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--error-color);
}

.modal-hint {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 20px;
}

/* Architecture Diagram */
#architecture-diagram {
    min-height: 600px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

#architecture-diagram svg {
    width: 100%;
    height: auto;
    min-height: 600px;
}

.arch-node {
    cursor: pointer;
    transition: all 0.2s;
}

.arch-node:hover {
    filter: brightness(1.3);
}

.arch-node rect {
    fill: var(--header-bg);
    stroke: var(--accent-color);
    stroke-width: 2;
}

.arch-node text {
    fill: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.arch-line {
    stroke: var(--border-color);
    stroke-width: 2;
    stroke-dasharray: 5, 5;
}

.arch-tooltip {
    position: absolute;
    background: var(--bg-color);
    border: 1px solid var(--accent-color);
    padding: 10px 15px;
    border-radius: 4px;
    color: var(--text-color);
    font-size: 12px;
    max-width: 250px;
    z-index: 3000;
    pointer-events: none;
}

/* Code Modal */
.code-modal-content {
    width: 700px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.code-modal-content h2 {
    flex-shrink: 0;
}

#code-modal-code {
    background: var(--terminal-bg);
    padding: 20px;
    border-radius: 4px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-color);
    margin: 0;
    white-space: pre;
    flex: 1;
    min-height: 0;
}

.arch-node.clickable:hover {
    filter: brightness(1.4);
}

/* Skills Tree */
#skills-tree {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    padding: 30px;
}

.skill-category {
    text-align: center;
}

.skill-category h3 {
    color: var(--accent-color);
    margin-bottom: 25px;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.skill-node {
    background: var(--header-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 18px 15px;
    margin: 12px 0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.skill-node:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.skill-name {
    color: var(--text-color);
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 15px;
}

.skill-level {
    color: var(--text-dim);
    font-size: 13px;
}

.skill-connector {
    width: 2px;
    height: 20px;
    background: var(--border-color);
    margin: 0 auto;
}

.skill-connector.active {
    background: var(--accent-color);
}

/* Skill Detail Panel */
.skill-detail {
    background: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.skill-detail h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.skill-detail p {
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.skill-detail .tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.skill-detail .tech-tag {
    background: var(--header-bg);
    color: var(--info-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
}

/* Responsive */
@media (max-width: 1024px) {
    #skills-tree {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    #terminal-container {
        width: 100%;
        height: 95vh;
        border-radius: 0;
    }

    #terminal {
        font-size: 13px;
        padding: 15px;
    }

    .ascii-art {
        font-size: 6px;
    }

    #skills-tree {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }

    .modal-content {
        padding: 20px;
        max-width: 100%;
    }

    #architecture-diagram svg {
        min-height: 350px;
    }
}

/* Typing animation */
.typing {
    overflow: hidden;
    border-right: 2px solid var(--text-color);
    white-space: nowrap;
    animation: typing 0.5s steps(40, end);
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Glitch effect for errors */
.glitch {
    animation: glitch 0.3s ease;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Vim Contact Form */
.vim-modal-content {
    width: 600px;
    max-width: 95vw;
    padding: 0;
    background: #1e1e2e;
    border: 2px solid var(--accent-color);
    overflow: hidden;
}

.vim-editor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.vim-titlebar {
    background: #313244;
    color: #cdd6f4;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #45475a;
}

.vim-close {
    cursor: pointer;
    font-size: 18px;
    color: #6c7086;
}

.vim-close:hover {
    color: #f38ba8;
}

.vim-buffer {
    background: #1e1e2e;
    padding: 8px 0;
    min-height: 280px;
    max-height: 400px;
    overflow-y: auto;
}

.vim-line {
    padding: 0 12px;
    white-space: pre;
    color: #cdd6f4;
}

.vim-linenum {
    color: #6c7086;
    margin-right: 16px;
    user-select: none;
}

.vim-comment {
    color: #6c7086;
    font-style: italic;
}

.vim-tilde {
    color: #89b4fa;
    margin-left: 24px;
}

.vim-cursor {
    background: #cdd6f4;
    color: #1e1e2e;
}

.vim-statusline {
    background: #89b4fa;
    color: #1e1e2e;
    padding: 4px 12px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

.vim-mode-insert {
    color: #1e1e2e;
}

.vim-mode-error {
    color: #f38ba8;
    background: #1e1e2e;
}

.vim-commandline {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 4px 12px;
    border-top: 1px solid #45475a;
}
