/* =========================================================
   PROFILE PHOTO EDITOR
   Modern UI
   ========================================================= */

.profile-photo-settings {
    --ppm-primary: #05a4ef;
    --ppm-primary-dark: #1d4ed8;
    --ppm-primary-soft: #f3fbff;
    --ppm-primary-border: #bfdbfe;

    --ppm-text: #172033;
    --ppm-text-secondary: #64748b;
    --ppm-text-light: #94a3b8;

    --ppm-border: #e2e8f0;
    --ppm-border-light: #edf1f5;

    --ppm-surface: #ffffff;
    --ppm-surface-soft: #f8fafc;
    --ppm-surface-blue: #f8fbff;

    --ppm-danger: #dc2626;
    --ppm-danger-bg: #fef2f2;

    --ppm-radius-xl: 20px;
    --ppm-radius-lg: 14px;
    --ppm-radius-md: 10px;

    --ppm-shadow:
        0 20px 50px rgba(15, 23, 42, 0.08);

    --ppm-shadow-small:
        0 5px 18px rgba(15, 23, 42, 0.07);

    --ppm-transition: 180ms ease;

    max-width: 980px;
    margin: 24px auto;
    color: var(--ppm-text);
}


/* =========================================================
   MAIN CARD
   ========================================================= */

.profile-photo-settings {
    background: var(--ppm-surface);
    border: 1px solid var(--ppm-border);
    border-radius: var(--ppm-radius-xl);
    box-shadow: var(--ppm-shadow);
    overflow: hidden;
}


/* =========================================================
   HEADER
   ========================================================= */

.ppm-header {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 22px 26px;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8fbff 100%
        );

    border-bottom: 1px solid var(--ppm-border);
}


.ppm-header-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 48px;

    border-radius: 14px;

    color: var(--ppm-primary);
    background: var(--ppm-primary-soft);

    border: 1px solid var(--ppm-primary-border);

    font-size: 21px;
}


.ppm-header-content {
    min-width: 0;
}


.ppm-settings-title {
    margin: 0;

    color: var(--ppm-text);

    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;

    letter-spacing: -0.02em;
}


.ppm-settings-description {
    margin: 4px 0 0;

    color: var(--ppm-text-secondary);

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   BODY
   ========================================================= */

.ppm-body {
    padding: 28px;
    background: #fff;
}
.ppm-body .custom-file{
  display: none;
}

.ppm-file-input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);
}


/* =========================================================
   ERROR
   ========================================================= */

.ppm-error {
    display: none;

    align-items: center;
    gap: 9px;

    margin-bottom: 18px;
    padding: 12px 14px;

    color: var(--ppm-danger);
    background: var(--ppm-danger-bg);

    border: 1px solid #fecaca;
    border-radius: 10px;

    font-size: 13px;
}


.ppm-error.is-visible {
    display: flex;
    animation: ppm-error-in 220ms ease;
}


@keyframes ppm-error-in {

    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* =========================================================
   UPLOAD DROPZONE
   ========================================================= */

.ppm-dropzone {

    position: relative;

    min-height: 330px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 45px 25px;

    text-align: center;

    cursor: pointer;

    border: 1.5px dashed #cbd5e1;
    border-radius: var(--ppm-radius-xl);

    background:
        radial-gradient(
            circle at top,
            #f8fbff 0%,
            #f8fafc 60%,
            #ffffff 100%
        );

    transition:
        border-color var(--ppm-transition),
        background var(--ppm-transition),
        box-shadow var(--ppm-transition),
        transform var(--ppm-transition);
}


.ppm-dropzone:hover,
.ppm-dropzone:focus-visible {

    border-color: var(--ppm-primary);

    background:
        radial-gradient(
            circle at top,
            #eff6ff 0%,
            #f8fbff 65%,
            #ffffff 100%
        );

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.08);

    outline: none;

    transform: translateY(-1px);
}


.ppm-dropzone.is-dragover {

    border-color: var(--ppm-primary);

    background: var(--ppm-primary-soft);

    box-shadow:
        0 0 0 5px rgba(37, 99, 235, 0.1),
        var(--ppm-shadow-small);

    transform: scale(1.005);
}


.ppm-dropzone.is-hidden {
    display: none;
}


/* =========================================================
   UPLOAD ICON
   ========================================================= */

.ppm-upload-illustration {
    position: relative;

    margin-bottom: 22px;
}


.ppm-upload-circle {

    width: 76px;
    height: 76px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: var(--ppm-primary);

    background: #fff;

    border: 1px solid var(--ppm-primary-border);

    box-shadow:
        0 8px 25px rgba(37, 99, 235, 0.1);

    font-size: 30px;

    transition:
        transform var(--ppm-transition),
        box-shadow var(--ppm-transition);
}


.ppm-dropzone:hover .ppm-upload-circle {

    transform: translateY(-4px);

    box-shadow:
        0 12px 30px rgba(37, 99, 235, 0.16);
}


.ppm-upload-plus {

    position: absolute;

    right: -2px;
    bottom: -2px;

    width: 25px;
    height: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: #fff;

    background: var(--ppm-primary);

    border: 3px solid #fff;

    font-size: 13px;
}


/* =========================================================
   UPLOAD TEXT
   ========================================================= */

.ppm-upload-content {
    max-width: 480px;
}


.ppm-dropzone-title {

    margin: 0;

    color: var(--ppm-text);

    font-size: 18px;
    font-weight: 700;

    letter-spacing: -0.015em;
}


.ppm-dropzone-sub {

    margin: 7px 0 0;

    color: var(--ppm-text-secondary);

    font-size: 14px;
    line-height: 1.6;
}


.ppm-browse-link {

    color: var(--ppm-primary);

    font-weight: 600;

    text-decoration: underline;
    text-underline-offset: 3px;
}


.ppm-upload-meta {

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    margin-top: 18px;

    color: var(--ppm-text-light);

    font-size: 12px;
}


.ppm-upload-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}


.ppm-meta-divider {

    width: 3px;
    height: 3px;

    border-radius: 50%;

    background: #cbd5e1;
}


/* Drag state text */

.ppm-dropzone-hover {

    position: absolute;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: var(--ppm-primary);

    background: rgba(239, 246, 255, 0.94);

    border-radius: inherit;

    font-size: 15px;
    font-weight: 700;

    opacity: 0;
    pointer-events: none;

    transition: opacity var(--ppm-transition);
}


.ppm-dropzone.is-dragover .ppm-dropzone-hover {
    opacity: 1;
}


/* =========================================================
   EDITOR
   ========================================================= */

.ppm-edit-area {

    display: none;

    opacity: 0;
    transform: translateY(8px);

    transition:
        opacity 260ms ease,
        transform 260ms ease;
}


.ppm-edit-area.is-visible {

    display: block;

    opacity: 1;
    transform: translateY(0);
}


.ppm-editor-grid {

    display: grid;

    grid-template-columns:
        minmax(0, 1.45fr)
        minmax(280px, 0.85fr);

    gap: 24px;
}


/* =========================================================
   EDITOR SECTIONS
   ========================================================= */

.ppm-editor-column {
    min-width: 0;
}


.ppm-section-heading {

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 12px;
}


.ppm-eyebrow {

    display: block;

    margin-bottom: 3px;

    color: var(--ppm-primary);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.12em;
}


.ppm-section-heading h3 {

    margin: 0;

    color: var(--ppm-text);

    font-size: 16px;
    font-weight: 700;
}


.ppm-section-help {

    display: flex;
    align-items: center;
    gap: 5px;

    color: var(--ppm-text-light);

    font-size: 11px;
    white-space: nowrap;
}


/* =========================================================
   CROP CARD
   ========================================================= */

.ppm-crop-card {

    position: relative;

    overflow: hidden;

    border-radius: var(--ppm-radius-lg);

    background: #111827;

    border: 1px solid #1f2937;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.04),
        0 8px 25px rgba(15,23,42,0.12);
}


#crop-container.ppm-crop-container {

    width: 100%;
    height: 390px;

    position: relative;

    overflow: hidden;

    background:
        radial-gradient(
            circle at center,
            #263244 0%,
            #111827 70%
        );
}


#crop-container.ppm-crop-container img {
    max-width: 100%;
    display: block;
}


/* Cropper */

.ppm-crop-container .cropper-view-box,
.ppm-crop-container .cropper-face {
    border-radius: 50%;
}


.ppm-crop-container .cropper-view-box {

    outline:
        2px solid rgba(255,255,255,0.95);

    box-shadow:
        0 0 0 9999px rgba(0,0,0,0.42);
}


.ppm-crop-container .cropper-line,
.ppm-crop-container .cropper-point {
    opacity: 0;
}


/* =========================================================
   CROP OVERLAY
   ========================================================= */

.ppm-crop-overlay {

    position: absolute;

    top: 12px;
    left: 12px;
    right: 12px;

    pointer-events: none;
}


.ppm-crop-overlay-top {

    display: inline-flex;

    padding: 5px 9px;

    border-radius: 6px;

    color: rgba(255,255,255,0.85);

    background: rgba(15,23,42,0.55);

    backdrop-filter: blur(8px);

    font-size: 10px;
    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.08em;
}


/* =========================================================
   ZOOM
   ========================================================= */

.ppm-zoom-panel {

    display: flex;
    align-items: center;
    gap: 12px;

    margin-top: 13px;
    padding: 12px 14px;

    border: 1px solid var(--ppm-border);

    border-radius: var(--ppm-radius-md);

    background: var(--ppm-surface-soft);
}


.ppm-tool-btn {

    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 34px;

    border: 1px solid var(--ppm-border);

    border-radius: 9px;

    color: var(--ppm-text-secondary);

    background: #fff;

    cursor: pointer;

    transition:
        color var(--ppm-transition),
        border-color var(--ppm-transition),
        background var(--ppm-transition),
        transform 100ms ease;
}


.ppm-tool-btn:hover {

    color: var(--ppm-primary);

    border-color: var(--ppm-primary-border);

    background: var(--ppm-primary-soft);
}


.ppm-tool-btn:active {
    transform: scale(0.94);
}


.ppm-zoom-control {
    flex: 1;
    min-width: 0;
}


.ppm-zoom-labels {

    display: flex;
    justify-content: space-between;

    margin-bottom: 5px;

    color: var(--ppm-text-light);

    font-size: 10px;
    font-weight: 600;
}


.ppm-zoom-value {
    color: var(--ppm-primary);
}


.ppm-zoom-range {

    width: 100%;

    height: 4px;

    margin: 0;

    cursor: pointer;

    accent-color: var(--ppm-primary);
}


/* =========================================================
   CHANGE PHOTO
   ========================================================= */

.ppm-change-photo {

    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-top: 13px;

    padding: 0;

    border: 0;

    color: var(--ppm-primary);

    background: transparent;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}


.ppm-change-photo:hover {
    color: var(--ppm-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* =========================================================
   PREVIEW CARD
   ========================================================= */

.ppm-preview-card {

    overflow: hidden;

    border: 1px solid var(--ppm-border);

    border-radius: var(--ppm-radius-lg);

    background: #fff;

    box-shadow: var(--ppm-shadow-small);
}


.ppm-preview-background {

    min-height: 250px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at 50% 40%,
            #ffffff 0%,
            #f4f8fc 60%,
            #edf3f8 100%
        );

    border-bottom: 1px solid var(--ppm-border);
}


.ppm-preview-circle {

    width: 150px;
    height: 150px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 50%;

    background: #fff;

    box-shadow:
        0 0 0 6px #fff,
        0 0 0 7px #dbe4ed,
        0 15px 35px rgba(15,23,42,0.15);

    transition:
        box-shadow var(--ppm-transition);
}


.ppm-preview-circle img {

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    animation: ppm-preview-in 220ms ease;
}


.ppm-preview-placeholder {

    color: #cbd5e1;

    font-size: 60px;
}


@keyframes ppm-preview-in {

    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }

}


/* =========================================================
   PREVIEW INFO
   ========================================================= */

.ppm-preview-info {
    padding: 15px 17px 17px;
}


.ppm-preview-label {

    display: block;

    margin-bottom: 4px;

    color: var(--ppm-primary);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.12em;
}


.ppm-preview-info p {

    margin: 0;

    color: var(--ppm-text-secondary);

    font-size: 11px;
    line-height: 1.55;
}


/* =========================================================
   PREVIEW SIZES
   ========================================================= */

.ppm-preview-sizes {

    display: flex;
    align-items: flex-end;
    justify-content: center;

    gap: 22px;

    margin-top: 18px;
    padding: 14px;

    border: 1px solid var(--ppm-border);

    border-radius: var(--ppm-radius-lg);

    background: var(--ppm-surface-soft);
}


.ppm-size-item {

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    color: var(--ppm-text-light);

    font-size: 9px;
    font-weight: 600;
}


.ppm-size-avatar {

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 50%;

    color: #94a3b8;

    background: #e2e8f0;
}


.ppm-size-large {
    width: 42px;
    height: 42px;
    font-size: 18px;
}


.ppm-size-medium {
    width: 32px;
    height: 32px;
    font-size: 14px;
}


.ppm-size-small {
    width: 24px;
    height: 24px;
    font-size: 11px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.ppm-footer {

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 16px 26px;

    border-top: 1px solid var(--ppm-border);

    background: #fbfcfe;
}


.ppm-footer-hint {

    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--ppm-text-light);

    font-size: 11px;
}


.ppm-footer-hint i {
    color: #16a34a;
    font-size: 15px;
}


/* =========================================================
   SAVE BUTTON
   ========================================================= */

.ppm-btn-save {

    position: relative;

    min-width: 160px;
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 0 18px;

    border: 1px solid var(--ppm-primary);
    border-radius: 10px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #1d4ed8
        );

    box-shadow:
        0 5px 14px rgba(37,99,235,0.22);

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 120ms ease,
        box-shadow var(--ppm-transition),
        opacity var(--ppm-transition),
        background var(--ppm-transition);
}


.ppm-btn-save:hover:not(:disabled) {

    background:
        linear-gradient(
            135deg,
            #1d4ed8,
            #1e40af
        );

    box-shadow:
        0 8px 20px rgba(37,99,235,0.28);

    transform: translateY(-1px);
}


.ppm-btn-save:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}


.ppm-btn-save:disabled {

    opacity: 0.45;

    cursor: not-allowed;

    box-shadow: none;
}


.ppm-btn-check {
    font-size: 16px;
}


.ppm-btn-spinner {
    display: none;
}


.ppm-btn-save.is-loading .ppm-btn-check {
    display: none;
}


.ppm-btn-save.is-loading .ppm-btn-spinner {

    display: inline-block;

    animation:
        ppm-spin 800ms linear infinite;
}


@keyframes ppm-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {

    .profile-photo-settings {
        margin: 12px;
    }


    .ppm-body {
        padding: 20px;
    }


    .ppm-editor-grid {

        grid-template-columns: 1fr;

        gap: 25px;
    }


    .ppm-preview-column {
        order: 2;
    }


    #crop-container.ppm-crop-container {
        height: 340px;
    }


    .ppm-preview-background {
        min-height: 230px;
    }

}


@media (max-width: 600px) {

    .profile-photo-settings {
        margin: 8px;
        border-radius: 15px;
    }


    .ppm-header {
        padding: 17px;
    }


    .ppm-header-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        font-size: 18px;
    }


    .ppm-settings-title {
        font-size: 16px;
    }


    .ppm-settings-description {
        font-size: 12px;
    }


    .ppm-body {
        padding: 15px;
    }


    .ppm-dropzone {
        min-height: 280px;
        padding: 30px 18px;
    }


    .ppm-upload-circle {
        width: 65px;
        height: 65px;
        font-size: 26px;
    }


    .ppm-dropzone-title {
        font-size: 16px;
    }


    .ppm-dropzone-sub {
        font-size: 12px;
    }


    .ppm-upload-meta {
        flex-direction: column;
        gap: 6px;
    }


    .ppm-meta-divider {
        display: none;
    }


    #crop-container.ppm-crop-container {
        height: 280px;
    }


    .ppm-section-heading {
        align-items: flex-start;
    }


    .ppm-section-help {
        display: none;
    }


    .ppm-preview-circle {
        width: 125px;
        height: 125px;
    }


    .ppm-footer {

        align-items: stretch;
        flex-direction: column;

        padding: 15px;
    }


    .ppm-footer-hint {
        justify-content: center;
    }


    .ppm-btn-save {
        width: 100%;
    }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.ppm-dropzone:focus-visible,
.ppm-tool-btn:focus-visible,
.ppm-change-photo:focus-visible,
.ppm-btn-save:focus-visible {

    outline: 3px solid rgba(37,99,235,0.22);

    outline-offset: 2px;
}


.boxcontent.formcontent.profile-photo-settings{
  padding: 0px;
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .profile-photo-settings *,
    .profile-photo-settings *::before,
    .profile-photo-settings *::after {

        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

}