/* ============================================
   Terminal Portfolio — Complete Stylesheet
   ============================================ */

:root {
    /* Tokyo Night inspired palette */
    --bg-deep: #0f1117;
    --bg-terminal: #1a1b26;
    --bg-titlebar: #16171f;
    --bg-tab: #1e2030;
    --bg-tab-active: #1a1b26;
    --bg-card: #1e2030;
    --bg-input: #13141c;

    --text-primary: #a9b1d6;
    --text-secondary: #565f89;
    --text-muted: #3b4261;
    --text-bright: #c0caf5;

    --accent-cyan: #7dcfff;
    --accent-green: #9ece6a;
    --accent-yellow: #e0af68;
    --accent-orange: #ff9e64;
    --accent-red: #f7768e;
    --accent-purple: #bb9af7;
    --accent-blue: #7aa2f7;
    --accent-pink: #ff007c;
    --accent-teal: #2ac3de;

    --border-color: #292e42;
    --border-active: #3d59a1;

    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    line-height: 1.6;
}

/* ===== Subtle background pattern ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(122, 162, 247, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(187, 154, 247, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(125, 207, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== Terminal Wrapper ===== */
.terminal-wrapper {
    width: 100%;
    max-width: 1000px;
    background: var(--bg-terminal);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 0 0 1px var(--border-color),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 80px -20px rgba(122, 162, 247, 0.08);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ===== Title Bar ===== */
.terminal-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-titlebar);
    border-bottom: 1px solid var(--border-color);
    user-select: none;
}

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

.titlebar-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    transition: opacity 0.2s;
}

.btn-close { background: #f7768e; }
.btn-minimize { background: #e0af68; }
.btn-maximize { background: #9ece6a; }

.titlebar-buttons:hover span {
    opacity: 0.8;
}

.titlebar-title {
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.titlebar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.connection-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex;
    background: var(--bg-titlebar);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(122, 162, 247, 0.05);
}

.tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    background: var(--bg-tab-active);
}

.tab-icon {
    font-size: 0.85rem;
}

/* ===== Terminal Content ===== */
.terminal-content {
    padding: 1.5rem 2rem;
    min-height: 500px;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.terminal-content::-webkit-scrollbar {
    width: 6px;
}

.terminal-content::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ===== Tab Content ===== */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Command Line ===== */
.command-line {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.prompt {
    margin-right: 0.5rem;
}

.prompt-user {
    color: var(--accent-green);
    font-weight: 600;
}

.prompt-separator {
    color: var(--text-bright);
}

.prompt-path {
    color: var(--accent-blue);
    font-weight: 500;
}

.prompt-dollar {
    color: var(--text-bright);
}

.command-text {
    color: var(--text-bright);
}

/* ===== Neofetch Output ===== */
.neofetch-output {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

/* Avatar Image (replaces ASCII art) */
.neofetch-avatar {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--accent-cyan);
    box-shadow: 
        0 0 15px rgba(125, 207, 255, 0.2),
        0 0 30px rgba(125, 207, 255, 0.08);
    background: var(--bg-card);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: invert(1);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.neofetch-avatar:hover .avatar-img {
    filter: invert(1) drop-shadow(0 0 4px rgba(125, 207, 255, 0.5));
    transform: scale(1.05);
}

.neofetch-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.info-line {
    font-size: 0.85rem;
}

.info-key {
    color: var(--accent-cyan);
    font-weight: 600;
    min-width: 90px;
    display: inline-block;
}

.info-separator {
    color: var(--text-secondary);
    margin: 0 0.3rem;
}

.highlight-name {
    color: var(--accent-green);
    font-weight: 600;
}

.highlight-cyan {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Color Palette */
.color-palette {
    display: flex;
    gap: 3px;
    margin-top: 0.5rem;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    display: inline-block;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.3);
}

/* ===== File Output ===== */
.file-output {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.md-comment {
    color: var(--text-secondary);
    font-style: italic;
}

.file-output p {
    color: var(--text-primary);
    font-size: 0.88rem;
}

/* ===== LS Output (Projects) ===== */
.ls-output {
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
    line-height: 1.7;
}

.ls-header {
    color: var(--text-secondary);
}

.ls-line {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dir-dot {
    color: var(--text-secondary);
}

.file-readme {
    color: var(--accent-green);
    font-weight: 500;
}

.dir-name {
    color: var(--accent-cyan);
    font-weight: 500;
}

/* ===== Project Cards ===== */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--border-active);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.project-icon {
    font-size: 1.1rem;
}

.project-name {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 1rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.project-footer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.project-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 0.78rem;
    transition: color 0.2s;
}

.project-link:hover {
    color: var(--accent-blue);
}

.tech-tag {
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid;
}

.tag-typescript { color: #3178c6; border-color: #3178c6; }
.tag-rust { color: #f7768e; border-color: #f7768e; }
.tag-webrtc { color: #e0af68; border-color: #e0af68; }
.tag-postgres { color: var(--text-secondary); border-color: var(--text-muted); }
.tag-python { color: #e0af68; border-color: #e0af68; }
.tag-react { color: #7dcfff; border-color: #7dcfff; }
.tag-d3 { color: #ff9e64; border-color: #ff9e64; }
.tag-fastapi { color: #9ece6a; border-color: #9ece6a; }
.tag-svelte { color: #ff3e00; border-color: #ff3e00; }
.tag-go { color: #7dcfff; border-color: #7dcfff; }
.tag-redis { color: #f7768e; border-color: #f7768e; }
.tag-canvas { color: #bb9af7; border-color: #bb9af7; }
.tag-wasm { color: #7aa2f7; border-color: #7aa2f7; }
.tag-clickhouse { color: #e0af68; border-color: #e0af68; }

/* Cybersecurity tags */
.tag-wazuh { color: #7dcfff; border-color: #7dcfff; }
.tag-suricata { color: #ff9e64; border-color: #ff9e64; }
.tag-virustotal { color: #9ece6a; border-color: #9ece6a; }
.tag-linux { color: #e0af68; border-color: #e0af68; }
.tag-dns { color: #7aa2f7; border-color: #7aa2f7; }
.tag-networking { color: #bb9af7; border-color: #bb9af7; }
.tag-security { color: #f7768e; border-color: #f7768e; }
.tag-nmap { color: #2ac3de; border-color: #2ac3de; }
.tag-metasploit { color: #7dcfff; border-color: #7dcfff; }
.tag-wireshark { color: #9ece6a; border-color: #9ece6a; }
.tag-social { color: #e0af68; border-color: #e0af68; }

/* ===== Skills Section ===== */
.skills-section {
    margin-bottom: 1.5rem;
}

.skills-category {
    color: var(--accent-green);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.skill-bar-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.65rem;
}

.skill-label {
    color: var(--text-primary);
    font-size: 0.82rem;
    min-width: 120px;
    text-align: right;
}

.skill-bar {
    flex: 1;
    height: 12px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.skill-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    width: 0;
    position: relative;
}

.skill-fill.animated {
    /* Width set by JS */
}

.fill-green {
    background: linear-gradient(90deg, #9ece6a, #73c245);
}

.fill-blue {
    background: linear-gradient(90deg, #7aa2f7, #5b87e0);
}

.fill-orange {
    background: linear-gradient(90deg, #ff9e64, #e08a50);
}

.fill-pink {
    background: linear-gradient(90deg, #f7768e, #e05572);
}

.skill-percent {
    color: var(--text-secondary);
    font-size: 0.78rem;
    min-width: 35px;
}

/* Comfortable tags */
.comfortable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.comfort-tag {
    padding: 0.25rem 0.7rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.78rem;
    transition: all 0.2s;
}

.comfort-tag:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* ===== Experience Timeline ===== */
.timeline {
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(122, 162, 247, 0.4);
}

.timeline-dot.dot-education {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(158, 206, 106, 0.4);
}

.timeline-dot.dot-cert {
    background: var(--accent-orange);
    box-shadow: 0 0 8px rgba(255, 158, 100, 0.4);
}

.timeline-content {
    padding-top: 0;
}

.job-title {
    color: var(--text-bright);
    font-size: 0.95rem;
    font-weight: 600;
}

.company {
    color: var(--accent-cyan);
    font-size: 0.82rem;
    font-weight: 500;
}

.period {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

.job-desc {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.6;
}

/* ===== Contact Section ===== */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.25s ease;
}

.contact-item:hover {
    border-color: var(--accent-cyan);
    transform: translateX(6px);
    background: rgba(125, 207, 255, 0.05);
}

.contact-icon {
    font-size: 1.1rem;
}

.contact-label {
    color: var(--accent-cyan);
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 70px;
}

.contact-value {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

/* ===== Contact Form ===== */
.terminal-form {
    margin-top: 1rem;
}

.form-field {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.form-field label {
    color: var(--accent-cyan);
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 80px;
    padding-top: 0.5rem;
}

.form-field input,
.form-field textarea {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--accent-cyan);
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 0.5rem;
}

.submit-btn:hover {
    background: var(--accent-green);
    color: var(--bg-terminal);
    box-shadow: 0 0 15px rgba(158, 206, 106, 0.2);
}

/* ===== Interactive Prompt ===== */
.interactive-prompt {
    display: flex;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    outline: none;
    caret-color: var(--accent-green);
}

.command-input::placeholder {
    color: var(--text-muted);
}

/* ===== Cursor blink ===== */
.command-input:focus::after {
    content: '█';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ===== Typing animation for initial load ===== */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 0.8s steps(20, end);
}

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

/* ===== Command output animation ===== */
.command-output-anim {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(8px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .terminal-wrapper {
        border-radius: 0;
        max-width: 100%;
    }

    .terminal-content {
        padding: 1rem;
        max-height: none;
    }

    .neofetch-output {
        flex-direction: column;
        gap: 1rem;
    }

    .neofetch-ascii {
        font-size: 0.5rem;
    }

    .titlebar-title {
        display: none;
    }

    .tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.72rem;
    }

    .tab-icon {
        display: none;
    }

    .skill-label {
        min-width: 80px;
        font-size: 0.75rem;
    }

    .ls-output {
        font-size: 0.7rem;
    }

    .ls-line {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .skill-bar-container {
        flex-wrap: wrap;
    }

    .project-footer {
        gap: 0.4rem;
    }

    .contact-item {
        flex-wrap: wrap;
    }
}

/* ===== Boot Screen ===== */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #050505;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 2rem;
    transition: opacity 0.8s ease-in-out;
}

.boot-text {
    width: 100%;
    max-width: 800px;
    margin-bottom: 2rem;
}

.boot-line {
    margin-bottom: 0.3rem;
    opacity: 0;
    animation: bootLineReveal 0.1s forwards;
}

@keyframes bootLineReveal {
    to { opacity: 1; }
}

.boot-prompt {
    text-align: center;
    margin-top: 1rem;
    animation: fadeIn 0.5s ease-in-out;
}

.blink-text {
    animation: blinkText 1.5s infinite;
    margin-top: 1rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

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