* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    color: #00ff41;
    background-image: url(https://c4.wallpaperflare.com/wallpaper/629/215/581/arch-linux-linux-dark-gray-archlinux-wallpaper-preview.jpg);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    font-family: "JetBrains Mono", "Courier New", monospace;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 15, 20, 0.92) 0%, rgba(20, 20, 30, 0.88) 100%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg, rgba(0, 255, 65, 0.03), rgba(0, 255, 65, 0.03) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: -1;
    animation: flicker 0.15s infinite;
}

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

::selection {
    color: #0f0f14;
    background-color: #00ff41;
}

::-moz-selection {
    color: #0f0f14;
    background-color: #00ff41;
}

textarea {
    left: -1000px;
    position: absolute;
}

#texter {
    opacity: 0;
}

#cursor {
    flex-shrink: 0;
}

b {
    font-weight: bold;
    text-decoration: underline;
}

.cursor {
    font-size: 14px;
    color: #00ff41;
    background-color: #00ff41;
    position: relative;
    opacity: 1;
    height: 1.5em;
    width: 8px;
    max-width: 8px;
    transform: translateY(2px);
    overflow: hidden;
    text-indent: -5px;
    display: inline-block;
    animation: blinker 0.8s linear infinite;
}

@keyframes blinker {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0; }
}

#command-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    gap: 0;
}

#terminal-wrapper {
    flex: 1;
    width: 100%;
    background: #050b11;
    border: 1px solid #0f1d2a;
    border-radius: 0;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    background: linear-gradient(180deg, #0c1622 0%, #09111a 100%);
    border-bottom: 1px solid #121f2c;
    position: sticky;
    top: 0;
    z-index: 2;
}

.terminal-bar-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.terminal-bar-center {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #9fbad6;
    font-size: 0.95em;
    letter-spacing: 0.02em;
    margin-left: 12px;
    margin-right: auto;
    text-align: left;
}

.terminal-bar-right {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
}

.terminal-divider {
    opacity: 0.5;
}

.terminal-welcome {
    color: #d6f6e4;
    font-weight: 600;
}

.terminal-user {
    color: #73d8a0;
    font-weight: 600;
}

.terminal-time {
    color: #ffbd2e;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-flex;
    background-color: #1f2b38;
    border: 1px solid #111821;
}

.dot-close {
    background-color: #ff5f56;
    border-color: #e0443e;
}

.dot-minimize {
    background-color: #ffbd2e;
    border-color: #e09e26;
}

.dot-maximize {
    background-color: #27c93f;
    border-color: #1fa634;
}

#terminal {
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease forwards;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 26px 24px 16px;
    background: #02070d;
    overflow: hidden;
}

#history {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 2px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#command {
    background: #03080f;
    border: 1px solid #0f1d2a;
    border-top: none;
    border-radius: 0;
    padding: 18px 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: -1px;
}

#input-line {
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4em;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #050c13;
}

.prompt-label {
    color: #1ec46b;
    font-weight: 600;
    white-space: nowrap;
}

#typer {
    color: #d6f6e4;
    flex: 1;
    min-height: 1.4em;
    font-size: 1.02em;
}

.ghost-complete {
    color: rgba(0, 255, 65, 0.45);
}

.command-input {
    color: #d6f6e4;
}

#autocomplete {
    background: #09131d;
    border: 1px solid #142436;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9em;
    color: #9fbad6;
    animation: slideDown 0.25s ease;
    max-height: 160px;
    overflow-y: auto;
    margin-top: 10px;
    align-self: stretch;
    width: 100%;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

#autocomplete.hidden {
    display: none;
}

.autocomplete-item {
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: rgba(30, 196, 107, 0.2);
    color: #d6f6e4;
}

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

@keyframes show {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

p {
    display: block;
    line-height: 1.5em;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: 0.02em;
    animation: typing 0.4s steps(40, end);
    font-weight: 400;
    position: relative;
    transition: transform 0.2s ease, color 0.2s ease;
}

p:hover {
    transform: translateX(3px);
}

p.no-animation {
    animation: none;
}

p.color2 {
    color: #00ff41;
}

.margin {
    margin-left: 20px;
    position: relative;
    padding-left: 5px;
}

.margin::before {
    content: '➜';
    position: absolute;
    left: -20px;
    color: #00d4ff;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    font-weight: bold;
}

p:hover .margin::before {
    opacity: 1;
}

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

.index {
    color: #00ff41;
    font-weight: bold;
    font-size: 1.05em;
    letter-spacing: 1px;
    animation: slideInDown 0.6s ease forwards;
}

.color2 {
    color: #00ff41;
}

.banner-line {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
}

.command {
    color: #00d4ff;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 2px;
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.error {
    color: #ff0055;
    font-weight: bold;
}

.white {
    color: #fff;
}

.inherit,
a {
    color: #00ffff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px dotted #00ffff;
}

a {
    text-decoration: inherit;
}

a:hover {
    color: #00ff41;
    background: rgba(0, 212, 255, 0.12);
    padding: 2px 6px;
    border-radius: 2px;
    border-bottom: 1px solid #00ff41;
}

a:focus {
    outline: 0;
}

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

@media (max-width: 768px) {
    body {
        padding: 0;
        min-width: auto;
        font-size: 14px;
    }

    #command-container {
        height: 100vh;
        padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
    }

    .terminal-bar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        padding: 16px 14px;
        gap: 12px;
    }

    .terminal-bar-left {
        justify-self: start;
        margin: 0;
    }

    .terminal-bar-center {
        justify-self: center;
        text-align: center;
        margin: 0;
    }

    .terminal-bar-right {
        justify-self: end;
        margin-left: 0;
    }

    #terminal {
        padding: 20px 16px 12px;
    }

    #command {
        padding: 16px;
    }

    #input-line {
        gap: 10px;
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    #typer {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
        background-attachment: scroll;
    }

    #command-container {
        height: 100vh;
        padding: calc(env(safe-area-inset-top) + 12px) 12px env(safe-area-inset-bottom);
    }

    .terminal-bar {
        display: grid;
        grid-template-columns: max-content 1fr;
        grid-template-areas:
            "dots time"
            "center center";
        padding: 14px 12px;
        gap: 8px;
        align-items: center;
    }

    .terminal-bar-left {
        grid-area: dots;
        justify-self: start;
        margin: 0;
    }

    .terminal-bar-center {
        grid-area: center;
        justify-self: center;
        text-align: center;
        margin: 0;
        padding: 0 4px;
    }

    .terminal-bar-right {
        grid-area: time;
        justify-self: end;
        margin: 0;
    }

    #terminal {
        padding: 18px 12px 10px;
    }

    #command {
        padding: 14px 12px 16px;
    }

    #input-line {
        padding: 12px;
        gap: 8px;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .prompt-label {
        width: auto;
        margin-bottom: 0;
        font-size: 0.85em;
        flex: 0 0 auto;
    }

    #typer {
        flex: 1 1 auto;
        min-width: 0;
        word-break: break-word;
        white-space: normal;
        font-size: 0.9em;
    }

    .cursor {
        margin-top: 0;
        transform: scale(0.85);
    }

    #history {
        padding: 4px 0 8px;
    }

    #autocomplete {
        max-height: 140px;
    }

    .banner-line {
        font-size: 0.95em;
    }
}

#history::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#history::-webkit-scrollbar-track {
    display: none;
}

#history::-webkit-scrollbar-thumb {
    display: none;
}

#history::-webkit-scrollbar-thumb:hover {
    display: none;
}
