body, html {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--fg);
}

@view-transition {
    navigation: auto;
}

#app {
    view-transition-name: app;
}

::view-transition-group(*) {
    animation-duration: 0.25s;
}

:focus {
    border: 1px solid var(--fg4);
    outline: 1px dashed var(--purple);
}

#app {
    position: relative;
}

input, h1, h2, h3, h4, h5, h6, p, a, hr {
    all: unset;
}

h1, h2, h3, h4, h5, h6, p {
    display: block;
}

dialog { display: block; }
dialog:not(:target):not([open]) { display: none; }

/* Text */

h1 {
    font-size: var(--font-size-xl);
    margin: var(--gap-sm) 0 var(--gap-lg) 0;
    font-style: italic;
}

h2 {
    font-size: var(--font-size-lg);
    margin: var(--gap-sm) 0 var(--gap-md) 0;
    font-style: italic;
}

p {
    margin: 0 0 var(--gap-md);
}

ul, ol {
    margin: 0;
    margin-bottom: var(--gap-md);
}

hr {
    width: 100%;
    height: 1px;
    background-color: var(--bg2);
}

.a {
    text-decoration: underline;
    color: var(--purple);
    cursor: pointer;
}

.a:hover {
    color: var(--purple-dim);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-sb {
    font-weight: 600;
}

.text-b {
    font-weight: 700;
}

.text-i {
    font-style: italic;
}

.text-ellpise {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.muted {
    color: var(--gray)
}

.font-sm {
    font-size: 0.75rem;
}

.material-symbols-outlined {
    font-size: 1rem;
}

/* Components */

.bg-img {
    object-fit: cover;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0.1;
    pointer-events: none;
}

.card {
    background: var(--bg_h);
    border: 1px solid var(--fg4);
    padding: var(--gap-lg);
    border-radius: var(--radius);
}

.modal {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    color: var(--fg);
    display: flex;
    border: none;
    background: none;
    z-index: 100;
}

.modal-content {
    max-width: 600px;
    width: 100%;
    margin: 20vh auto auto;
    z-index: 1;
}

.modal-bg {
    background-color: var(--bg);
    opacity: 0.5;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.checkin-table {
    width: 100%;
    border-collapse: collapse; /* I still hate this but people like itm ore */
}

.checkin-table th {
    border-bottom: 1px solid var(--gray-dim);
    padding-bottom: var(--gap-md);
}

.checkin-table td {
    padding-top: var(--gap-md);
    padding-left: var(--gap-sm);
}

.name-field {
    width: 10em;
    max-width: 10em;
    border-right: 1px solid var(--gray-dim);
}

.name-field-bl {
    width: 10em;
    max-width: 10em;
}

.input-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--gap-lg);
}

.input-label {
    width: min(350px, 30%);
    margin-top: auto;
    margin-bottom: auto;
}

.input {
    flex: 1;
    background: var(--bg_h);
    border: 1px solid var(--fg4);
    border-radius: var(--radius);
    padding: var(--gap-md);
    color: var(--fg1);
}

.checkbox-expand {
    position: relative;
    max-height: 2.1em;
    height: 100%;
    background-color: transparent;
    border-radius: var(--radius);
    transition: all 0.2s ease-out;
    overflow: hidden;
}

.checkbox-expand>input[type="checkbox"] {
    position: absolute;
    top: 50%;
    right: 0;
}

.checkbox-expand>input[type="checkbox"].noshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: unset;
    max-height: unset;
    opacity: 0;
}

.checkbox-expand>span {
    display: block;
}

.checkbox-expand textarea {
    max-height: 1.3em;
    /*margin-left: calc(var(--gap-sm) * -1);*/
    width: calc(100% - var(--gap-md) * 2 - var(--gap-sm));
    transition: max-height 0.1s ease-out;
}

.checkbox-expand:has(>input[type="checkbox"]:checked) textarea,
.checkbox-expand:has(input:focus) textarea,
.checkbox-expand:has(textarea:focus) textarea {
    max-height: 6em;
}

.checkbox-expand:has(>input[type="checkbox"]:checked),
.checkbox-expand:has(input:focus),
.checkbox-expand:has(textarea:focus) {
    z-index: 10;
    max-height: unset;
}

.checkbox-expand:has(>input[type="checkbox"]:hover) {
    background-color: var(--bg2);
}

.checkbox-expand:has(>input[type="checkbox"]:checked)>.checkbox-expand-content {
    white-space: wrap;
}

.select-checkin:has(>option[value="0"]:checked) {
    color: var(--red-dim);
}

.select-checkin:has(option[value="1"]:checked) {
    color: var(--red);
}

.select-checkin:has(option[value="2"]:checked) {
    color: var(--orange-dim);
}

.select-checkin:has(option[value="3"]:checked) {
    color: var(--orange);
}

.select-checkin:has(option[value="4"]:checked) {
    color: var(--yellow-dim);
}

.select-checkin:has(option[value="5"]:checked) {
    color: var(--yellow);
}

.select-checkin:has(option[value="6"]:checked) {
    color: var(--green-dim);
}

.select-checkin:has(option[value="7"]:checked) {
    color: var(--green);
}

.select-checkin:has(option[value="8"]:checked) {
    color: var(--aqua);
}

.select-checkin:has(option[value="9"]:checked) {
    color: var(--blue);
}

.select-checkin:has(option[value="10"]:checked) {
    color: var(--blue-dim);
}

.select-presence:has(option[value="0"]:checked) {
    color: var(--green);
}

.select-presence:has(option[value="1"]:checked) {
    color: var(--yellow);
}

.select-presence:has(option[value="2"]:checked) {
    color: var(--green-dim);
}

.select-presence:has(option[value="3"]:checked) {
    color: var(--red);
}

.select-presence:has(option[value="4"]:checked) {
    color: var(--blue);
}

.select-checkin:has(option[value=""]:checked),
.select-presence:has(option[value=""]:checked) {
    color: var(--gray)
}

.select-role:has(option[value="-2"]:checked) {
    color: var(--red)
}

.select-role:has(option[value="-1"]:checked) {
    color: var(--yellow)
}

.select-role:has(option[value="0"]:checked) {
    color: var(--blue)
}

.select-role:has(option[value="1"]:checked) {
    color: var(--purple)
}

.select-role:has(option[value="68"]:checked) {
    color: var(--orange)
}

.select-role:has(option[value="69"]:checked) {
    color: var(--aqua)
}

.btn-card {
    transition: background-color 0.2s ease-out;
}

.btn-card:hover {
    background: var(--bg1);
}

.card-title {
    font-size: var(--font-size-lg);
}

.card-img {
    display: block;
    border-radius: var(--radius);
    object-fit: cover;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
}

.btn-gh {
    padding: var(--gap-sm);
    aspect-ratio: 1;
    border-radius: 100%;
    cursor: pointer;
    background-color: var(--fg);
    height: var(--font-size-xl);
}

.btn-gh > img {
    width: 100%;
    height: 100%;
}

.btn {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    border: 1px solid var(--fg4);
    padding: var(--gap-sm) var(--gap-md);
    border-radius: var(--radius);
    color: var(--fg);
    background: var(--bg_h);
    transition: background-color 0.2s ease-out;
}

.btn:hover {
    background: var(--bg2);
}

.btn:active {
    background: var(--bg3);
}

.btn-blue {
    background: var(--blue-dim);
}

.btn-blue:hover {
    background: var(--blue);
}

.btn-red {
    background: var(--red-dim);
}

.btn-red:hover {
    background: var(--red);
}

.btn-gray {
    background: var(--gray);
}

.btn-gray:hover {
    background: var(--gray-dim);
}

.btn-green {
    background: var(--green-dim);
}

.btn-green:hover {
    background: var(--green);
}

.icon {
    width: 24px;
    height: 24px;
}

.container-parent {
    max-width: 1000px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.container {
    margin-left: var(--gap-lg);
    margin-right: var(--gap-lg);
    width: calc(100% - var(--gap-lg) * 2);
}

.background-container {
    height: 100%;
    max-height: 50vh;
    overflow-y: scroll;
    overflow-x: hidden;
}

.danger-zone {
    padding: var(--gap-lg);
    border: 1px dashed var(--red-dim);
    border-radius: var(--radius);
}

.dashed-border {
    padding: var(--gap-lg);
    border: 1px dashed var(--gray);
    border-radius: var(--radius);
}

.stars > .icon {
    font-size: var(--font-size-md);
    width: var(--font-size-md);
    height: var(--font-size-md);
}

/* Navbar */

.nav-height {
    height: 42px;
}

.nav {
    z-index: 50;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: var(--gap-sm) var(--gap-lg);
    padding: var(--gap-sm);
    border-radius: 10000px;
    border: 1px solid var(--fg4);
    background: var(--bg_h);
}

.nav-group {
    flex: 1;
    display: flex;
    gap: var(--gap-sm);
    align-items: center;
}

.nav-user-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 100%;
}

.nav-button {
    color: var(--fg);
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0 var(--gap-md);
    border-radius: var(--radius);
    height: 100%;
    gap: var(--gap-sm);

    max-width: 100px;
    overflow: hidden;

    transition: background-color 0.2s ease-out;
}

.nav-button.active {
    text-decoration: underline;
}

.nav-button:hover {
    background: var(--bg2);
}

.nav-button:active {
    background: var(--bg3);
}

.breadcrumbs-separator {
    color: var(--gray-dim);
}

.spacer-sm {
    width: var(--gap-sm);
    height: var(--gap-sm);
}

.spacer-md {
    width: var(--gap-md);
    height: var(--gap-md);
}

.spacer-lg {
    width: var(--gap-lg);
    height: var(--gap-lg);
}

.spacer-xl {
    width: var(--gap-xl);
    height: var(--gap-xl);
}

/* Dropdown */

.dropdown {
    position: relative;
    background-color: var(--bg_h);
    border-radius: 1000px;
    margin-top: -4px;
    margin-bottom: -4px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.dropdown-content {
    display: flex;
    flex-direction: column;
    position: absolute;
    right: -5px;
    top: 50%;
    z-index: -1;
    opacity: 0;
    transform: scale(0.3);
    transform-origin: top right;
    padding: 24px var(--gap-md) var(--gap-md) var(--gap-md);
    overflow: hidden;
    background-color: var(--bg_h);
    gap: var(--gap-sm);
    transition: all 0.2s ease-out;

    border: 1px solid var(--fg4);
    border-top: none;
    border-radius: 16px 0 16px 16px;
}

.dropdown:hover .dropdown-content, .dropdown-content :focus {
    transform: scale(1);
    /*height: calc(100% + var(--gap-sm) * 2);*/
    opacity: 1;
}

.dropdown .nav-button {
    padding: 0 var(--gap-sm);
}

.hacky-icon {
    display: flex;
    position: relative;
}

.hacky-icon > input {
    padding-left: 2.2em;
}

.hacky-icon > .icon {
    position: absolute;
    height: 100%;
    display: flex;
    align-items: center;
    left: var(--gap-md);
    pointer-events: none;
}

.pick-bg-btn {
    position: absolute;
    right: var(--gap-lg);
    bottom: var(--gap-lg);
}

/* Utils */

.m-md {
    margin: var(--gap-md);
}

.mt-c {
    margin-top: 20vh;
}

.mb-lg {
    margin-bottom: var(--gap-lg);
}

.-mtr-md {
    margin-top: calc(var(--gap-md)*-1);
    margin-right: calc(var(--gap-md)*-1);
}

.my-auto {
    margin-top: auto;
    margin-bottom: auto;
}

.p-sm {
    padding: var(--gap-sm);
}

.px-0 {
    padding-left: 0;
    padding-right: 0;
}

.px-sm {
    padding-left: var(--gap-sm);
    padding-right: var(--gap-sm);
}

.px-md {
    padding-left: var(--gap-md);
    padding-right: var(--gap-md);
}

.px-lg {
    padding-left: var(--gap-lg);
    padding-right: var(--gap-lg);
}

.px-xl {
    padding-left: var(--gap-xl);
    padding-right: var(--gap-xl);
}

.pl-md {
    padding-left: var(--gap-md) !important;
}

.pl-lg {
    padding-left: var(--gap-lg) !important;
}

.g-md {
    gap: var(--gap-md);
}

.g-lg {
    gap: var(--gap-lg);
}

.w-full {
    width: 100%;
}

.max-w-om {
    width: 200px;
    max-width: 200px;
}

.h-full {
    height: 100%;
}

.h-screen {
    height: 100vh;
}

.r-full {
    border-radius: 10000px;
}

.c-xy, .c-y, .c-x {
    display: flex;
    flex-direction: column;
}

.c-xy, .c-x {
    align-items: center;
}

.c-xy, .c-y {
    justify-content: center;
}

.c-xy > *, .c-x > * {
    margin-left: auto;
    margin-right: auto;
}

.c-xy > *, c-y > * {
    margin-top: auto;
    margin-bottom: auto;
}

.horizontal {
    display: flex;
    flex-direction: row;
}

.vertical {
    display: flex;
    flex-direction: column;
}

.wrap {
    flex-wrap: wrap;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: end;
}

.flex-1 {
    flex: 1;
}

.grid {
    display: grid;
}

.row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ratio-43 {
    aspect-ratio: 4/3;
}

.b-none {
    border: none;
}

.rounded {
    border-radius: var(--radius);
}

.cover {
    object-fit: cover;
}

.no-resize {
    resize: none;
}

.relative {
    position: relative;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.absolute {
    position: absolute;
}

.pointer {
    cursor: pointer;
}

/* overrides */

.checkbox-expand.absolute {
    top: 0.4rem;
    overflow: unset;
}
