:root {
    --bg: #300A24;
    --fg: #EEEEEC;
    --fg-soft: #D3D7CF;
    --accent: #4E9A06;
    --accent-soft: #73C21D;
    --topbar-bg: #3D3846;
    --topbar-fg: #EEEEEC;
    --dot-close: #E95420;
    --dot-min: #F5C211;
    --dot-max: #38B44A;
    --path: #3465A4;
    background-image: url("img/ubuntuWallpaper.jpg");
    background-color:#702369;
}

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

body {
    width: 100vw;
    min-height: 100dvh;
    background-image: url("img/ubuntuWallpaper.jpg");
    color: var(--fg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Ubuntu Mono", "DejaVu Sans Mono", Consolas, Monaco, monospace;
    font-weight: bold;
    padding: 12px;
    overflow-y: hidden;
}

#center {
    width: 92vw;
    min-height: 320px;
}

/* unified button styles */
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--fg);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
    background: rgba(78, 154, 6, 0.12);
    border-color: var(--accent);
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
    background: rgba(78, 154, 6, 0.2);
}

/* input button */
input[type="file"] {
    color: var(--fg);
    display: inline-block;
    margin: 0;
}

input[type="file"]::file-selector-button {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--fg);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

input[type="file"]::file-selector-button:hover {
    background: rgba(78, 154, 6, 0.12);
    border-color: var(--accent);
}

input[type="file"]::file-selector-button:active {
    background: rgba(0, 255, 0, 0.2);
}

/* terminal container */
#terminalContainer {
    width: 100%;
    background-color:var(--bg);
    color: var(--fg-soft);
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 90dvh;
    min-height: 420px;
}

#topBar {
    width: 100%;
    height: 44px;
    background-color: var(--topbar-bg);
    border-radius:8px 8px 0px 0px;
    color: var(--topbar-fg);
    display: flex;
    align-items: center;
    padding: 0 8px;
    justify-content:space-between;
}

/* terminal inline input */
#inputTerminal {
    background-color: var(--bg);
    color: var(--fg);
    border-radius: 4px;
    border: 0px;
    width: auto;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.2;
    padding: 6px 8px;
    flex: 1 1 auto;
    min-width: 0;
    /* adjust for safari */
    -webkit-appearance: none;
    appearance: none;
    vertical-align: baseline;
    box-sizing: border-box;
}

#inputTerminal::placeholder {
    opacity: 0.8;
}

#inputTerminal:focus {
    outline: none;
}

#plan {
    padding: 1%;
    flex: 1;
    overflow: auto;
}

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

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

.prompt-line {
    display: flex;
    align-items: baseline;
    gap: 0;
    flex-wrap: nowrap;
    width: 100%;
    overflow: hidden;
}

/* ubuntu like controls */
.window-controls {
    display: flex;
    gap: 8px;
}

.window-controls .btn {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--topbar-fg);
    border: 1px solid rgba(238, 238, 236, 0.25);
    background: transparent;
    opacity: 0.8;
}

.window-controls .btn:hover {
    background: rgba(255, 255, 255, 0.08);
    opacity: 1;
}

.window-controls .btn span {
    font-size: 12px;
    line-height: 1;
}

.title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

#output {
    margin: 8px 0 8px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    max-height: 45vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

#outputContainer {
    display: none;
}

#outputTerminal {
    white-space: pre;
}

@media (max-width: 900px) {
    #center {
        width: 96vw;
    }
    #inputTerminal {
        width: min(80vw, 520px);
    }
    .title {
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 8px;
        font-weight: 600;
    }
    #center {
        width: 100%;
        min-height: 280px;
    }
    #terminalContainer {
        max-height: none;
        min-height: 340px;
    }
    #topBar {
        height: 40px;
        padding: 0 6px;
    }
    .window-controls .btn {
        width: 16px;
        height: 16px;
    }
    #plan {
        padding: 10px;
    }
    #inputTerminal {
        width: auto;
        font-size: inherit;
    }
    input[type="file"]::file-selector-button {
        padding: 8px 12px;
    }
    #output {
        max-height: 40vh;
        font-size: 12.5px;
    }
}

@media (min-width: 1024px) {
    #center {
        width: 800px;
    }
}