@font-face
{
    font-family: "Adwaita Mono";
    src: url("fonts/mono/AdwaitaMono-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face
{
    font-family: "Adwaita Mono";
    src: url("fonts/mono/AdwaitaMono-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face
{
    font-family: "Adwaita Mono";
    src: url("fonts/mono/AdwaitaMono-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face
{
    font-family: "Adwaita Mono";
    src: url("fonts/mono/AdwaitaMono-BoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face
{
    font-family: "Adwaita Sans";
    src: url("fonts/sans/AdwaitaSans-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face
{
    font-family: "Adwaita Sans";
    src: url("fonts/sans/AdwaitaSans-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root
{
    --font-mono: "Adwaita Mono", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
    --font-sans: "Adwaita Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --color-surface: rgb(5,5,5);
    --color-surface2: rgb(17,17,19);
    --color-surface3: rgb(25,25,25);
    --color-surface4: rgb(30,30,30);

    --color-green: #26a269;
    --color-orange: #ffa348;
    --color-red: #ed333b;
    --color-blue: #3584e4;
    --color-blue2: #62a0ea;
    --color-yellow: #f8e45c;

    --color-svg: #e9e9e9;
    --color-hover: #434347;
    --color-transp-hover: rgba(52, 52, 55, 0.6);
    --color-text2: rgba(233, 233, 233, 0.9);

    --animation: 250ms;
    --padding-s: 8px;
    --padding: 15px;
    --border: 4px;
}

button
{
    all: unset;
    cursor: pointer;
    transition: var(--animation);
}

input
{
    all: unset;
    cursor: text;
}

button:hover, .job:hover, .job-button:hover
{
    background: var(--color-transp-hover);
}

path
{
    stroke: rgb(255,255,255);
}

html
{
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--color-svg);
}

body
{
    background: var(--color-surface);
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
    align-items: center;
}

#Header
{
    display: flex;
    width: 100%;
    height: 100%;
    place-content: center;
    align-items: center;
}

#Header
{
    gap: var(--padding-s);
    height: 45px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-surface2);
}

#Content
{
    max-width: 740px;
    width: 70%;
    height: calc(100vh - 45px);
    padding: 5% 0;
}

.header-button
{
    display: flex;
    align-items: center;
    place-content: center;
    padding: var(--padding-s);
    width: 150px;
    font-weight: bold;
    gap: var(--padding-s);
    transition: var(--animation);
}

.header-button.selected
{
    background: var(--color-surface2);
}

.Content-Tab
{
    display: none;
    width: 100%;
    height: 100%;
    border: 1px solid var(--color-surface2);
    flex-direction: column;
}

.Content-Tab.selected
{
    display: flex;
    box-sizing: border-box;
}

#job-tools
{
    display: flex;
    background: var(--color-surface2);
    width: 100%;
    height: fit-content;
    place-content: end;
}

.job-button
{
    display: flex;
    gap: var(--padding-s);
    align-items: center;
    padding: var(--padding-s) var(--padding);
    transition: var(--animation);
    cursor: pointer;
    position: relative;
    user-select: none;
}

#filter-popup
{
    display: none;
    border: 1px solid var(--color-surface3);
    background: var(--color-surface2);
    text-align: center;
    flex-direction: column;
    position: absolute;
    top: calc(100% + var(--padding-s));
    right: var(--padding-s);
    z-index: 2;
    user-select: none;
}

#filter-popup button
{
    padding: var(--padding-s);
    width: 120px;
}

#Filter.selected, #Add.selected, .job-category.selected
{
    background: var(--color-surface3);
}

#Filter.selected #filter-popup
{
    display: flex;
}

#add-popup
{
    display: none;
    background: var(--color-surface2);
    border: 1px solid var(--color-surface3);
    position: absolute;
    top: calc(100% + var(--padding-s));
    left: -50%;
    z-index: 2;
}

#add-popup button
{
    padding: var(--padding-s);
    background: var(--color-blue);
    transition: var(--animation);
}

#add-popup button:hover
{
    background: var(--color-blue2);
}

#add-popup input
{
    padding: 2px 6px;
    width: 200px;
}

#Add.selected #add-popup
{
    display: flex;
}

#active-jobs
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--padding);
    padding: var(--padding);
}

.job
{
    min-width: 0;
    height: 68px;
    background: var(--color-surface2);
    padding: var(--padding-s);
    display: flex;
    flex-direction: column;
    transition: var(--animation);
    cursor: pointer;
    gap: var(--padding-s);
    overflow: hidden;
    border: 1px solid var(--color-surface3);
}

.job-wrap
{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.job-name
{
    padding: 2px 6px;
    font-weight: bold;
    width: fit-content;
}

.job-status
{
    background: var(--color-green);
    width: 8px;
    height: 8px;
    border-radius: 99px;
}

.job-desc
{
    padding: 0 6px;
    margin-bottom: 2px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.job-desc>span:last-child
{
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-list
{
    display: flex;
    flex-direction: column;
}

.job-open
{
    display: none;
    flex-direction: column;
    height: 100%;
}

.job-open.selected
{
    display: flex;
}

.Content-Tab:has(.job-open.selected) > .job-list
{
    display: none;
}

.job-actions
{
    display: flex;
    background: var(--color-surface2);
    width: 100%;
    height: fit-content;
    justify-content: space-between;
}

.job-open textarea
{
    all: unset;
    padding: var(--padding);
    box-sizing: border-box;
    overflow-y: scroll;
    overflow-x: hidden;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    height: 100%;
    cursor: text;
}

#attachments
{
    display: flex;
    align-items: center;
    place-content: center;
    border-top: 1px solid var(--color-surface2);
    border-bottom: 1px solid transparent;
    position: relative;
}

#attachments.opened
{
    border-bottom: 1px solid var(--color-surface2);
}

#attachments.opened #attachments-updown
{
    transform: rotate(180deg);
}

#attachments-updown
{
    position: absolute;
    right: var(--padding);
}

.attachments-list
{
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    align-items: center;
    gap: var(--padding-s);
    overflow: hidden;

    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: var(--padding);
    padding-right: var(--padding);

    transition: 250ms;
}

.attachments-list.opened
{
    max-height: calc(50vh - var(--padding) * 3);
    padding-top: var(--padding);
    padding-bottom: var(--padding);
}

.Attachment
{
    width: 500px;
    padding: var(--padding-s);
    user-select: none;
    cursor: pointer;
    transition: var(--animation);
    text-align: center;
}

.Attachment:hover
{
    background: var(--color-transp-hover);
}

#Delete:hover
{
    background: #f66151;
}

.job-edit
{
    display: flex;
    align-items: center;
    gap: var(--padding-s);
}

.job-modifiers
{
    display: flex;
    align-items: center;
    gap: var(--padding);
}

#Category
{
    min-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

#Category[contenteditable="true"]
{
    outline: none;
    cursor: text;
    user-select: text;
    text-overflow: clip;
    border-bottom: 1px solid var(--color-blue);
}

#Status
{
    width: 8px;
    height: 8px;
    border-radius: 99px;
    cursor: pointer;
}

#Status.done
{
    background: var(--color-green);
}

#Status.pending
{
    background: var(--color-yellow);
}

.job-category
{
    position: relative;
}

#cat-popup
{
    display: none;
    position: absolute;
    border: 1px solid var(--color-surface3);
    text-align: center;
    flex-direction: column;
    top: calc(100% + var(--padding-s));
    left: -25%;
    z-index: 2;
}

#cat-popup button
{
    padding: var(--padding-s);
    width: 120px;
}

.job-button.selected #cat-popup
{
    display: flex;
}

#attachment-preview
{
    width: min(900px, 90vw);
    max-width: 90vw;
    max-height: 90vh;
    padding: 0;
    background: var(--color-surface);
    color: var(--color-svg);
    border: 1px solid var(--color-surface4);
    overflow: hidden;
}

#attachment-preview[open]
{
    display: flex;
    flex-direction: column;
}

#attachment-preview::backdrop
{
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.preview-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface2);
    border-bottom: 1px solid var(--color-surface3);
}

#preview-name
{
    padding: var(--padding);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.preview-actions
{
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

#preview-download, #preview-close
{
    all: unset;
    display: flex;
    align-items: center;
    gap: var(--padding-s);
    padding: var(--padding-s) var(--padding);
    cursor: pointer;
    transition: var(--animation);
}

#preview-download:hover
{
    background: var(--color-transp-hover);
}

#preview-close:hover
{
    background: var(--color-red);
}

.preview-content
{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60vh;
    overflow: hidden;
    background: var(--color-surface);
}

#preview-image
{
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    user-select: none;
    transition: transform var(--animation);
}

#preview-image.zoomed
{
    transform: scale(2.5);
    cursor: zoom-out;
}

#preview-generic
{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--padding);
    padding: var(--padding);
    min-width: 0;
}

#preview-generic svg
{
    opacity: 0.6;
}

#preview-extension
{
    background: var(--color-surface3);
    padding: 4px var(--padding-s);
    font-weight: bold;
}

#preview-generic-name
{
    color: var(--color-text2);
    text-align: center;
    overflow-wrap: anywhere;
}

#preview-image[hidden],
#preview-generic[hidden]
{
    display: none;
}