/* ProfilePictureUploader (ppu-*) — profile picture upload with preview, drag & drop,
   clipboard paste, and a crop & zoom editor. Visual language mirrors the existing
   DropzoneUploader (fdu-*) styles. */

.ppu-host {
    position: relative;
    width: 100%;
}

/* ---------- Current picture preview ---------- */

.ppu-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.ppu-avatar-frame {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e6e9f0;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .08);
    background: #ffffff;
    display: grid;
    place-items: center;
}

    .ppu-avatar-frame img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.ppu-initials {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgb(var(--primary-rgb));
    background: rgba(var(--primary-rgb), .12);
}

.ppu-file-name {
    font-size: .75rem;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Dropzone ---------- */

.ppu-dropzone {
    width: 100%;
    min-height: 96px;
    border-radius: 10px;
    border: 2px dashed #d7dce6;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

    .ppu-dropzone:hover {
        border-color: #b9c3da;
        box-shadow: 0 8px 20px rgba(16, 24, 40, .06);
    }

    .ppu-dropzone:focus,
    .ppu-dropzone:focus-within {
        outline: none;
        box-shadow: 0 0 0 4px rgba(13, 110, 253, .14);
        border-color: #9db7ff;
    }

    .ppu-dropzone.ppu-drag {
        border-color: #0d6efd;
        background: rgba(13, 110, 253, .06);
    }

.ppu-dropzone-title {
    font-weight: 600;
    font-size: .85rem;
}

.ppu-dropzone-subtitle {
    font-size: .8rem;
    color: var(--text-muted);
}

.ppu-browse-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin-left: 4px;
    font-weight: 600;
    color: #0d6efd;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.ppu-helper {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.ppu-hidden-input {
    display: none;
}

.ppu-disabled {
    opacity: .65;
    pointer-events: none;
}

/* ---------- Busy overlay ---------- */

.ppu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .6);
    display: grid;
    place-items: center;
    border-radius: 10px;
    z-index: 5;
}

/* ---------- Crop & zoom editor (inside the modal) ---------- */

.ppu-crop-stage {
    display: flex;
    justify-content: center;
}

.ppu-crop-canvas {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: #10131a;
    touch-action: none;
    cursor: grab;
}

    .ppu-crop-canvas:active {
        cursor: grabbing;
    }

.ppu-zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

    .ppu-zoom-row i {
        color: var(--text-muted);
        flex: 0 0 auto;
    }

    .ppu-zoom-row input[type="range"] {
        flex: 1 1 auto;
    }

.ppu-crop-hint {
    font-size: .75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* ---------- Dark mode ---------- */

[data-theme-mode="dark"] .ppu-avatar-frame {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}

[data-theme-mode="dark"] .ppu-dropzone {
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .03);
}

    [data-theme-mode="dark"] .ppu-dropzone:hover {
        border-color: rgba(255, 255, 255, .3);
        box-shadow: none;
    }

    [data-theme-mode="dark"] .ppu-dropzone.ppu-drag {
        border-color: rgb(var(--primary-rgb));
        background: rgba(var(--primary-rgb), .12);
    }

[data-theme-mode="dark"] .ppu-overlay {
    background: rgba(0, 0, 0, .45);
}
