@import "/static/efficient-ui/MASTER.css";

:root {
    --gap-navbar: 1rem;
    --width-navbar-button: 0;
    --text-soft: #000000C0;
    --text-softer: #0000009A;
    --text-faint: #00000066;
    --color-shape-label: #0097A7;                    --color-shape-label-text: #ffffff;
    --shadow-card-inset: inset 0 3px 6px -4px rgba(0, 0, 0, 0.12), inset 0 3px 6px 0 rgba(0, 0, 0, 0.24), inset 0 1px 4px 0 rgba(0, 0, 0, 0.12);
    /*view-transition-name: root;*/
}

nav {
    /*view-transition-name: nav;*/
}

p {
    color: var(--text-soft);
}

iconify-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
}

:is(#shape-selector, #shape-options) > button > iconify-icon {
    font-size: 2rem;
}

#annotation-zone, .annotation-zone {
    position: relative;
    user-select: none;
}

#annotation-image, .annotation-image {
    user-drag: none;
    -webkit-user-drag: none;
    image-rendering: pixelated;
}

#annotation-zone > svg, .annotation-zone > svg {
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.annotation-ruler {
    z-index: 2;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--color-accent);
    display: none;
}

#annotation-ruler-horizontal, #annotation-ruler-horizontal-secondary {
    height: 1px;
    width: 100%;
}

#annotation-ruler-vertical, #annotation-ruler-vertical-secondary {
    width: 1px;
    height: 100%;
}

.shape {
    stroke: var(--color-accent);
    fill: var(--color-accent);
    fill-opacity: 0.1;
    stroke-width: 2px;
    vector-effect: non-scaling-stroke;
    pointer-events: auto;
    transition: filter 0.25s cubic-bezier(0.61, 1, 0.88, 1),
                fill-opacity 0.25s cubic-bezier(0.61, 1, 0.88, 1),
                stroke-width 0.25s cubic-bezier(0.61, 1, 0.88, 1);
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.shape-polyline {
    fill: none;
}

.shape-point {
    stroke: var(--color-accent);
    stroke-width: 2px;
    fill-opacity: 1;
    r: 2;
    transition: r 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                stroke-width 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.25s cubic-bezier(0.61, 1, 0.88, 1);
}

.shape.selected {
    fill-opacity: 0.2;
    stroke-width: 4px;
    filter: drop-shadow(0 0 2px var(--text-soft));
}

.shape-point.selected {
    fill-opacity: 1;
    r: 6;
    stroke-width: 6px;
}

.shape-container, .shape-container-viewonly {
    pointer-events: none;
}

#annotation-helper-message {
    min-height: 2lh;
}

.shape-container-viewonly > .shape, .thumbnail-list > li .shape {
    fill: var(--color-info);
    stroke: var(--color-info);
    fill-opacity: 0;
    stroke-opacity: 0;
    transition: fill-opacity 0.25s cubic-bezier(0.61, 1, 0.88, 1),
                stroke-opacity 0.25s cubic-bezier(0.61, 1, 0.88, 1);
}

.shape-container-viewonly > .shape-polyline, .thumbnail-list > li .shape-polyline {
    fill: none;
}

.shape-container-viewonly > .shape-point, .thumbnail-list > li .shape-point {
    stroke: var(--color-info);
    transition: r 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                stroke-width 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.25s cubic-bezier(0.61, 1, 0.88, 1);
}

.shape-label {
    position: absolute;
    font-weight: 500;
    color: var(--color-shape-label-text) !important;
    pointer-events: auto;
    height: 28px;
    padding-left: 8px;
    padding-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-shape-label);
    width: max-content;
    box-shadow: var(--shadow-button);
    /* top-left corner is square to point to the shape */
    border-radius: 0 16px 16px 16px;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.61, 1, 0.88, 1),
                transform 0.375s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(0);
    transform-origin: top left;
    z-index: 3;
    text-decoration: none;
}

.shape-label:hover {
    text-decoration: underline;
}

/* Only show region parts when checkbox is checked */
#annotation-zone:has(+ x-buttonbox #show-objects:checked) > .shape-label {
    opacity: 1;
    transform: scale(1);
}

/* Hide points with a bubble */
#annotation-zone:has(+ x-buttonbox #show-objects:checked) > .shape-container-viewonly > .shape-point:has(+ foreignObject) {
    r: 0;
    border-width: 0;
}

#annotation-zone:has(+ x-buttonbox #show-shapes:checked) > .shape-container-viewonly > .shape {
    fill-opacity: 0.1;
    stroke-opacity: 1;
}

.thumbnail-list > li:is(:hover, :focus, :has(:focus)) .shape {
    fill-opacity: 0.2;
    stroke-opacity: 1;
}

/* Disabled for now, until there is more navigation that would benefit from transitions */
/*
@view-transition {
    navigation: auto;
}

@keyframes move-out {
    from {
        transform: translateX(0%);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes move-in {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0%);
    }
}

@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 0.25s;
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }

    ::view-transition-old(root) {
        animation-name: move-out;
    }

    ::view-transition-new(root) {
        animation-name: move-in;
    }
}
*/

.multi-select, .single-select {
    display: flex;
    flex-flow: column nowrap;
    overflow-y: scroll;
    box-shadow: var(--shadow-card-inset);
    padding: 16px;
    gap: 8px;
}

.licence-selection, .image-type-selection {
    display: flex;
    flex-flow: column nowrap;
}

.licence-selection-info, .image-type-selection-info {
    margin-left: calc(var(--size-checkbox) + var(--gap-label-checkbox));
    /* Align with the checkbox above */
}

.licence-selection-info > p, .image-type-selection-info > p {
    font-weight: 300;
}

.licence-logo {
    width: 128px;
    float: right;
    margin-left: 1ch;
}

.licence-title, .image-type-title {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.licence-title > .licence-name, .image-type-title > .image-type-name {
    font: var(--h5-font);
    font-weight: 400;
}

.icon-explainer {
    display: grid;
    gap: 4px 8px;
    grid-template-columns: auto 1fr;
    align-items: center;
}

.icon-explainer *:nth-child(even) {
    font-weight: 300;
}

.required-asterisk::after {
    content: "*";
    color: var(--color-error);
}

small {
    /* BIG :D */
    font-size: 1em;
}

#pagination {
    display: flex;
    gap: 1em;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    font-weight: 600;
    flex: 1 0 auto;
}

#pagination > a {
    text-decoration: none;
    color: var(--color-accent-1);
}

#pagination-options > form {
    align-items: center;
    display: flex;
    gap: 1em;
}

#pagination-options {
    justify-content: center;
    align-items: center;
    gap: 1em;
    width: 100%;
}

.thumbnail-list {
    list-style: none;
    margin: 0 !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 16px;
}

.thumbnail-list > li {
    transition: transform 0.25s cubic-bezier(0.61, 1, 0.88, 1),
                box-shadow 0.25s cubic-bezier(0.61, 1, 0.88, 1);
    box-shadow: var(--shadow-card);
    background: var(--color-card);
}

.thumbnail-list > li > a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.thumbnail-list > li:is(:hover, :focus, :has(:focus)) {
    position: relative;
    transform: scale(1.5);
    z-index: 1;
    box-shadow: var(--shadow-card), 0 4px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.thumbnail-list > li .list-detail {
    padding: 8px;
    display: block;
}
