/* =====================================================================
   TERMINAL STYLES
   ---------------------------------------------------------------------
   To change the colours, edit the two blocks below:
     1. LIGHT MODE colours  – used when the visitor's system is in light mode
     2. DARK MODE colours   – used when the visitor's system is in dark mode

   Want the same colours for everyone (no light/dark switching)?
   Delete the whole "@media (prefers-color-scheme: dark)" block and only
   keep block 1.

   Colours can be written as hex (#ff0000), rgb(255, 0, 0) or names (red).
   ===================================================================== */


/* ---------- 1. LIGHT MODE colours ---------- */
:root {
    --bg: #FBF1C9;              /* page / terminal background            */
    --text: #3C3836;            /* normal text (command output)          */
    --border: #D79921;          /* frame around the terminal             */

    --prompt-user: #D79921;     /* "visitor"   in  visitor@Portfolio:~$  */
    --prompt-host: #98971A;     /* "Portfolio"                           */
    --prompt-path: #458588;     /* "~/Projekte" (current folder)         */
    --prompt-symbol: #7C6F64;   /* the "@", ":" and "$" characters       */

    --cmd-valid: #98971A;       /* what you type, when the command exists */
    --cmd-invalid: #CA2124;     /* what you type, when it does not exist  */
    --cursor: #3C3836;          /* blinking text cursor                  */

    --link: #458588;            /* clickable links                       */

    --scrollbar-track: #EBDBB2; /* scrollbar background                  */
    --scrollbar-thumb: #7C6F64; /* scrollbar handle                      */
    --scrollbar-hover: #D79921; /* scrollbar handle on mouse-over        */
}


/* ---------- 2. DARK MODE colours ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #2E3440;
        --text: #E5E9F0;
        --border: #5E81AC;

        --prompt-user: #5E81AC;
        --prompt-host: #A3BE8C;
        --prompt-path: #EBCB8B;
        --prompt-symbol: #88C0D0;

        --cmd-valid: #A3BE8C;
        --cmd-invalid: #BF616A;
        --cursor: #E5E9F0;

        --link: #EBCB8B;

        --scrollbar-track: #1E252E;
        --scrollbar-thumb: #EBDBB2;
        --scrollbar-hover: #FF8037;
    }
}


/* =====================================================================
   LAYOUT – you normally don't need to change anything below this line
   ===================================================================== */

* {
    box-sizing: border-box;
    /* Monospace font; the first one installed on the visitor's PC is used */
    font-family: 'Hack', 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;            /* text size on phones */
}

@media (min-width: 768px) {
    html,
    body {
        font-size: 16px;        /* text size on bigger screens */
    }
}

body {
    padding: 0.5rem;            /* gap between browser edge and frame */
}

/* The framed box that contains everything and scrolls */
#terminal {
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    border: 2px solid var(--border);
    border-radius: 4px;
}

/* One row: prompt on the left, command on the right */
.line {
    display: flex;
    gap: 0.5rem;
}

/* The prompt:  visitor@Portfolio:~$ */
.ps1 {
    flex-shrink: 0;
    white-space: nowrap;
}

.ps1 .user   { color: var(--prompt-user); }
.ps1 .host   { color: var(--prompt-host); }
.ps1 .path   { color: var(--prompt-path); }
.ps1 .symbol { color: var(--prompt-symbol); }

/* The text field you type into */
#prompt {
    flex-grow: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: inherit;
    color: var(--cmd-valid);
    caret-color: var(--cursor);
}

#prompt.invalid {
    color: var(--cmd-invalid);
}

/* A command that was already run (shown in the history) */
.cmd {
    flex-grow: 1;
    word-break: break-all;
}

/* The output printed under a command */
.output {
    margin: 0 0 0.5rem 0;
    white-space: pre-wrap;      /* keep line breaks and spaces (ASCII art) */
    line-height: normal;
}

.output:empty {
    margin: 0;
}

a {
    color: var(--link);
    text-decoration: underline;
}

/* Scrollbar (Firefox / Waterfox) */
#terminal {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Scrollbar (Chrome / Edge / Safari) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}
