

/* CAPTURE APP
*/
.capture-app {
    position: relative;
}

.capture-preview,
.capture-media {
    display: none;
    width: 100%;
    height: 100%;
}

.capture-help {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    display: none;
    padding: 40px 24px 24px 24px;
    overflow: auto;
    background-color: #efefef;
}

.capture-app.show-preview .capture-preview,
.capture-app.show-capture .capture-media {
    display: flex;
    flex-wrap: nowrap;
}


.capture-app.show-help .capture-help {
    display: block;
}

.capture-app.show-preview .capture-media,
.capture-app.show-capture .capture-preview {
    display: none;
}

.media-display {
    flex-basis: 0%;
    flex-grow: 1;
    flex-shrink: 0;
    position: relative;
}

.capture-controls {
    flex-basis: 81px;
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    flex-wrap: nowrap;
    padding: 12px;
}

/* mobile device; landscape orientation
*/
@media screen and (orientation: landscape) and (min-width: 0px) and (max-width: 1024px) {
    .capture-app {
        width: 100%;
        height: 100%;
    }

    .capture-preview,
    .capture-media {
        flex-direction: row;
    }

    .capture-help {
        width: calc(100% - 81px);
        height: 100%;
    }

    .media-display {
        width: calc(100% - 81px);
        height: 100%;
    }

    .capture-controls {
        flex-direction: column-reverse;
        justify-content: flex-start;
        align-items: center;
        width: 81px;
        height: 100%;
    }
}

/* mobile device; portrait orientation
*/
@media screen and (orientation: portrait) and (min-width: 0px) and (max-width: 1024px) {
    .capture-app {
        width: 100%;
        height: 100%;
    }

    .capture-preview,
    .capture-media {
        flex-direction: column;
    }

    .capture-help {
        width: 100%;
        height: calc(100% - 81px);
    }

    .media-display {
        width: 100%;
        height: calc(100% - 81px);
    }

    .capture-controls {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        height: 81px;
    }
}

/* large screen/ desktop styles
*/
@media screen and (min-width: 1025px) {
    .capture-app {
        width: 720px;
        height: auto;
        min-height: 620px;
    }

    .capture-preview,
    .capture-media {
        flex-direction: column;
    }

    .capture-help {
        width: 100%;
        height: calc(100% - 81px);
    }

    .media-display {
        flex-basis: auto;
        flex-grow: 0;
        width: 100%;
        height: 0px;
        padding: 0 0 75% 0;
    }

    .capture-controls {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        height: 81px;
    }
}

/* CAPTURE APP STYLES
- capture video-player, preview video-player, preview image
*/
.capture-media-player,
.preview-media-player,
.preview-media-image {
    display: block;
    width: 100%;
    height: 100%;
    background-color: black;
}

.show-error-user-media .capture-media-player,
.show-error-generic .capture-media-player,
.show-error-browser-support .capture-media-player {
    display: none;
}

.video-player,
.preview-image {
    position: relative;
    z-index: 100;
}

/* video-countdown
*/
.video-countdown {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 200;
    display: inline-block;
    width: 100%;
    padding: 8px;
    text-align: right;
    font-size: 32px;
    color: white;
    text-shadow: 0 0 black;
}

.video-countdown span {
    position: relative;
}

.video-countdown span::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #e80005;
    ;
    border-radius: 50%;
    visibility: hidden;
}

.video-countdown span.recording::before {
    visibility: visible;
}

@media screen and (orientation: portrait) and (min-width: 0px) and (max-width: 1024px) {
    .video-countdown {
        top: 35px;
    }
}

/* errors
*/
.capture-error {
    display: none;
    width: 100%;
    height: 100%;
    background-color: black;
}

.show-error-media #capture-error-user-media,
.show-error-generic #capture-error-generic,
.show-error-browser #capture-error-browser-support {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

.capture-error img {
    width: 100%;
    height: 100%;
    max-width: 152px;
}

.capture-error p {
    text-align: center;
    line-height: 1.3;
    font-size: 16px;
    color: #ededed;
}

.capture-error p:first-of-type {
    margin: 24px 0 12px 0;
    font-size: 28px;
    text-transform: capitalize;
}

/* mobile device
*/
@media screen and (min-width: 0px) and (max-width: 1024px) {
    .capture-media-player,
    .preview-media-player,
    .preview-media-image {
        width: 100%;
        height: 100%;
    }

    .capture-error {
        padding: 48px;
    }

    .capture-error p {
        font-size: 16px;
    }
}

/* mobile device; landscape orientation
*/
@media screen and (orientation: landscape) and (min-width: 0px) and (max-width: 1024px) {
    .video-player,
    .preview-image {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: auto;
        max-width: calc(100vw - 81px);
        height: auto;
        max-height: 100%;
    }
}

/* mobile device; portrait orientation
*/
@media screen and (orientation: portrait) and (min-width: 0px) and (max-width: 1024px) {
    .video-player,
    .preview-image {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-width: 100%;
        height: auto;
        max-height: calc(100% - 81px);
    }

    .video-player {
        width: 100%;
    }

    .preview-image {
        width: auto;
    }
}

/* large screen/ desktop styles
*/
@media screen and (min-width: 1025px) {
    .capture-media-player,
    .preview-media-player,
    .preview-media-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .video-player,
    .preview-image {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 100%;
    }

    .video-player {
        width: 100%;
    }

    .preview-image {
        width: auto;
    }

    .capture-error {
        min-height: inherit;
        padding: 72px;
    }

    .capture-error p {
        font-size: 18px;
        line-height: 1.4;
    }
}

/* capture controls
*/
.media-options {
    flex-basis: 0;
    flex-grow: 1;
}

.media-options-list {
    list-style: none;
    display: inline-flex;
    flex-wrap: nowrap;
    width: auto;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
}

.media-options-list:focus-within {
    border: 2px solid black;
    border-radius: 2px;
}

.media-options-list.hidden {
    visibility: hidden;
}

.media-options-list li {
    flex-basis: 40px;
    flex-grow: 0;
    position: relative;
}

.media-option-label {
    display: block;
    width: 40px;
    height: 40px;
    background-color: transparent;
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 2px;
    transition: background-color 140ms ease;
}

.media-option-label::before {
    all: unset !important;
}

.media-option-radio:not(:disabled)+.media-option-label:hover {
    cursor: pointer;
    background-color: rgba(0 0 0 / 5%);
}

.media-option-radio:checked+.media-option-label,
.media-option-radio:checked+.media-option-label:hover {
    background-color: rgba(0 0 0 / 10%);
}

.media-option-radio:disabled+.media-option-label:hover {
    cursor: not-allowed;
}

.media-options-list li:focus-within .media-option-label {
    background-color: rgba(0 0 0 / 10%);
}

.media-option-label#media-option-label-photo {
    background-image: url("/cws4.0/global-egift/images/icons/camera-icon.svg");
}

.media-option-label#media-option-label-video {
    background-image: url("/cws4.0/global-egift/images/icons/video-icon.svg");
}

.media-option-radio {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

/*  Media capture
*/
.media-capture {
    flex-basis: auto;
    flex-grow: 0;
    width: 56px;
    height: 56px;
}

.media-capture-button {
    position: relative;
    width: 56px;
    height: 56px;
    background-color: #e80005;
    border: none;
    border-radius: 50%;
    transition: background-color 140ms ease;
}

.media-capture-button:hover {
    cursor: pointer;
}

.media-capture-button:disabled:hover {
    cursor: not-allowed;
}

.media-capture-button:hover,
.media-capture-button:focus {
    background-color: #b90005;
}

.media-capture-button::after {
    box-sizing: border-box;
    content: "";
    position: absolute;
    border: 4px solid white;
}

.media-capture-button.start::after {
    top: 6%;
    left: 6%;
    width: 88%;
    height: 88%;
    border-radius: 50%;
}

.media-capture-button.stop::after {
    top: 16%;
    left: 16%;
    width: 68%;
    height: 68%;
    border-radius: 25%;
}

.media-capture-button:disabled,
.media-capture-button:disabled:hover,
.media-capture-button:disabled:focus {
    background-color: grey;
}

.preview-actions {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    height: 100%;
}

/* .media-button-icon, */
.preview-button-icon,
.preview-actions>button {
    border: 1px solid rgba(0 0 0 / 32%);
    border-radius: 2px;
    background-color: transparent;
    transition: background-color 140ms ease;
}

.media-button-icon,
.preview-button-icon {
    padding: 0 12px 0 12px;
}

/* .media-button-icon, */
.preview-button-icon {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

/* .media-button-icon > *, */
.preview-button-icon>* {
    pointer-events: none;
}

.preview-actions>button {
    height: 40px;
    font-size: 14px;
}

.media-button-icon:hover,
.media-button-icon:focus,
.preview-button-icon:hover,
.preview-button-icon:focus,
.preview-actions>button:hover,
.preview-actions>button:focus {
    background-color: rgba(0 0 0 / 5%);
}

.icon-delete,
.icon-accept {
    display: inline-block;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    margin: 0 6px 0 0;
}

.icon-delete {
    background-image: url("/cws4.0/global-egift/images/icons/trash-icon.svg");
}

.icon-accept {
    background-image: url("/cws4.0/global-egift/images/icons/check-icon.svg");
}

/* mobile device
*/
@media screen and (min-width: 0px) and (max-width: 1024px) {

    .media-button-icon,
    .preview-button-icon {
        height: 40px;
    }

    .icon-delete,
    .icon-accept {
        width: 24px;
        height: 24px;
    }
}

/* mobile device; landscape orientation
*/
@media screen and (orientation: landscape) and (min-width: 0px) and (max-width: 1024px) {

    .media-options {
        max-height: calc(50% - 28px);
    }

    .media-options-list,
    .preview-actions {
        flex-direction: column-reverse;
        align-items: center;
    }

    .media-options-list {
        justify-content: flex-start;
    }

    .media-options-list li:not(:first-of-type) {
        margin: 0 0 12px 0;
    }

    .preview-actions {
        justify-content: center;
        height: 100%;
    }

    .preview-actions button:not(:first-of-type) {
        margin: 0 0 24px 0;
    }

    .button-icon-label {
        display: none;
    }

    .media-button-icon,
    .preview-button-icon {
        width: 40px;
        padding: 0;
    }

}

/* mobile device; portrait orientation
*/
@media screen and (orientation: portrait) and (min-width: 0px) and (max-width: 1024px) {

    .media-options {
        max-width: calc(50% - 28px);
    }

    .media-options-list,
    .preview-actions {
        flex-direction: row;
        align-items: center;
    }

    .media-options-list li:not(:last-of-type) {
        margin: 0 12px 0 0;
    }

    .preview-actions {
        justify-content: center;
        width: 100%;
    }

    .preview-actions button:not(:last-of-type) {
        margin: 0 24px 0 0;
    }
}

/* large screen/ desktop styles
*/
@media screen and (min-width: 1025px) {

    .media-options {
        max-width: calc(50% - 28px);
    }

    .media-options-list,
    .preview-actions {
        flex-direction: row;
        align-items: center;
    }

    .preview-actions {
        justify-content: center;
    }

    .media-options-list {
        justify-content: flex-start;
    }

    .media-options-list li:not(:last-of-type) {
        margin: 0 12px 0 0;
    }

    .media-capture {
        flex-basis: auto;
        flex-grow: 0;
        width: auto;
        height: auto;
    }

    .preview-actions {
        width: 100%;
    }

    .preview-actions>button {
        padding: 0 12px;
    }

    .preview-actions>button:not(:last-of-type) {
        margin: 0 28px 0 0;
    }

    .media-button-icon,
    .preview-button-icon {
        width: auto;
        height: 40px;
        font-size: 14px;
        text-transform: capitalize;
    }

    .icon-delete,
    .icon-accept {
        width: 20px;
        height: 20px;
    }
}

/*  CAPTURE APP STYLES
- image/ video preview
*/

.media-preview-button {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 200;
    width: 100%;
    height: 100%;
    background-color: transparent;
    background-image: url("/cws4.0/global-egift/images/icons/play-circle.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20%;
    border: none;
}

.media-preview-button:hover {
    cursor: pointer;
}

.preview-media-player,
.preview-media-image {
    display: none;
}

/* CAPTURE APP STYLES
- help message
*/

.capture-app button.toggle {
    background-color: rgba(0 0 0 / 10%);
}

.capture-help h1 {
    text-transform: capitalize;
}

.capture-help p,
.capture-help li {
    line-height: 1.5;
}

.capture-loading {
    display: none;
    width: 100%;
    height: 100%;
    min-height: inherit;
    padding: 24px;
    overflow: auto;
    background-color: #efefef;
}

.show-loading .capture-loading {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CAPTURE APP STYLES
- modal layout styles
*/
.capture-app-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    background-color: hsla(0, 0%, 100%, 0.9);
}

.capture-app-modal.exit {
    display: none;
}

.capture-app-modal.enter,
.capture-app-modal.exiting {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

.capture-app-modal-wrapper {
    background-color: #ffffff;
}

.capture-app-modal.enter>.capture-app-modal-wrapper,
.capture-app-modal.exiting>.capture-app-modal-wrapper {
    animation-direction: normal;
    animation-duration: 320ms;
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
    animation-timing-function: ease-out;
}

.capture-app-modal.enter>.capture-app-modal-wrapper {
    animation-name: modal-in;
}

.capture-app-modal.exiting>.capture-app-modal-wrapper {
    animation-name: modal-out;
}

@keyframes modal-in {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modal-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* mobile device
- single-capture-app CSS displays as full-screen on screens below 1025px wide
*/
@media screen and (min-width: 0px) and (max-width: 1024px) {
    .capture-app-modal-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
    }
}

/* large screen/ desktop styles
- single-capture-app CSS displays as modal on screens 1025px wide and above
*/
@media screen and (min-width: 1025px) {
    .capture-app-modal-wrapper {
        width: auto;
        height: auto;
        overflow: hidden;
        border: 1px solid rgba(0 0 0 / 10%);
        box-shadow: 2px 4px 8px rgba(0 0 0 / 30%);
        border-radius: 4px;
    }
}

/* CAPTURE APP STYLES
- modal header styles
*/

.capture-app-modal-header-actions {
    display: flex;
    overflow: hidden;
}

.capture-app-modal-header-actions button>* {
    pointer-events: none;
}

/* mobile device
*/
@media screen and (min-width: 0px) and (max-width: 1024px) {
    .capture-app-modal-header {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1001;
    }

    /* override capture-app stand-alone styles
*/
    .capture-app-modal .media-display {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        background-color: black;
    }
}

/* mobile device; landscape orientation
*/
@media screen and (orientation: landscape) and (min-width: 0px) and (max-width: 1024px) {
    .capture-app-modal-header {
        width: 48px;
        height: 100%;
    }

    .capture-app-modal-header-actions {
        flex-direction: column-reverse;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        padding: 12px 0;
    }

    .capture-app-modal-header-actions button:not(:first-of-type) {
        margin: 0 0 16px 0;
    }

    /* override capture-app stand-alone styles */
    .capture-app-modal .media-display {
        justify-content: center;
    }

    .capture-app-modal .capture-media-player {
        /* leave 48px gutters on either side of the media-stream/ error for buttons */
        max-width: calc(100% - 96px);
    }

    .capture-app-modal .video-player {
        max-width: 100%;
    }

    .icon-delete,
    .icon-accept {
        margin: 0 0 0 0;
    }

}

/* mobile device; portait orientation
*/
@media screen and (orientation: portrait) and (min-width: 0px) and (max-width: 1024px) {
    .capture-app-modal-header {
        width: 100%;
        height: 48px;
        background-color: #000000;
    }

    .capture-app-modal-header-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
        height: 100%;
        padding: 0 12px;
    }

    .capture-app-modal-header-actions button:not(:first-of-type) {
        margin: 0 0 0 16px;
    }

    /* override capture-app stand-alone styles */
    .capture-app-modal .media-display {
        align-items: center;
    }

    .capture-app-modal .capture-media-player {
        /* leave 48px gutters on top and bottom of the media-stream/ error for buttons */
        max-height: calc(100% - 96px);
    }
}

/* large screen/ desktop styles
*/
@media screen and (min-width: 1025px) {
    .capture-app-modal-header {
        width: 100%;
        height: 48px;
        background-color: #ffffff;
    }

    .capture-app-modal-header-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
        height: 100%;
        padding: 0 12px;
    }

    .capture-app-modal-header-actions button:not(:first-of-type) {
        margin: 0 0 0 12px;
    }
}

/* CAPTURE APP STYLES
- modal button styles
*/

.capture-app-modal-icon-button {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 2px 0 0 0;
    background-color: transparent;
    transition: background-color 140ms ease;
    border: none;
    display: flex; align-items: center; justify-content: center;
}

.capture-app-modal-icon-button:disabled:hover {
    cursor: not-allowed;
}

.capture-app-modal-icon-button:not(:disabled):hover,
.capture-app-modal-icon-button:not(:disabled):focus {
    background-color: rgba(0 0 0 / 5%);
}

.capture-app-modal-icon-button svg {
    display: inline-block;
    margin: 0;
    width: 18px;
    height: 18px;
}

/* mobile device
*/
@media screen and (min-width: 0px) and (max-width: 1024px) {
    .capture-app-modal-icon-button .icon-help {
        content: url("/cws4.0/global-egift/images/icons/icon-help-white.svg")
    }

    .capture-app-modal-icon-button .icon-close {
        content: url("/cws4.0/global-egift/images/icons/icon-cancel-white.svg")
    }

    .capture-app-modal-icon-button:disabled {
        background-color: hsl(0, 0%, 72%);
    }

    .media-preview-button {
        background-size: 30%;
    }
}

/* large screen/ desktop styles
*/
@media screen and (min-width: 1025px) {
    .capture-app-modal-icon-button .icon-help {
        content: url("/cws4.0/global-egift/images/icons/icon-help.svg")
    }

    .capture-app-modal-icon-button .icon-close {
        content: url("/cws4.0/global-egift/images/icons/icon-cancel.svg")
    }

    .capture-app-modal-icon-button:disabled svg {
        background-color: hsl(0, 0%, 56%);
    }
}
