/*
 * Copyright:       (c) 2024-2025 Tn2Tr.com
 * Author:          John Beemsterboer
 * Date Created:    2024-10-24
 */

#vehicletabs-photos img {
    -webkit-touch-callout: none;
}
.photo-row .photo-row-ghost {
    position: relative;
    left: -5px;
    border: 5px solid var(--qonnex-blauw);
    box-shadow: 5px 5px 10px #404040;
}
.inventoryphoto-container li:first-child.photo-row-ghost {
    left: 0px;
}
ul.photo-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, 133px);
    grid-template-rows: 100px;
    grid-gap: 23px;

    padding: 0px;
    margin: 0px;

    /* boring properties: */
    list-style: none;
    overflow: hidden;
}
.extraphoto-container ul {
    grid-template-rows: 140px;
}
.extraphoto-container ul.showall {
    grid-template-rows: unset;
}
ul.photo-row li {
    background: #ddd;
    min-height: 100px;
    min-width: 133px;
}
.inventoryphoto-container ul.photo-row li {
    aspect-ratio: 4 / 3;
}
.extraphoto-loading {
    text-align: center;
    padding-top: 60px;
}

.inventoryphoto-container li:first-child {
    grid-column: span 2;
    grid-row: span 2;
}
.photo-row li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photonumber {
    position: absolute;
    color: white;
    border-radius: 50%;
    border: 1px solid white;
    width: 12px;
    text-align: center;
    padding: 2px;
    height: 12px;
    margin-top: -27px;
    margin-left: 4px;
    background: var(--qonnex-antraciet-80);
    line-height: 12px;
    z-index: 10;
}
li[data-defaultposition]:not([data-defaultposition="0"]):not([data-defaultposition=""]) .photonumber {
    background: var(--qonnex-rood-80);
}
.photoactions {
    display: none;
    float: right;
    width: 29px;
    margin-top: -98px;
    cursor: pointer;
}
.inventoryphoto-container li:first-child .photoactions {
    margin-top: -219px;
}
body.has-touchscreen .photo-row .photoactions,
.photo-row li:hover .photoactions {
    display: block;
}
.photoactions i {
    border: 1px solid white;
    padding: 4px;
    font-size: 14px;
    color: white;
    background-color: #40404080;
    position: relative;
    width: 12px;
    text-align: center;
    margin-bottom: 5px;
}
.photoactions i.fa-arrows-alt,
.extraphoto-container .photoactions i.delete-extra-photo {
    display: none;
}
.qx-sortable .photoactions i.fa-arrows-alt {
    display: block;
}
.extraphoto-container .photonumber {
    display: none;
}
.extraphoto-container li {
    height: 135px;
}
.extraphoto-container li img {
    height: 100px;
}

ul.photo-row .photo-add {
    background-color: white;
    cursor: pointer;
}
.photo-add-text {
    text-align: center;
    color: #999;
    font-size: 16px;
    padding-top: 22px;
    height: 78px;
}
.photo-add-text i {
    font-size: 30px;
    color: var(--qonnex-groen);
}
.extraphoto-name {
    background-color: white;
    padding: 5px;
    height: 25px;
    overflow: hidden;
    font-size: 12px;
    color: black;
}
.inventoryphoto-container .extraphoto-name {
    display: none;
}
.photo-add-mobile {
    display: none;
    padding: 0px 10px;
}
.photo-add-mobile u {
    cursor: pointer;
}
#dropzone {
    height: 226px;
    background-color: white;
    background-image: url("/icon/openfolder.svg");
    background-size: 15%;
    background-repeat: no-repeat;
    background-position: center;
    border: 4px dashed transparent;
    cursor: pointer;
    overflow-y: scroll;
}
#dropzone .dropzone-empty {
    text-align: center;
    padding-top: 60px;
}
.dropzone.dragover {
    border-color: var(--qonnex-grijs);
    background-image: none;
}
.dropzone:has(ul li) {
    background-image: none;
}
.dropzone:has(ul li) .dropzone-empty {
    display: none;
}
.dropzone .dropover-text {
    display: none;
    position: absolute;
    width: calc(100% - 58px);
    height: 200px; /* wordt in phototab.js aangepast */
    background-color: #fffe;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    color: var(--qonnex-grijs);
    border: 4px dotted var(--qonnex-grijs);
    z-index: 100;
}
.dropzone.dragover .dropover-text {
    display: flex;
}
.dropzone .progressbar {
    position: relative;
    top: -20px;
    height: 20px;
    text-align: center;
    color: white;
    opacity: 0.7;
    background: #404040;
    font-size: 10px;
    line-height: 16px;
}
.dropzone .progressbar[data-index="to-delete"] {
    background: var(--qonnex-rood);
}
#dlgphotoadd .listbutton {
    margin-top: 10px;
}
#dlgphotoedit .editimage {
    width: 800px;
    height: 600px;
    overflow: hidden;
    max-width: 100%;
    position: relative;
}
.editimage .no-extra-photo {
    position: absolute;
    display: none;
    text-align: center;
    height: 100%;
    width: 100%;
    color: var(--qonnex-grijs);
    font-size: 20px;
    place-items: center;
    cursor: pointer;
}
.editimage[data-filepath=""] .no-extra-photo {
    display: grid;
}
.editimage[data-filepath=""] .no-extra-photo .fa-plus {
    font-size: 60px;
    color: var(--qonnex-groen);
}
#dlgphotoedit .editimage-wrapper {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}
#dlgphotoedit .editimage img {
    max-width: 100%;
    max-height: 100%;
}
#dlgphotoedit .actions {
    background-color: black;
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: space-around;
}
#dlgphotoedit .actions i {
    padding: 15px;
}
#brightness-wrapper input {
    width: 100%;
}
.tbl-save {
    width: 100%;
    background-color: var(--qonnex-blauw);
}
.tbl-save td {
    width: 33.3%;
    padding: 15px;
}
#dlgphotoedit .editimage {
    width: 100%;
}
#dlgphotoedit .rcrop-wrapper {
    height: 100%;
    width: 100%;
}
.brightness-overlay-black,
.brightness-overlay-white {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.brightness-overlay-white {
    background-color: white;
}
img.grayscale-50 {
    filter: grayscale();
    opacity: 0.5;
}
.extraphoto-standaard-checkbox {
    display: inline-block;
    position: relative;
    top: 3px;
    width: 49%;
}

#check-orientation-portrait {
    position: fixed;
    top: 0px;
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #40404077;
    z-index: 1000;
}

.move-photos {
    display: none !important;
}
body.has-touchscreen:has(.tab-photos[aria-hidden="false"]) .move-photos {
    display: inline-block !important;
}

/*--------------------------- scherm kleiner dan 1440px ---------------------------*/

@media screen and (max-width: 1440px) {
    .wrapper {
        width: 100%;
    }
}

/*--------------------------- scherm kleiner dan 530px ---------------------------*/

@media screen and (max-width: 530px) {
    ul.photo-row {
        display: block;
        min-height: 200px;
        padding: 10px;
        margin: 0px;
        overflow-x: auto;
        white-space: nowrap;
    }
    .extraphoto-container ul.showall,
    ul.photo-row.showall {
        display: grid;
        grid-template-columns: repeat(auto-fill, 47%);
    }


    ul.photo-row li {
        border: 1px solid #ccc;
        box-sizing: border-box;
        height: 100px;
        width: 133px;
        margin-bottom: 10px;
        margin-top: 200px;
        white-space: wrap;
    }
    .inventoryphoto-container ul.photo-row li:first-child {
        margin-top: 0px;
        width: calc(100% - 67px);
        height: 200px;
        position: absolute;
        background-color: #f0f0f0;
    }
    .inventoryphoto-container ul.photo-row.showall li,
    .extraphoto-container ul.photo-row.showall li {
        margin-top: 0px;
        width: unset;
        height: unset;
    }
    .inventoryphoto-container ul.photo-row.showall li:first-child {
        width: 100%;
        position: relative;
        margin-bottom: 0px;
    }

    .extraphoto-container ul.photo-row li,
    ul.photo-row li:not(:first-child) {
        display: inline-flex;
        flex: 0 0 200px;
        margin-bottom: 0px;
    }
    .extraphoto-container ul.showall li img {
        height: 100%;
    }

    .photonumber {
        position: relative;
        margin-top: 67px;
        margin-left: -125px;
    }
    ul.showall .photonumber {
        left: calc(-100% + 132px);
        top: calc(100% - 100px);
    }
    ul.photo-row li:first-child .photonumber {
        margin-top: -33px;
        margin-left: 5px;
    }
    ul.photo-row.showall li:first-child .photonumber {
        left: 0px;
        top: 0px;
    }

    .photoactions {
        display: block;
        margin-left: 75px;
        margin-top: 5px;
    }
    ul.showall .photoactions {
        position: absolute;
        margin-left: calc(47% - 63px);
    }
    .inventoryphoto-container li:first-child .photoactions {
        position: relative;
        top: calc(-100% + 15px);
        margin-top: 0;
        margin-left: calc(100% - 27px);
    }
    .extraphoto-container ul:not(.showall) .photoactions {
        margin-left: -25px;
    }
    .extraphoto-container ul.photo-row li {
        margin-top: 0px;
    }

    .photo-add {
        display: none !important;
        cursor: pointer;
    }
    .photo-add-mobile {
        display: block;
    }
    .photo-add-button {
        margin: 5px 0px;
        background-color: white;
        line-height: 30px;
        color: #777;
        text-align: center;
    }
    .photo-add-button i {
        font-size: 20px;
        background-color: var(--qonnex-groen);
        color: white;
        padding: 5px;
        width: 20px;
        float: left;
    }
    .extraphoto-name {
        margin-left: -100%;
        margin-top: 100px;
        width: calc(100% - 10px);
        text-align: left;
    }
    ul.showall .extraphoto-name {
        margin-top: calc(100% - 80px);
    }

    .dropzone .progressbar {
        position: absolute;
        top: unset;
        padding: 0px 5px;
        width: calc(33% - 16px);
        width: 122px;
        margin-top: 86px;
    }
    .dropzone .showall .progressbar {
        width: calc(50% - 62px);
        margin-top: 118px;
    }
    .dropzone .showall .no-sort div:has(>.progressbar) {
        width: calc(50% - 62px);
    }
    .dropzone .photo-row li:first-child .progressbar {
        width: calc(100% - 10px);
        margin-top: -8px;
    }
}
