﻿#wfPhotoEditorModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

#wfPhotoEditorModal .wf-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
}

/* container */
#wfPhotoEditorModal .wf-modal {
    position: relative;
    margin: 5vh auto;
    width: min(980px, 96vw);
    height: min(86vh, 96vh);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

#wfPhotoEditorModal .wf-modal-header {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

#wfPhotoEditorModal .wf-modal-body {
    flex: 1;
    display: flex;
    gap: 10px;
    padding: 10px;
    min-height: 0;
    /* important for flex children scroll */
}

#wfPhotoEditorModal .wf-stage {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
}

#wfPhotoEditorModal #wfCropperImg {
    max-width: 100%;
    max-height: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    /* helps cropper gestures */
}

#wfPhotoEditorModal .wf-tools {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#wfPhotoEditorModal .wf-btn {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

#wfPhotoEditorModal .wf-btn:active {
    transform: translateY(1px);
}

#wfPhotoEditorModal .wf-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#wfPhotoEditorModal .wf-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

#wfPhotoEditorModal .wf-cancel {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
}

#wfPhotoEditorModal .wf-confirm {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 0;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}

#wfPhotoEditorModal .wf-hint {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

/* Mobile: full screen + toolbar bottom */
@media (max-width: 768px) {
    #wfPhotoEditorModal .wf-modal {
        margin: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    #wfPhotoEditorModal .wf-modal-body {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    #wfPhotoEditorModal .wf-stage {
        flex: 1;
        border-radius: 0;
        border: 0;
        border-bottom: 1px solid #eee;
        background: #000;
        /* better contrast for photo */
    }

    #wfPhotoEditorModal .wf-tools {
        width: auto;
        padding: 10px;
        gap: 10px;
    }

    #wfPhotoEditorModal .wf-row {
        flex-wrap: nowrap;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    #wfPhotoEditorModal .wf-btn {
        flex: 0 0 auto;
        padding: 12px 14px;
        border-radius: 14px;
        font-size: 15px;
        white-space: nowrap;
    }

    #wfPhotoEditorModal .wf-actions {
        margin-top: 0;
    }
}