/* Registration profile-picture uploader + crop modal.
   Mirrors the circular-profile crop UX of the BlogForge user profile.
   All styling lives here (no inline CSS in the template). */

/* ---- Home header avatar: uploaded profile photo in place of the default person icon ---- */
.header-profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
}

/* ---- My Profile modal: avatar pulled OUT above the Basic Info block ---- */
.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -66px;                 /* lift the avatar so it overlaps the blue header */
    margin-bottom: 6px;
    position: relative;
    z-index: 3;
    /* This full-width block overlaps the header; without this its transparent area would
       sit on top of the header close (X) button and swallow the click. Re-enable pointer
       events only on the interactive avatar below. */
    pointer-events: none;
}

.profile-hero-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #eef1fb;
    border: 4px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;              /* clickable even though .profile-hero disables events */
}

.profile-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;                   /* click the photo -> open preview */
}

.profile-hero-placeholder {
    color: #9aa4b2;
    font-size: 54px;
    line-height: 1;
}

.profile-hero-badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bs-theme);       /* matches the modal header colour */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border: 3px solid #fff;
    cursor: pointer;                   /* camera badge -> open upload picker */
}

.profile-hero-badge:hover {
    filter: brightness(0.92);
}

.profile-hero-name {
    margin-top: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #1f2733;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 575px) {
    .profile-hero { margin-top: -54px; }
    .profile-hero-avatar { width: 96px; height: 96px; }
    .profile-hero-placeholder { font-size: 42px; }
    .profile-hero-name { font-size: 18px; }
}

/* ---- Avatar / upload block inside the registration form ---- */
.reg-photo-block {
    width: 100%;
    flex: 0 0 100%;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.reg-avatar {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #eef1fb;
    border: 2px solid #78c2ad;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.reg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reg-avatar .reg-avatar-placeholder {
    color: #9aa4b2;
    font-size: 40px;
    line-height: 1;
}

.reg-avatar-badge {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #78c2ad;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 2px solid #fff;
}

.reg-photo-actions {
    display: flex;
    gap: 8px;
}

.reg-photo-btn {
    border: 1px solid #78c2ad;
    background: #fff;
    color: #4a8f7c;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.reg-photo-btn:hover {
    background: #78c2ad;
    color: #fff;
}

.reg-photo-btn.remove {
    border-color: #e0575e;
    color: #e0575e;
}

.reg-photo-btn.remove:hover {
    background: #e0575e;
    color: #fff;
}

.reg-photo-hint {
    font-size: 11px;
    color: #8a94a3;
}

/* ---- Crop modal ---- */
.reg-crop-stage {
    width: 100%;
    height: 340px;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
}

.reg-crop-stage img {
    display: block;
    max-width: 100%;
}

.reg-crop-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
}

.reg-crop-preview-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8a94a3;
}

.reg-crop-preview,
.prof-crop-preview {
    width: 130px;
    height: 130px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid #e5e8ef;
    background: #f5f6fa;
}

.reg-crop-zoom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.reg-crop-zoom input[type="range"] {
    flex: 1;
    accent-color: #78c2ad;
    cursor: pointer;
}

.reg-crop-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ccd2dd;
    background: #fff;
    color: #555;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.reg-crop-zoom-btn:hover {
    background: #f0f2f6;
}

/* Keep the crop + preview modals above the still-open registration / profile modal + its backdrop. */
#regCropModal,
#profileCropModal,
#profileImagePreviewModal {
    z-index: 1060;
}

/* ---- Profile photo preview modal ---- */
.profile-preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: #111;
}

.profile-preview-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
    object-fit: contain;
}

@media (max-width: 575px) {
    .reg-crop-stage {
        height: 240px;
    }

    .reg-crop-preview {
        width: 90px;
        height: 90px;
    }
}
