/**
 * YOOAdmin - User avatar upload styles
 *
 * @package YOOAdmin
 */

.yoo-profile-avatar {
    position: relative;
}

.yoo-avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 50%;
    cursor: pointer;
}

.yoo-profile-avatar:hover .yoo-avatar-upload-overlay {
    opacity: 1;
}

.yoo-avatar-upload-overlay label {
    color: white;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.yoo-avatar-upload-overlay .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.yoo-avatar-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 10;
    background: rgba(205, 40, 40, 0.9);
    border: 2px solid #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,.35);
    transition: background 0.15s ease;
}

.yoo-avatar-delete-btn .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
    color: #fff;
    line-height: 1;
}

.yoo-avatar-delete-btn:hover {
    background: rgba(180, 20, 20, 1);
}

.yoo-profile-avatar:hover .yoo-avatar-delete-btn {
    display: flex;
}

#yoo-avatar-cropper-modal {
    display: none !important;
}

#yoo-avatar-cropper-modal.show {
    display: flex !important;
}

/* Remove profile photo — confirm in-app (not browser confirm) */
#yoo-avatar-delete-modal {
    display: none !important;
}

#yoo-avatar-delete-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/*
 * Stage dimensions are set in JS (px) to match the image aspect ratio exactly.
 * The canvas inside fills the stage; overflow:hidden clips any sub-pixel drift.
 */
#yoo-avatar-cropper-modal .yoo-cropper-stage {
    overflow: hidden;
    background: #2c3338;
    border-radius: 4px;
    margin: 0 auto;
    flex-shrink: 0;
}

/*
 * canvas receives explicit width/height px values from JS after init,
 * but we start with 100%/100% as a safe fallback.
 */
#yoo-avatar-cropper-modal .yoo-cropper-stage cropper-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
