/* =========================================================
   Profile Picture Uploader – ppu.css
   ========================================================= */

.ppu-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 280px;
    margin: 0 auto;
}

/* ── Avatar ring ── */
.ppu-avatar-ring {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #6c63ff;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.ppu-avatar-ring:hover {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #4f46e5;
}

.ppu-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s ease;
}

/* ── Hover overlay ── */
.ppu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(79, 70, 229, 0.72);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    border-radius: 50%;
}

.ppu-avatar-ring:hover .ppu-overlay,
.ppu-avatar-ring:focus-within .ppu-overlay {
    opacity: 1;
}

.ppu-avatar-ring:hover .ppu-preview {
    filter: brightness(0.6);
}

.ppu-overlay svg {
    width: 28px;
    height: 28px;
}

.ppu-overlay span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ── Hidden file input ── */
.ppu-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Meta / hint area ── */
.ppu-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ppu-hint {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

/* ── Buttons ── */
.ppu-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.ppu-btn--remove {
    background: transparent;
    color: #dc2626;
    border: 1.5px solid #dc2626;
}

.ppu-btn--remove:hover:not(:disabled) {
    background: #dc2626;
    color: #fff;
}

.ppu-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Status message ── */
.ppu-status {
    min-height: 22px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: opacity 0.3s ease;
}

.ppu-status.ppu-status--success {
    color: #16a34a;
}

.ppu-status.ppu-status--error {
    color: #dc2626;
}

.ppu-status.ppu-status--loading {
    color: #6b7280;
}

/* ── Logged-out notice ── */
.ppu-notice {
    padding: 12px 16px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    font-size: 14px;
    color: #92400e;
}

/* ── Spinner animation ── */
@keyframes ppu-spin {
    to { transform: rotate(360deg); }
}

.ppu-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ppu-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .ppu-avatar-ring {
        width: 120px;
        height: 120px;
    }
}
