/* Modern Terminal Portfolio Styles */
:root {
    --bg-color: #050505;
    --terminal-bg: rgba(10, 10, 15, 0.75);
    --terminal-header-bg: rgba(20, 20, 30, 0.8);
    --text-color: #e0e0e0;
    --primary-color: #00ff9d;
    /* Neon Green */
    --secondary-color: #00d8ff;
    /* Neon Cyan */
    --accent-color: #ff00ff;
    /* Neon Magenta */
    --error-color: #ff3333;
    --warning-color: #ffcc00;
    --dim-color: #666666;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
    --font-main: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

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

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 999;
}

/* Boot Screen */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Courier New', monospace;
}

.boot-content {
    width: 80%;
    max-width: 600px;
}

.boot-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-glitch {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 2px 2px var(--accent-color);
    animation: glitch 1s infinite alternate;
}

.boot-log {
    font-size: 14px;
    color: var(--secondary-color);
    height: 200px;
    overflow: hidden;
    margin-bottom: 20px;
    white-space: pre-wrap;
    /* Prevent layout shifts */
    min-height: 200px;
    max-height: 200px;
}

.boot-progress-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.boot-progress {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.1s linear;
}

/* Main Interface */
.main-interface {
    width: 95vw;
    height: 90vh;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 1s ease-in;
}

.terminal-window {
    flex: 1;
    background: var(--terminal-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.terminal-header {
    background: var(--terminal-header-bg);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.control.close {
    background: #ff5f56;
}

.control.minimize {
    background: #ffbd2e;
}

.control.maximize {
    background: #27ca3f;
}

.terminal-title {
    color: var(--dim-color);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--dim-color);
}

.status-item {
    font-family: var(--font-main);
}

/* Terminal Body */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: var(--dim-color) transparent;
}

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

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

.terminal-output {
    margin-bottom: 10px;
}

/* Input Line */
.input-line-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.prompt-wrapper {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.prompt-user {
    color: var(--primary-color);
    font-weight: bold;
}

.prompt-at {
    color: var(--dim-color);
}

.prompt-host {
    color: var(--secondary-color);
    font-weight: bold;
}

.prompt-colon {
    color: var(--dim-color);
}

.prompt-path {
    color: var(--accent-color);
}

.prompt-char {
    color: var(--primary-color);
    margin-left: 5px;
}

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

.terminal-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    width: 100%;
    height: 100%;
    caret-color: var(--primary-color);
    /* Use native caret for better reliability */
    padding: 0;
    margin: 0;
}

/* Remove old custom cursor/mirror styles as we are switching to native caret for stability */
.input-mirror,
.custom-cursor {
    display: none;
}

/* Status Bar */
.status-bar {
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    color: var(--dim-color);
    border: 1px solid var(--border-color);
}

.status-left,
.status-right {
    display: flex;
    gap: 15px;
}

.status-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Animations */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes glitch {
    0% {
        text-shadow: 2px 2px var(--accent-color);
    }

    25% {
        text-shadow: -2px 2px var(--secondary-color);
    }

    50% {
        text-shadow: 2px -2px var(--primary-color);
    }

    75% {
        text-shadow: -2px -2px var(--error-color);
    }

    100% {
        text-shadow: 2px 2px var(--accent-color);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Command Output Styling */
.cmd-output {
    margin-bottom: 15px;
}

.cmd-line {
    color: var(--dim-color);
    margin-bottom: 5px;
    font-size: 0.9em;
}

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

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

.info-msg {
    color: var(--secondary-color);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.card-title {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 10px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    font-size: 0.8em;
    background: rgba(0, 216, 255, 0.1);
    color: var(--secondary-color);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Autocomplete */
.autocomplete-suggestions {
    position: absolute;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    padding: 5px 0;
    z-index: 3000;
    display: none;
    box-shadow: 0 0 15px rgba(0, 216, 255, 0.2);
}

.suggestion-item {
    padding: 5px 15px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: rgba(0, 216, 255, 0.2);
    color: #fff;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-interface {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .terminal-window {
        border-radius: 0;
        border: none;
    }

    .boot-content {
        width: 90%;
    }

    .logo-glitch {
        font-size: 2.5rem;
    }

    .status-bar {
        display: none;
        /* Hide status bar on mobile to save space */
    }

    .terminal-body {
        padding: 10px;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    /* Prevent zoom on mobile inputs */
    .terminal-input {
        font-size: 16px;
    }
}