/* Catppuccin Macchiato theme https://catppuccin.com/palette */
/* Edited to be a bit darker */
:root {
    --base: #282c3b;
    --mantle: #222535;
    --crust: #1d1f2e;

    /* Text colors */
    --text: #b6c0e5;

    /* Overlay colors */
    --surface0: #393d4f;
    --surface1: #474c62;

    /* Colors */
    --blue: #7b99d5;
    --lavender: #a7a9da;
    --red: #c96e72;
    --sky: #87bbc5;
}

body,
html {
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 0;
    font-size: 1rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--base);
    color: var(--text);
    overflow: hidden;
}

.header {
    background-color: var(--mantle);
    position: relative;
    color: var(--text);
    padding: 10px 20px;
    font-size: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--surface0);
}

.actions {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.button {
    background-color: var(--mantle);
    color: var(--mantle) !important;
    border: none;
    padding: 8px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s ease;
}

.icon-button:hover {
    background-color: var(--sky);
}

.dropdown {
    position: relative;
}

.settings-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: 4px;
    padding: 10px;
    z-index: 1000;
    width: 200px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.show {
    display: block;
}

.settings-menu label,
.settings-menu button {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.name {
    font-size: 2rem;

    background: linear-gradient(90deg, #c6a0f6 0%, #a8e6cf 100%);

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    background-clip: text;
    color: transparent;
}

.CodeMirror {
    border: 1px solid var(--crust);
    height: calc(100% - 2px);
    user-select: none;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.text {
    font-size: 1rem;
}

.ide {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: 100%;
}

.editor,
.repl {
    flex: 1;
    padding: 10px;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.editor {
    border-right: 2px solid var(--surface0);
    background-color: var(--base);
    height: 100%;
}

.repl {
    background-color: var(--mantle);
    overflow: auto;
}

.editor-container,
.repl-header {
    font-size: 1.2rem;
    color: var(--text);
    padding: 5px;
    font-weight: bold;
    margin-bottom: 10px;
    background-color: var(--crust);
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.output {
    white-space: pre-wrap;
    font-family: monospace;
    color: var(--text);
}

#mode-select {
    background-color: var(--crust);
    border: 3px solid var(--surface1);
    border-radius: 6px;
    color: var(--text);
}

#clear-memory,
#clear-console {
    background-color: var(--blue);
    color: var(--mantle);
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s ease;
}

#clear-memory:hover,
#clear-console:hover {
    background-color: var(--sky);
}

#redirect {
    text-decoration: none;
}

.menu-topic {
    margin: 0px 0px 10px 0px;
}

.icon {
    margin-left: 4px;
}

#editor-header {
    width: 100%;
}

.top-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    width: 100%;
    background-color: var(--lavender);
    color: var(--mantle);
    padding: 10px 20px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    animation: slideDown 0.5s forwards;
    max-height: 100px;
    align-items: center;
    text-align: center;
    transition: opacity 0.5s;
}

@keyframes slideDown {
    from {
        bottom: -100px;
        top: auto;
    }
    to {
        bottom: 0;
        top: auto;
    }
}

@keyframes slideDownMobile {
    from {
        bottom: auto;
        top: -100px;
    }
    to {
        bottom: auto;
        top: 0;
    }
}

.close-button {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--mantle);
    cursor: pointer;
    margin-right: 40px;
    margin-left: 5px;
    flex-shrink: 0;
}

::selection {
    background-color: var(--blue);
    color: var(--mantle);
}

@media (max-width: 768px) {
    .ide {
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .actions {
        position: fixed;
        top: calc(100% - 50px);
        gap: 20px;
    }

    body,
    html {
        font-size: 0.9rem;
    }

    .top-bar {
        top: -100px;
        bottom: auto;
        animation: slideDownMobile 0.5s forwards !important;
    }
}
