* {
    box-sizing: border-box;
}

:root {
    --background: #181818;
    --background-2: #1e1e1e;
    --background-3: #252526;
    --background-4: #2d2d30;

    --border: #303030;

    --text: #cccccc;
    --muted: #858585;

    --blue: #0078d4;
    --blue-hover: #1689dc;

    --sidebar: 245px;
    --activity: 52px;
    --preview: 42%;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;

    overflow: hidden;

    background: var(--background);
    color: var(--text);

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    outline: 0;

    background: none;

    color: inherit;

    cursor: pointer;
}

svg {
    width: 17px;
    height: 17px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* TOPBAR */

.topbar {
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    position: relative;

    background: #181818;

    border-bottom: 1px solid var(--border);

    user-select: none;
}

.topbar-left,
.topbar-right {
    height: 100%;

    display: flex;
    align-items: center;
}

.menu-button {
    width: 48px;
    height: 100%;

    display: grid;
    place-items: center;

    color: #aaa;
}

.menu-button:hover {
    background: #292929;
}

.brand {
    display: flex;
    align-items: center;

    gap: 9px;

    padding-right: 18px;

    font-size: 13px;

    color: #ddd;
}

.brand-mark {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    border-radius: 5px;

    background: #0078d4;

    color: white;

    font-size: 13px;
    font-weight: 700;
}

.menu {
    display: flex;
    align-items: center;

    gap: 2px;
}

.menu button {
    padding: 7px 9px;

    border-radius: 4px;

    color: #999;

    font-size: 12px;
}

.menu button:hover {
    background: #292929;
    color: white;
}

.workspace {
    position: absolute;

    left: 50%;

    transform: translateX(-50%);

    min-width: 210px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid #343434;

    border-radius: 6px;

    background: #202020;

    color: #999;

    font-size: 12px;
}

.workspace-status {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #777;
}

.topbar-right {
    gap: 6px;

    padding-right: 9px;
}

.top-icon {
    width: 34px;
    height: 32px;

    display: grid;
    place-items: center;

    border-radius: 5px;

    color: #999;
}

.top-icon:hover {
    background: #292929;
    color: white;
}

.run-button,
.publish-button {
    height: 32px;

    display: flex;
    align-items: center;

    gap: 7px;

    padding: 0 12px;

    border-radius: 5px;

    font-size: 12px;
}

.run-button {
    background: #292929;

    border: 1px solid #3b3b3b;

    color: #ccc;
}

.run-button:hover {
    background: #333;
}

.publish-button {
    background: var(--blue);

    color: white;

    font-weight: 600;
}

.publish-button:hover {
    background: var(--blue-hover);
}


/* MAIN */

.main {
    height: calc(100vh - 50px);

    display: flex;

    min-width: 0;
}


/* ACTIVITY */

.activity-bar {
    width: var(--activity);

    flex-shrink: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    background: #181818;

    border-right: 1px solid var(--border);
}

.activity-button {
    width: 52px;
    height: 52px;

    position: relative;

    display: grid;
    place-items: center;

    color: #777;
}

.activity-button:hover {
    color: #ddd;
}

.activity-button.active {
    color: white;
}

.activity-button.active::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 2px;

    background: white;
}

.activity-bottom {
    margin-top: auto;
}


/* EXPLORER */

.explorer {
    width: var(--sidebar);

    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    background: #181818;

    border-right: 1px solid var(--border);
}

.explorer-header {
    height: 45px;

    padding: 0 13px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #aaa;

    font-size: 11px;
    letter-spacing: .5px;
}

.explorer-header button {
    width: 25px;
    height: 25px;

    border-radius: 4px;

    color: #aaa;

    font-size: 19px;
}

.explorer-header button:hover {
    background: #292929;

    color: white;
}

.project-folder {
    height: 31px;

    padding: 0 10px;

    display: flex;
    align-items: center;

    gap: 5px;

    color: #ddd;

    font-size: 11px;
    font-weight: 600;
}

.folder-arrow {
    display: grid;
    place-items: center;

    color: #999;
}

.folder-arrow svg {
    width: 13px;
    height: 13px;
}

.folder-icon {
    width: 15px;
    height: 15px;

    fill: none;

    stroke: #d6a84b;
    stroke-width: 1.5;
}

.file {
    width: 100%;
    height: 30px;

    padding: 0 13px 0 30px;

    display: flex;
    align-items: center;

    gap: 9px;

    text-align: left;

    color: #aaa;

    font-size: 12px;
}

.file:hover {
    background: #252526;

    color: white;
}

.file.active {
    background: #37373d;

    color: white;
}

.file-type {
    width: 18px;

    text-align: center;

    font-weight: 700;

    font-size: 11px;
}

.file-type.html {
    color: #e44d26;
}

.file-type.css {
    color: #379ad6;
}

.file-type.js {
    color: #f7df1e;

    font-size: 8px;
}

.explorer-section {
    margin-top: 10px;

    border-top: 1px solid #292929;
}

.section-title {
    height: 35px;

    padding: 0 13px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #999;

    font-size: 10px;
}

.empty-outline {
    padding: 5px 20px;

    color: #666;

    font-size: 11px;
}


/* EDITOR */

.editor-section {
    min-width: 350px;

    flex: 1;

    display: flex;
    flex-direction: column;

    background: #1e1e1e;
}

.tabs {
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: stretch;

    background: #181818;
}

.tab {
    min-width: 145px;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 0 11px;

    background: #181818;

    border-right: 1px solid #292929;

    color: #777;

    font-size: 12px;
}

.tab:hover {
    color: #ccc;
}

.tab.active {
    background: #1e1e1e;

    border-top: 1px solid var(--blue);

    color: #ddd;
}

.tab-file-icon {
    width: 17px;

    text-align: center;

    font-size: 10px;
    font-weight: 700;
}

.tab-file-icon.html {
    color: #e44d26;
}

.tab-file-icon.css {
    color: #379ad6;
}

.tab-file-icon.js {
    color: #f7df1e;

    font-size: 8px;
}

.tab-close {
    margin-left: auto;

    color: #777;

    font-size: 15px;
}

.tab:hover .tab-close {
    color: white;
}

.breadcrumbs {
    height: 29px;

    flex-shrink: 0;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 0 15px;

    border-bottom: 1px solid #292929;

    color: #777;

    font-size: 11px;
}

#editor {
    flex: 1;

    min-height: 0;
}

.status-bar {
    height: 23px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #007acc;

    color: white;

    font-size: 10px;
}

.status-left,
.status-right {
    height: 100%;

    display: flex;
    align-items: center;

    gap: 14px;

    padding: 0 10px;
}

.status-right {
    gap: 18px;
}


/* PREVIEW */

.preview {
    width: var(--preview);

    min-width: 300px;

    display: flex;
    flex-direction: column;

    background: #101010;

    border-left: 1px solid #303030;
}

.preview-header {
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 12px;

    background: #181818;

    border-bottom: 1px solid #303030;
}

.preview-name {
    display: flex;
    align-items: center;

    gap: 7px;

    color: #bbb;

    font-size: 10px;
    font-weight: 600;

    letter-spacing: .4px;
}

.live-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #45c95b;

    box-shadow: 0 0 8px rgba(69, 201, 91, .5);
}

.preview-tools {
    display: flex;
    align-items: center;

    gap: 2px;
}

.preview-tools button {
    width: 27px;
    height: 27px;

    display: grid;
    place-items: center;

    border-radius: 4px;

    color: #888;
}

.preview-tools button:hover {
    background: #292929;

    color: white;
}

.preview-tools svg {
    width: 15px;
    height: 15px;
}

.browser {
    flex: 1;

    min-height: 0;

    display: flex;
    flex-direction: column;

    margin: 10px;

    overflow: hidden;

    border: 1px solid #333;

    border-radius: 8px;

    background: white;
}

.browser-toolbar {
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;

    gap: 4px;

    padding: 0 7px;

    background: #242424;

    border-bottom: 1px solid #333;
}

.browser-toolbar > button {
    width: 27px;
    height: 27px;

    display: grid;
    place-items: center;

    border-radius: 4px;

    color: #888;
}

.browser-toolbar > button:hover {
    background: #333;

    color: white;
}

.browser-toolbar svg {
    width: 14px;
    height: 14px;
}

.address-bar {
    flex: 1;

    height: 27px;

    display: flex;
    align-items: center;

    gap: 7px;

    padding: 0 9px;

    background: #181818;

    border: 1px solid #353535;

    border-radius: 5px;

    color: #888;

    font-size: 10px;
}

.address-bar svg {
    width: 12px;
    height: 12px;
}

#previewFrame {
    width: 100%;
    height: 100%;

    flex: 1;

    border: none;

    background: white;
}


/* MODAL */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, .65);

    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 480px;

    overflow: hidden;

    border: 1px solid #444;

    border-radius: 8px;

    background: #252526;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, .6);

    animation: modalIn .18s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;

    padding: 21px;

    border-bottom: 1px solid #383838;
}

.modal-header h2 {
    margin: 0;

    color: white;

    font-size: 18px;
}

.modal-header p {
    margin: 5px 0 0;

    color: #888;

    font-size: 12px;
}

.close-modal {
    width: 28px;
    height: 28px;

    border-radius: 5px;

    color: #888;

    font-size: 20px;
}

.close-modal:hover {
    background: #333;

    color: white;
}

.publish-content {
    padding: 18px 21px;
}

.visibility-title {
    margin-bottom: 8px;

    color: #bbb;

    font-size: 12px;
}

.visibility-option {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px;

    margin-bottom: 8px;

    border: 1px solid #3b3b3b;

    border-radius: 6px;

    cursor: pointer;
}

.visibility-option:hover {
    background: #2b2b2c;
}

.visibility-option.selected {
    border-color: #0078d4;

    background: rgba(0, 120, 212, .08);
}

.visibility-option input {
    display: none;
}

.visibility-icon {
    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    border-radius: 6px;

    background: #303030;

    color: #aaa;
}

.visibility-icon svg {
    width: 18px;
    height: 18px;
}

.visibility-option strong {
    display: block;

    margin-bottom: 3px;

    color: #ddd;

    font-size: 13px;
}

.visibility-option span {
    display: block;

    color: #888;

    font-size: 11px;
}

.field {
    margin-top: 17px;
}

.field label {
    display: block;

    margin-bottom: 7px;

    color: #bbb;

    font-size: 12px;
}

.slug-input {
    height: 39px;

    display: flex;
    align-items: center;

    overflow: hidden;

    border: 1px solid #444;

    border-radius: 5px;

    background: #181818;
}

.slug-input:focus-within {
    border-color: #0078d4;
}

.slug-input span {
    height: 100%;

    display: flex;
    align-items: center;

    padding: 0 9px;

    color: #777;

    font-size: 12px;

    border-right: 1px solid #383838;
}

.slug-input input {
    width: 100%;
    height: 100%;

    padding: 0 10px;

    outline: none;

    border: none;

    background: transparent;

    color: white;

    font-size: 12px;
}

.field small {
    display: block;

    margin-top: 6px;

    color: #666;

    font-size: 10px;
}

.url-card {
    margin-top: 17px;

    padding: 11px 12px;

    display: flex;
    flex-direction: column;

    gap: 4px;

    border: 1px solid #333;

    border-radius: 5px;

    background: #1b1b1b;
}

.url-card span {
    color: #777;

    font-size: 10px;
}

.url-card strong {
    color: #4db8ff;

    font-size: 12px;

    font-weight: 500;
}

.edit-token-info {
    margin-top: 12px;

    padding: 9px 10px;

    border-radius: 5px;

    background: rgba(255, 193, 7, .06);

    border: 1px solid rgba(255, 193, 7, .12);

    color: #9d906c;

    font-size: 10px;

    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;

    gap: 8px;

    padding: 14px 21px;

    border-top: 1px solid #383838;
}

.cancel,
.confirm {
    height: 34px;

    padding: 0 14px;

    border-radius: 5px;

    font-size: 12px;
}

.cancel {
    background: #333;

    color: #ccc;
}

.cancel:hover {
    background: #3d3d3d;
}

.confirm {
    display: flex;
    align-items: center;

    gap: 7px;

    background: #0078d4;

    color: white;

    font-weight: 600;
}

.confirm:hover {
    background: #1689dc;
}

.confirm svg {
    width: 14px;
    height: 14px;
}


/* TOAST */

.toast {
    position: fixed;

    right: 22px;
    bottom: 30px;

    z-index: 2000;

    min-width: 275px;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 13px 15px;

    border: 1px solid #454545;

    border-radius: 7px;

    background: #252526;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, .5);

    transform: translateY(100px);

    opacity: 0;

    pointer-events: none;

    transition: .25s ease;
}

.toast.show {
    transform: translateY(0);

    opacity: 1;
}

.toast-icon {
    width: 27px;
    height: 27px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #168b4c;

    color: white;

    font-size: 12px;
}

.toast.error .toast-icon {
    background: #b83b3b;
}

.toast div:last-child {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.toast strong {
    color: white;

    font-size: 12px;
}

.toast span {
    color: #999;

    font-size: 10px;
}


/* MOBILE */

@media (max-width: 1100px) {

    .preview {
        display: none;
    }

}

@media (max-width: 800px) {

    .explorer {
        width: 200px;
    }

    .menu {
        display: none;
    }

    .workspace {
        display: none;
    }

}

@media (max-width: 600px) {

    .explorer {
        display: none;
    }

    .activity-bar {
        display: none;
    }

    .topbar {
        height: 48px;
    }

    .main {
        height: calc(100vh - 48px);
    }

    .modal {
        width: calc(100vw - 30px);
    }

}