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

:root {
    --bg-color: #0d1117;
    --terminal-bg: #161b22;
    --header-bg: #21262d;
    --text-color: #c9d1d9;
    --prompt-color: #58a6ff;
    --accent-color: #7ee787;
    --error-color: #f85149;
    --link-color: #58a6ff;
    --muted-color: #8b949e;
    --border-color: #30363d;
}

body {
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
}

#terminal {
    width: 100%;
    max-width: 900px;
    height: 80vh;
    min-height: 500px;
    background: var(--terminal-bg);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#terminal-header {
    background: var(--header-bg);
    padding: 12px 16px;
    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%;
    display: inline-block;
}

.btn-close {
    background: #f85149;
}

.btn-minimize {
    background: #d29922;
}

.btn-maximize {
    background: #7ee787;
}

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

#terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#output {
    flex: 1;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#output .command-line {
    margin-bottom: 5px;
}

#output .command-line .prompt {
    color: var(--prompt-color);
}

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

#output .output-text {
    margin-bottom: 15px;
    padding-left: 0;
}

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

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

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

#output .link {
    color: var(--link-color);
    text-decoration: underline;
}

#output .muted {
    color: var(--muted-color);
}

#output .section-header {
    color: var(--accent-color);
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
}

#output .ascii-art {
    color: var(--accent-color);
    line-height: 1.2;
    font-size: 12px;
}

/* Mobile-friendly name display (hidden on desktop, shown on mobile) */
.mobile-name {
    display: none !important;
    color: var(--accent-color);
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Clickable links in output */
#output a {
    color: var(--link-color);
    text-decoration: underline;
    cursor: pointer;
    transition: opacity 0.2s;
}

#output a:hover {
    opacity: 0.8;
}

#output a:visited {
    color: var(--link-color);
}

#input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
    position: relative;
}

#input-line .prompt {
    color: var(--prompt-color);
    margin-right: 10px;
    white-space: nowrap;
    font-size: 14px;
}

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

#command-input::placeholder {
    color: var(--muted-color);
    opacity: 0.5;
}

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

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

/* Hide cursor when input is focused (using native caret) */
#command-input:focus + .cursor {
    display: none;
}

/* Autocomplete suggestion */
.autocomplete-hint {
    position: absolute;
    left: 0;
    color: var(--muted-color);
    opacity: 0.5;
    pointer-events: none;
    font-size: 14px;
}

/* Scrollbar styling */
#terminal-body::-webkit-scrollbar {
    width: 8px;
}

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

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

#terminal-body::-webkit-scrollbar-thumb:hover {
    background: var(--muted-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #terminal {
        height: 90vh;
        min-height: 400px;
        border-radius: 8px;
    }

    #terminal-header {
        padding: 10px 12px;
    }

    .terminal-buttons span {
        width: 10px;
        height: 10px;
    }

    .terminal-title {
        font-size: 11px;
    }

    #terminal-body {
        padding: 15px;
    }

    #output {
        font-size: 12px;
    }

    #input-line .prompt {
        font-size: 12px;
    }

    #command-input {
        font-size: 12px;
    }

    #output .ascii-art {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    #terminal {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile keyboards */
        border-radius: 0;
    }

    #terminal-body {
        padding: 10px;
    }

    #output {
        font-size: 11px;
        line-height: 1.5;
    }

    #input-line .prompt {
        font-size: 11px;
        margin-right: 5px;
    }

    #command-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Hide ASCII art on mobile, show simple text instead */
    #output .ascii-art {
        display: none !important;
    }

    .mobile-name {
        display: block !important;
    }
}

/* Selection styling */
::selection {
    background: var(--prompt-color);
    color: var(--bg-color);
}

/* Focus outline for accessibility */
#command-input:focus-visible {
    outline: none;
}

/* Typing animation cursor */
.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--accent-color);
    animation: blink 0.7s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}
