body{
    --fg1: #FFF;
    --bg1: #153556;
    --bg2: #274567;
    --bg-hover: #278062;
    --bord: #555555;

    color: var(--fg1);
    background: var(--bg2);
    font-family: sans-serif;
}

.widget{
    background: var(--bg1);
    display: flex;
    flex-direction: column;
    padding: 0.5em;
    border-radius: 0.5em;
    max-width: 34em;
    margin: 0.5em auto 12em auto;
}
#main-widget{
    min-height: 40em;
}

#take-a-picture{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg2);
}
#tap-widget-close{
    cursor: pointer;
    border-radius: 100%;
}
.tap-video-container{
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1;
}
.tap-video-container div{
    position: absolute;
    bottom: 0.5em;
    left: 50%;
    transform: translateX(-50%);
    width: 5.5em;
    height: 5.5em;
    border: 1px solid var(--bord);
    border-radius: 100%;
    background: var(--bg-hover) no-repeat center url("img/camera.png");
    background-size: 50%;
    cursor: pointer;
    z-index: 1;
}
.tap-video-container video{
    object-fit: cover;
    object-position: center;
    width: 100%;
    height: 100%;
}

/* Elements used throughout the widget */
hr{
    width: 100%;
    border: none;
    margin: 0.5em 0;
    border-bottom: 1px solid var(--bord);
}

/* Elements in the widget, in the order they go down the page */
.widget-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 2em;
}
.widget-header img, .widget-header div{
    width: 2em;
    object-fit: contain;
}

.widget-box{
    background: var(--bg2);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5em;
    user-select: none;
}

.widget-drop-image{
    flex-direction: column;
    height: 18em;
    background: var(--bg2) no-repeat center url("img/watermark.png");
    background-size: contain;
    cursor: pointer;
}
.widget-drop-image div{
    padding: 0.3em 0.5em;
    color: var(--fg1);
    font-weight: bold;
}

.widget-use-camera{
    flex-direction: row;
    gap: 1em;
    height: 3em;
    margin-top: 0.5em;
    cursor: pointer;
}
.widget-use-camera img{
    height: 75%;
}

.widget-form{
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex-grow: 1;
}

.widget-results{
    display: flex;
    flex-direction: column;
    text-align: center;
}
.widget-result{
    background: var(--bg2);
    display: flex;
    height: 5.5em;
    width: 100%;
    overflow: auto;
    margin-bottom: 0.5em;
    border-radius: 0.5em;
    border: 1px solid var(--bord);
    /* Revert a:link styling */
    color: inherit;
    text-decoration: inherit;
}
.widget-result:last-child{
    margin-bottom: 0;
}
#widget-result-template, #widget-result-loading{
    display: none;
}

#widget-result-loading{
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    height: 8em;
}
#widget-result-loading img{
    height: 2.5em;
    margin: 0.8em 0 0.44em 0;
    animation: 2s linear spin infinite;
}
#widget-result-loading div{
    margin: 0.5em;
}
@keyframes spin {
    from {transform:rotate(0deg);}
    to {transform:rotate(360deg);}
}
.widget-result-info{
    display: flex;
    flex-grow: 1;
    text-align: center;
    flex-direction: column;
    justify-content: center;
}
.widget-result-thumb{
    height: 100%;
}
.widget-result-SKU{
    font-weight: bold;
    margin-bottom: 0.5em;
}
.widget-result-title{
    margin: 0 0.4em 0 0.4em;
}

.widget-result-thumb.loading{
    animation: 1s linear pulsate infinite;
}
.widget-result-SKU.loading{
    animation: 1s linear pulsate infinite;
    animation-delay: -333ms;
}
.widget-result-title.loading{
    animation: 1s linear pulsate infinite;
    animation-delay: -667ms;
}
@keyframes pulsate {
    0% {opacity: 100%}
    50% {opacity: 22%}
    100% {opacity: 100%}
}

#refresh-notice{
    text-align: center;
    margin: 0.5em;
    display: none;
}