:root {
    --background: #0f172a;
    --foreground: #1e293b;
    --border: #334155;
    --primary: #f8fafc;
    --secondary: #94a3b8;
    --accent1: #6366f1;
    --accent2: #4f46e5;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    * {
        box-sizing: border-box;
    }
    overflow: hidden;
    background: var(--background);
    color: var(--primary);
}

body {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: auto auto;
    width: min(1200px, calc(100vw - 32px));
    max-height: 100vh;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
}

main {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 4px;
}

#messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.message {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    width: 100%;
    .header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        font-weight: bold;
        padding: 4px;
        border: 1px solid var(--border);
        background: var(--foreground);
        div {
            flex: 0 0 calc(100%/3);
        }
        div:nth-of-type(1) {
            text-align: left;
        }
        div:nth-of-type(2) {
            text-align: center;
        }
        div:nth-of-type(3) {
            text-align: right;
        }
    }
    .content {
        padding: 4px;
    }
}

textarea {
    width: 100%;
}

.ticket {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: var(--foreground);
    border: 1px solid var(--border);
    .ticket-head, .ticket-body, .ticket-foot {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-content: center;
        outline: 1px solid var(--border);
        padding: 4px;
        div {
            flex: 0 0 calc(100%/3);
            text-align: center;
            align-content: center;
        }
        div:nth-of-type(1) {
            text-align: left;
        }
        div:nth-of-type(2) {
            text-align: center;
        }
        div:nth-of-type(3) {
            text-align: right;
        }
    }
    .ticket-body {
        font-size: 1.5em;
    }
}

.ticket:hover {
    background: var(--accent2);
}

.ticket:link,.ticket:visited {
    color: var(--primary);
}

#ticketList {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 16px;
}

#toast {
    position: absolute;
    top: -32px;
    right: 32px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-32px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 256px;
    min-height: 32px;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

#toast.error {
    background: red;
    color: white;
}

#toast.warn {
    background: yellow;
    color: black;
}

#toast.success {
    background: green;
    color: var(--primary);
}

#toast.show {
    opacity: 1;
    transform: translateY(64px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

nav {
    display: flex;
    flex-direction: row;
    height: 32px;
    border: 1px solid var(--border);
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    a {
        flex: 0 0 auto;
        text-decoration: none;
        background: var(--foreground);
        padding: 4px;
        font-size: 16px;
        width: auto;
        height: 100%;
    }
    a:link, a:visited{
        color: var(--primary);
    }
    a:hover {
        background: var(--accent2);
        cursor: pointer;
    }
}

input,textarea,select,option,button {
    background: var(--foreground);
    border: 1px solid var(--border);
    color: var(--primary);
}

button:hover {
    background: var(--accent2);
    cursor: pointer;
}

form {
    border: 1px solid var(--border);
    padding: 4px;
    line-height: 1.5em;
    button[type="submit"] {
        display: block;
        margin: auto auto;
    }
}

.ticketHeader {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    background: var(--foreground);
    border: 1px solid var(--border);

    div {
        display: flex;
        flex-direction: row;
        flex: 0 1 auto;
        text-align: center;
        justify-content: space-between;
        outline: 1px solid var(--border);
        padding: 4px;
        div {
            flex: 0 0 calc(100%/3);
            outline: 0;
        }
        .ticketDate {
            text-align: left;
            justify-content: left;
        }
        .ticketSubmitter {
            text-align: center;
            justify-content: center;
        }
        .ticketStatus {
            text-align: right;
            justify-content: right;
        }
    }

    .ticketTitle {
        justify-content: center;
        font-size: 2em;
    }
}

textarea {
    height: 4lh;
}

.filtersContainer {
    border: 1px solid var(--border);
    background: var(--foreground);
    margin-bottom: 16px;
    h2 {
        margin: 0;
        padding: 4px;
    }
}

.filters {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--background);
    padding: 4px;
}

.filtersHeader {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#submitTicket {
    display: flex;
    height: 64px;
    width: 128px;
    text-align: center;
    text-decoration: none;
    align-items: center;
    justify-content: center;
    justify-self: center;
    align-self: center;
    border: 1px solid var(--border);
    background: var(--foreground);
    margin-bottom: 8px;
}

#submitTicket:link, #submitTicket:visited{
    color: var(--primary);
}

#submitTicket:hover {
    background: var(--accent2);
    cursor: pointer;
}

.inline {
    display: inline;
}

.helpdeskHeader {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 32px;
}

table, tr, th, td {
    border: 1px solid var(--border);
    border-collapse: collapse;
}

th, td {
    padding: 4px;
}