:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-green: #3fb950;
    --accent-blue: #58a6ff;
    --accent-purple: #bc8cff;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    --accent-cyan: #39c5cf;
    --border-color: #30363d;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
}

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

html, body {
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

.terminal-container {
    max-width: 1000px;
    margin: 20px auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* Header */
.terminal-header {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

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

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.btn-close { background: var(--accent-red); }
.btn-minimize { background: var(--accent-orange); }
.btn-maximize { background: var(--accent-green); }

.terminal-title {
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
}

.terminal-tabs {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-wrap: wrap;
}

.tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-green);
    color: var(--bg-primary);
    font-weight: 500;
}

/* Body */
.terminal-body {
    padding: 20px;
    min-height: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    cursor: text;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.ascii-art {
    color: var(--accent-green);
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 16px;
    white-space: pre;
}

.welcome-msg {
    color: var(--text-secondary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.welcome-msg .cmd {
    color: var(--accent-cyan);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.welcome-msg .cmd:hover {
    background: var(--bg-primary);
}

.welcome-msg .location {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* Content Styling */
.output-content {
    animation: fadeIn 0.3s ease;
}

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

.output-content h1 {
    color: var(--accent-green);
    font-size: 1.5em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-green);
}

.output-content h2 {
    color: var(--accent-blue);
    font-size: 1.2em;
    margin: 24px 0 12px;
}

.output-content h3 {
    color: var(--accent-purple);
    font-size: 1em;
    margin: 16px 0 8px;
}

.output-content p {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.output-content strong {
    color: var(--accent-cyan);
}

.output-content a {
    color: var(--accent-blue);
    text-decoration: none;
}

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

.output-content ul, .output-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.output-content li {
    margin-bottom: 6px;
}

.output-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-orange);
    font-size: 0.9em;
}

.output-content pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.output-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

.output-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.output-content th, .output-content td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.output-content th {
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
}

.output-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

.output-content em {
    color: var(--text-secondary);
    font-style: italic;
}

/* Input Line - IMPROVED */
.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    bottom: 0;
}

.prompt {
    color: var(--accent-green);
    white-space: nowrap;
    margin-right: 8px;
    user-select: none;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.command-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
    caret-color: var(--accent-green);
    padding: 4px 0;
}

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

.command-input:focus::placeholder {
    opacity: 0.3;
}

/* Command Echo & Results */
.command-echo {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--accent-green);
}

.prompt-echo {
    color: var(--accent-green);
    margin-right: 8px;
}

.cmd-echo {
    color: var(--text-primary);
}

.command-result {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Help Output */
.help-output {
    line-height: 1.8;
}

.cmd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.cmd-grid > div {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

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

.cmd-desc {
    color: var(--text-muted);
    margin-left: 8px;
}

/* LS Output */
.ls-output {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.ls-item {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.ls-item:hover {
    background: var(--border-color);
    transform: translateX(4px);
}

.ls-icon {
    margin-right: 8px;
}

/* Socials Output */
.socials-output {
    line-height: 2;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.social-icon {
    font-size: 1.2em;
}

.social-name {
    color: var(--accent-cyan);
    width: 80px;
}

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

.social-link:hover {
    text-decoration: underline;
}

/* Neofetch Output */
.neofetch-output {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.neofetch-ascii {
    color: var(--accent-green);
    line-height: 1.4;
    font-size: 13px;
}

.neofetch-info {
    line-height: 1.8;
}

.nf-label {
    color: var(--accent-cyan);
    display: inline-block;
    width: 100px;
}

.nf-label::after {
    content: ':';
}

.nf-value {
    color: var(--text-primary);
}

.nf-separator {
    color: var(--text-muted);
    margin: 4px 0;
}

/* History Output */
.history-output {
    line-height: 1.8;
}

.history-num {
    color: var(--text-muted);
    display: inline-block;
    width: 30px;
    text-align: right;
    margin-right: 12px;
}

/* Error & Muted */
.error-output {
    color: var(--accent-red);
}

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

/* Initial Hint */
.initial-hint {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-primary));
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    animation: pulse 2s infinite;
}

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

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

.hint-text code {
    background: var(--accent-green);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Autocomplete */
.autocomplete-hint {
    font-size: 12px;
    padding: 8px 12px;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 8px;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 100;
}

.mobile-tab {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    transition: all 0.2s;
}

.mobile-tab:hover,
.mobile-tab.active {
    background: var(--accent-green);
    color: var(--bg-primary);
    border-color: var(--accent-green);
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-container {
        margin: 0;
        border-radius: 0;
        border: none;
        min-height: 100vh;
        padding-bottom: 80px;
    }
    
    .terminal-tabs {
        display: none;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .terminal-body {
        max-height: none;
        min-height: calc(100vh - 120px);
    }
    
    .ascii-art {
        font-size: 9px;
    }
    
    .terminal-title {
        font-size: 11px;
    }
    
    .cmd-grid {
        grid-template-columns: 1fr;
    }
    
    .ls-output {
        grid-template-columns: 1fr 1fr;
    }
    
    .neofetch-output {
        flex-direction: column;
    }
}

/* Scrollbar */
.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--accent-green);
    color: var(--bg-primary);
}

/* Focus visible for accessibility */
.tab:focus-visible,
.mobile-tab:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
}

/* Contact Form */
.contact-form-container {
    margin: 20px 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    color: var(--accent-cyan);
    font-size: 13px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: var(--accent-green);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    padding: 14px 24px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    align-self: flex-start;
}

.submit-btn:hover {
    background: #4cc95f;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.form-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    display: none;
}

.form-status.error {
    display: block;
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.form-status.loading {
    display: block;
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-green);
    border-radius: 12px;
    padding: 32px 40px;
    text-align: center;
    max-width: 400px;
    transform: scale(0.9);
    transition: transform 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-title {
    color: var(--accent-green);
    font-size: 1.3em;
    margin-bottom: 8px;
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-close {
    background: var(--accent-green);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    padding: 12px 32px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #4cc95f;
}

.modal-timer {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}
