/*
|--------------------------------------------------------------------------
| WPCM Modal Backdrop
|--------------------------------------------------------------------------
*/

.wpcm-modal-backdrop[hidden] {
    display: none !important;
}

.wpcm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
}


.wpcm-center-horiz {
    display: flex;
    justify-content: center;
    align-items: center;
}

/*
|--------------------------------------------------------------------------
| WPCM Modal
|--------------------------------------------------------------------------
*/

.wpcm-modal {
    width: 90%;
    height: 95%;
    background: #fff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.wpcm-modal-header {
    min-height: 60px;
    padding: 0 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpcm-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.wpcm-modal-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
}

/*
|--------------------------------------------------------------------------
| Tabs
|--------------------------------------------------------------------------
*/

.wpcm-modal-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #f6f7f7;
}

.wpcm-tab-button {
    padding: 14px 22px;
    border: 0;
    border-right: 1px solid #ddd;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.wpcm-tab-button.is-active {
    background: #fff;
    color: #2271b1;
}

/*
|--------------------------------------------------------------------------
| Body
|--------------------------------------------------------------------------
*/

.wpcm-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.wpcm-tab-panel {
    height: 100%;
    display: none;
    padding: 20px;
    overflow-y: auto;
}

.wpcm-tab-panel.is-active {
    display: block;
}

/*
|--------------------------------------------------------------------------
| Files Grid
|--------------------------------------------------------------------------
*/

.wpcm-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.wpcm-file-card {
    position: relative;
    border: 2px solid transparent;
    background: #f6f7f7;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.wpcm-file-card.is-selected {
    border-color: #2271b1;
}

.wpcm-file-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.wpcm-file-name {
    padding: 8px;
    font-size: 12px;
    word-break: break-word;
}

/*
|--------------------------------------------------------------------------
| Upload Tab
|--------------------------------------------------------------------------
*/

.wpcm-upload-warning {
    margin: 0 0 15px;
    padding: 12px;
    border-left: 4px solid #d63638;
    background: #fcf0f1;
}

.wpcm-local-preview {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-bottom: 18px;
}

.wpcm-local-preview-item {
    position: relative;
    width: 140px;
    background: #f6f7f7;
    border-radius: 4px;
    overflow: hidden;
}

.wpcm-local-preview-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.wpcm-remove-local-file {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #d63638;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.wpcm-modal-footer {
    min-height: 62px;
    padding: 0 20px;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: #f6f7f7;
}

/*
|--------------------------------------------------------------------------
| Full Dialog Loading Overlay
|--------------------------------------------------------------------------
*/

.wpcm-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
}

.wpcm-modal.is-loading .wpcm-loading-overlay {
    display: flex;
}

.wpcm-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid #dcdcde;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wpcm-spin 0.8s linear infinite;
}

@keyframes wpcm-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/*
|--------------------------------------------------------------------------
| Picker Button Icons
|--------------------------------------------------------------------------
*/

.wpcm-icon-left {
    margin-right: 7px;
}

.wpcm-icon-right {
    margin-left: 7px;
}


.wpcm-delete-file {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #d63638;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Loader
|--------------------------------------------------------------------------
*/

.wpcm-loader[hidden],
.wpcm-modal-backdrop[hidden],
.wpcm-load-more[hidden] {
    display: none !important;
}

.wpcm-loader {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcm-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid #dcdcde;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wpcm-spin 0.8s linear infinite;
}

@keyframes wpcm-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 782px) {
    .wpcm-modal {
        width: 96%;
        height: 90%;
    }

    .wpcm-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .wpcm-file-card img,
    .wpcm-local-preview-item img {
        height: 110px;
    }
}



/*
|--------------------------------------------------------------------------
| WPCM Midnight Theme
|--------------------------------------------------------------------------
*/

.wpcm-modal {
    background: #15202b;
    color: #e7e9ea;
}

.wpcm-modal-header {
    background: #15202b;
    border-bottom: 1px solid #253341;
}

.wpcm-modal-header h2 {
    color: #e7e9ea;
}

.wpcm-modal-close {
    color: #e7e9ea;
}

.wpcm-modal-close:hover {
    color: #1d9bf0;
}

/*
|--------------------------------------------------------------------------
| Tabs
|--------------------------------------------------------------------------
*/

.wpcm-modal-tabs {
    background: #192734;
    border-bottom: 1px solid #253341;
}

.wpcm-tab-button {
    color: #8b98a5;
    background: transparent;
    border-right: 1px solid #253341;
}

.wpcm-tab-button:hover {
    color: #e7e9ea;
}

.wpcm-tab-button.is-active {
    background: #15202b;
    color: #1d9bf0;
}

/*
|--------------------------------------------------------------------------
| Body
|--------------------------------------------------------------------------
*/

.wpcm-modal-body {
    background: #15202b;
}

/*
|--------------------------------------------------------------------------
| Upload Notice
|--------------------------------------------------------------------------
*/

.wpcm-upload-warning {
    background: #1d2733;
    border-left: 4px solid #1d9bf0;
    color: #e7e9ea;
}

/*
|--------------------------------------------------------------------------
| File Cards
|--------------------------------------------------------------------------
*/

.wpcm-file-card,
.wpcm-local-preview-item {
    background: #1d2733;
}

.wpcm-file-card.is-selected {
    border-color: #1d9bf0;
}

.wpcm-file-name {
    color: #e7e9ea;
}

/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.wpcm-modal-footer {
    background: #192734;
    border-top: 1px solid #253341;
}

/*
|--------------------------------------------------------------------------
| Buttons
|--------------------------------------------------------------------------
*/

.wpcm-modal .button {
    background: #253341;
    border-color: #38444d;
    color: #e7e9ea;
}

.wpcm-modal .button:hover {
    background: #2f4556;
    color: #ffffff;
}

.wpcm-modal .button-primary {
    background: #1d9bf0;
    border-color: #1d9bf0;
    color: #ffffff;
}

.wpcm-modal .button-primary:hover {
    background: #1a8cd8;
    border-color: #1a8cd8;
}

/*
|--------------------------------------------------------------------------
| Scrollbars
|--------------------------------------------------------------------------
*/

.wpcm-modal *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.wpcm-modal *::-webkit-scrollbar-track {
    background: #15202b;
}

.wpcm-modal *::-webkit-scrollbar-thumb {
    background: #38444d;
    border-radius: 20px;
}

.wpcm-modal *::-webkit-scrollbar-thumb:hover {
    background: #4a5c6b;
}


.wpcm-remove-local-file,
.wpcm-delete-file {
    position: absolute;
    top: 8px;
    right: 8px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    border: 0;
    border-radius: 50%;

    background: #d63638;
    color: #fff;

    cursor: pointer;

    font-size: 22px;
    line-height: 1;
    font-weight: 400;

    z-index: 10;
}

.wpcm-remove-local-file, .wpcm-delete-file {
    position: absolute;
    top: -5px;
    right: -3px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0 0 0 5px;
    background: #d63638;
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    font-weight: 400;
    z-index: 10;
}

.wpcm--preview {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.wpcm--preview img {
    width: 100px;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
}



/*
|--------------------------------------------------------------------------
| Gallery Info Button
|--------------------------------------------------------------------------
*/

.wpcm-gallery-info {
    position: absolute;
    top: -5px;
    right: -3px;
    z-index: 2;

    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    background: rgba(0, 0, 0, 0.75);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcm-gallery-info:hover {
    opacity: 0.9;
}

/*
|--------------------------------------------------------------------------
| Gallery Lightbox
|--------------------------------------------------------------------------
*/

.wpcm-gallery-lightbox[hidden] {
    display: none !important;
}

.wpcm-gallery-lightbox {
    position: fixed;
    inset: 0;

    z-index: 999999;

    background: rgba(0, 0, 0, 0.92);

    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcm-gallery-lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.wpcm-gallery-lightbox-close,
.wpcm-gallery-lightbox-prev,
.wpcm-gallery-lightbox-next {
    position: absolute;

    border: 0;

    cursor: pointer;

    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.wpcm-gallery-lightbox-close {
    top: 20px;
    right: 20px;

    width: 50px;
    height: 50px;

    border-radius: 50%;

    font-size: 28px;
}

.wpcm-gallery-lightbox-prev {
    left: 20px;
    top: 50%;

    transform: translateY(-50%);

    width: 50px;
    height: 60px;

    font-size: 30px;
}

.wpcm-gallery-lightbox-next {
    right: 20px;
    top: 50%;

    transform: translateY(-50%);

    width: 50px;
    height: 60px;

    font-size: 30px;
}

/*
|--------------------------------------------------------------------------
| Gallery Info Dialog
|--------------------------------------------------------------------------
*/

.wpcm-gallery-info-dialog[hidden] {
    display: none !important;
}

.wpcm-gallery-info-dialog {
    position: fixed;
    inset: 0;

    z-index: 999999;

    background: rgba(0, 0, 0, 0.75);

    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcm-gallery-info-box {
    position: relative;

    width: 500px;
    max-width: 95%;

    padding: 25px;

    border-radius: 8px;

    background: #15202b;
    color: #e7e9ea;
}

.wpcm-gallery-info-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.wpcm-gallery-info-content p {
    margin: 0 0 12px;
}

.wpcm-gallery-info-close {
    position: absolute;

    top: 10px;
    right: 10px;

    width: 40px;
    height: 40px;

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    background: #253341;
    color: #fff;

    font-size: 24px;
}


.wpcm-gallery-card {
    position: relative;
}

.wpcm-gallery-delete {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;

    display: flex;
    justify-content: center;

    opacity: 0;
    transition: opacity .2s ease;
}

.wpcm-gallery-card:hover .wpcm-gallery-delete {
    opacity: 1;
}

.wpcm-gallery-delete-button {
    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    background: rgba(214, 54, 56, 0.95);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcm-gallery-delete-button:hover {
    transform: scale(1.05);
}

.wpcm-gallery-info,
.wpcm-gallery-delete {
    opacity: 0;
    transition: opacity .2s ease;
}

.wpcm-gallery-card:hover .wpcm-gallery-info,
.wpcm-gallery-card:hover .wpcm-gallery-delete {
    opacity: 1;
}

.wpcm-empty-files-message {
    width: 100%;
    padding: 24px;
    text-align: center;
    opacity: 0.8;
}

.wpcm-empty-files-message {
    grid-column: 1 / -1;
    padding: 24px;
    text-align: center;
    opacity: 0.8;
}