/* =========================================================
   قاب‌های ماندگار
   PROFILE.CSS
========================================================= */


/* =========================================================
   FONT
========================================================= */

@font-face {

    font-family: "VazirmatnBold";

    src:
        url("fonts/Vazirmatn-Bold.woff2")
        format("woff2");

    font-weight: 900;

    font-style: normal;

    font-display: swap;
}


/* =========================================================
   RESET
========================================================= */

* {

    margin: 0;
    padding: 0;

    box-sizing: border-box;

    font-family:
        "VazirmatnBold",
        sans-serif;

}


html {

    scroll-behavior: smooth;

}


body {

    min-height: 100vh;

    background:
        #09090d;

    color:
        #ffffff;

    overflow-x: hidden;

    --accent-1: #9333ea;
    --accent-2: #db2777;
    --accent-soft: rgba(168,85,247,.15);

    transition:
        background .4s ease,
        color .4s ease;

}


/* =========================================================
   TOP BAR
========================================================= */

.top-bar {

    position: fixed;

    top: 0;
    right: 0;

    width: 100%;
    height: 75px;

    padding:
        0 7%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background:
        rgba(9,9,13,.75);

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    border-bottom:
        1px solid
        rgba(255,255,255,.08);

    z-index: 100;

}


.logo {

    color: white;

    text-decoration: none;

    font-size: 18px;

    transition:
        opacity .3s ease;

}


.logo:hover {

    opacity: .8;

}


.back-btn {

    color: #aaa;

    text-decoration: none;

    transition:
        color .3s ease,
        transform .3s ease;

}


.back-btn:hover {

    color: white;

    transform:
        translateX(4px);

}


/* =========================================================
   PROFILE CONTAINER
========================================================= */

.profile-container {

    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding:
        110px 20px 40px;

}


/* =========================================================
   PROFILE CARD
========================================================= */

.profile-card {

    width: 100%;

    max-width: 480px;

    padding:
        40px 30px;

    text-align: center;

    border-radius: 30px;

    background:
        rgba(255,255,255,.045);

    border:
        1px solid
        rgba(255,255,255,.09);

    backdrop-filter:
        blur(25px);

    -webkit-backdrop-filter:
        blur(25px);

    box-shadow:
        0 30px 80px
        rgba(0,0,0,.4);

    animation:
        profileAppear .7s ease both;

    transition:
        background .4s ease,
        border-color .4s ease,
        box-shadow .4s ease;

}


@keyframes profileAppear {

    from {

        opacity: 0;

        transform:
            translateY(30px)
            scale(.96);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }

}


/* =========================================================
   PROFILE AVATAR
========================================================= */

.profile-avatar {

    width: 105px;
    height: 105px;

    margin:
        0 auto 15px;

    position: relative;

    display: flex;

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

    overflow: visible;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--accent-1),
            var(--accent-2)
        );

    box-shadow:
        0 15px 40px
        var(--accent-soft);

    cursor: pointer;

    transition:
        transform .35s ease,
        box-shadow .35s ease;

}


.profile-avatar:hover {

    transform:
        scale(1.04);

}


.profile-avatar img {

    width: 100%;
    height: 100%;

    display: none;

    object-fit: cover;

    border-radius: 50%;

}


.profile-avatar.has-image img {

    display: block;

    animation:
        imagePop .45s ease both;

}


@keyframes imagePop {

    from {

        opacity: 0;

        transform:
            scale(.75);

    }

    to {

        opacity: 1;

        transform:
            scale(1);

    }

}


.profile-avatar.has-image
#defaultAvatar {

    display: none;

}


#defaultAvatar {

    font-size: 45px;

}


/* =========================================================
   DELETE PROFILE BUTTON
========================================================= */

.delete-profile-btn {

    position: absolute;

    top: 3px;
    right: 3px;

    width: 38px;
    height: 38px;

    border:
        1px solid
        rgba(255,255,255,.15);

    border-radius: 50%;

    background:
        rgba(0,0,0,.65);

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);

    color: white;

    font-size: 17px;

    display: flex;

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

    cursor: pointer;

    z-index: 20;

    transition:
        transform .25s ease,
        background .25s ease,
        box-shadow .25s ease;

}


.delete-profile-btn:hover {

    background:
        rgba(220,50,70,.9);

    transform:
        scale(1.1);

    box-shadow:
        0 8px 20px
        rgba(220,50,70,.25);

}


.delete-profile-btn:active {

    transform:
        scale(.9);

}


.profile-avatar:not(.has-image)
.delete-profile-btn {

    display: none;

}


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

.change-photo-btn {

    display: inline-block;

    margin-bottom: 20px;

    padding:
        9px 17px;

    border-radius: 50px;

    background:
        var(--accent-soft);

    border:
        1px solid
        rgba(168,85,247,.2);

    color:
        #c084fc;

    font-size: 11px;

    cursor: pointer;

    transition:
        transform .3s ease,
        background .3s ease;

}


.change-photo-btn:hover {

    background:
        rgba(168,85,247,.22);

    transform:
        translateY(-2px);

}


/* =========================================================
   TITLE
========================================================= */

.profile-card h1 {

    font-size: 25px;

}


.profile-card h1 span {

    background:
        linear-gradient(
            90deg,
            var(--accent-1),
            var(--accent-2)
        );

    -webkit-background-clip: text;

    background-clip: text;

    color: transparent;

}


.welcome {

    margin-top: 8px;

    color: #888;

    font-size: 12px;

}


/* =========================================================
   INFORMATION
========================================================= */

.info-list {

    margin-top: 30px;

    display: flex;

    flex-direction: column;

    gap: 10px;

}


.info-item {

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 14px;

    text-align: right;

    border-radius: 15px;

    background:
        rgba(255,255,255,.045);

    border:
        1px solid
        rgba(255,255,255,.05);

    transition:
        transform .3s ease,
        background .3s ease;

}


.info-item:hover {

    transform:
        translateY(-2px);

    background:
        rgba(255,255,255,.065);

}


.info-icon {

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;

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

    border-radius: 12px;

    background:
        var(--accent-soft);

    font-size: 19px;

}


.info-content {

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 4px;

    min-width: 0;

}


.info-item small {

    color: #777;

    font-size: 10px;

}


.info-item strong {

    font-size: 13px;

    word-break: break-word;

}


/* =========================================================
   EDIT BUTTON
========================================================= */

.edit-info-btn {

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border: none;

    border-radius: 11px;

    background:
        rgba(255,255,255,.06);

    color: #aaa;

    cursor: pointer;

    transition:
        transform .25s ease,
        background .25s ease,
        color .25s ease;

}


.edit-info-btn:hover {

    color: white;

    background:
        var(--accent-soft);

    transform:
        scale(1.08);

}


.edit-info-btn:active {

    transform:
        scale(.92);

}


/* =========================================================
   STATS
========================================================= */

.stats {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;

    margin-top: 15px;

}


.stat {

    padding: 18px;

    border-radius: 15px;

    background:
        rgba(255,255,255,.04);

    transition:
        transform .3s ease,
        background .3s ease;

}


.stat:hover {

    transform:
        translateY(-3px);

    background:
        rgba(255,255,255,.065);

}


.stat strong {

    display: block;

    font-size: 24px;

}


.stat span {

    color: #777;

    font-size: 11px;

}


/* =========================================================
   THEME COLORS
========================================================= */

.theme-section {

    margin-top: 22px;

    padding-top: 18px;

    border-top:
        1px solid
        rgba(255,255,255,.07);

}


.theme-title {

    color: #888;

    font-size: 11px;

    margin-bottom: 12px;

}


.theme-colors {

    display: flex;

    justify-content: center;

    gap: 12px;

}


.color-option {

    width: 31px;
    height: 31px;

    border: 3px solid transparent;

    border-radius: 50%;

    cursor: pointer;

    transition:
        transform .25s ease,
        border-color .25s ease;

}


.color-option:hover {

    transform:
        scale(1.15);

}


.color-option.active {

    border-color:
        white;

    transform:
        scale(1.12);

}


.color-option.purple {

    background:
        linear-gradient(
            135deg,
            #9333ea,
            #db2777
        );

}


.color-option.blue {

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #06b6d4
        );

}


.color-option.pink {

    background:
        linear-gradient(
            135deg,
            #ec4899,
            #f43f5e
        );

}


.color-option.green {

    background:
        linear-gradient(
            135deg,
            #10b981,
            #14b8a6
        );

}


.color-option.orange {

    background:
        linear-gradient(
            135deg,
            #f97316,
            #eab308
        );

}


/* =========================================================
   LOGOUT
========================================================= */

.logout-btn {

    width: 100%;

    height: 52px;

    margin-top: 25px;

    border:
        1px solid
        rgba(255,100,120,.15);

    border-radius: 14px;

    background:
        rgba(255,80,100,.06);

    color:
        #ff8799;

    font-size: 13px;

    cursor: pointer;

    transition:
        transform .3s ease,
        background .3s ease;

}


.logout-btn:hover {

    background:
        rgba(255,80,100,.12);

    transform:
        translateY(-2px);

}


/* =========================================================
   COMMON MODAL
========================================================= */

.edit-modal,
.crop-modal,
.delete-modal,
.image-preview-modal,
.logout-modal {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

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

    padding: 20px;

    background:
        rgba(0,0,0,.82);

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);

}


/* =========================================================
   EDIT MODAL
========================================================= */

.edit-modal {

    opacity: 0;

    visibility: hidden;

    transition:
        opacity .3s ease,
        visibility .3s ease;

}


.edit-modal.active {

    opacity: 1;

    visibility: visible;

}


.edit-box {

    width: 100%;

    max-width: 390px;

    padding: 30px 25px;

    text-align: center;

    border-radius: 26px;

    background:
        #191921;

    border:
        1px solid
        rgba(255,255,255,.1);

    box-shadow:
        0 30px 90px
        rgba(0,0,0,.6);

    transform:
        translateY(20px)
        scale(.94);

    transition:
        transform .3s ease;

}


.edit-modal.active .edit-box {

    transform:
        translateY(0)
        scale(1);

}


.edit-icon {

    width: 65px;
    height: 65px;

    margin:
        0 auto 15px;

    display: flex;

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

    border-radius: 50%;

    background:
        var(--accent-soft);

    font-size: 27px;

}


.edit-box h2 {

    font-size: 21px;

    margin-bottom: 8px;

}


.edit-box p {

    color: #888;

    font-size: 12px;

    margin-bottom: 20px;

}


.edit-input {

    width: 100%;

    height: 50px;

    padding:
        0 15px;

    outline: none;

    border:
        1px solid
        rgba(255,255,255,.1);

    border-radius: 13px;

    background:
        rgba(255,255,255,.06);

    color: white;

    font-family: inherit;

    font-size: 14px;

    text-align: right;

    transition:
        border-color .3s ease,
        box-shadow .3s ease;

}


.edit-input:focus {

    border-color:
        var(--accent-1);

    box-shadow:
        0 0 0 3px
        var(--accent-soft);

}


.edit-buttons {

    display: flex;

    gap: 10px;

    margin-top: 18px;

}


.edit-buttons button {

    flex: 1;

    height: 48px;

    border: none;

    border-radius: 13px;

    font-family: inherit;

    cursor: pointer;

    transition:
        transform .25s ease;

}


.edit-buttons button:hover {

    transform:
        translateY(-2px);

}


.cancel-edit-btn {

    color: #aaa;

    background:
        rgba(255,255,255,.07);

}


.save-edit-btn {

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--accent-1),
            var(--accent-2)
        );

}


/* =========================================================
   CROP MODAL
========================================================= */

.crop-modal {

    display: none;

}


.crop-modal.active {

    display: flex;

}


.crop-box {

    width: 100%;

    max-width: 430px;

    padding:
        25px 20px;

    text-align: center;

    border-radius: 25px;

    background:
        #111118;

    border:
        1px solid
        rgba(255,255,255,.1);

    box-shadow:
        0 30px 100px
        rgba(0,0,0,.6);

    animation:
        modalAppear .3s ease both;

}


@keyframes modalAppear {

    from {

        opacity: 0;

        transform:
            scale(.94);

    }

    to {

        opacity: 1;

        transform:
            scale(1);

    }

}


.crop-box h2 {

    font-size: 19px;

    margin-bottom: 8px;

}


.crop-help {

    color: #777;

    font-size: 11px;

    margin-bottom: 18px;

}


/* =========================================================
   CROP AREA
========================================================= */

.crop-area {

    width: 300px;
    height: 300px;

    max-width: 85vw;
    max-height: 85vw;

    margin: auto;

    position: relative;

    overflow: hidden;

    background:
        #050507;

    border-radius: 50%;

    cursor: grab;

    touch-action: none;

}


.crop-area:active {

    cursor: grabbing;

}


#cropImage {

    position: absolute;

    max-width: none;

    user-select: none;

    pointer-events: none;

}


.crop-circle {

    position: absolute;

    inset: 0;

    border-radius: 50%;

    pointer-events: none;

    box-shadow:
        0 0 0 2px
        rgba(255,255,255,.8);

}


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

.zoom-controls {

    display: flex;

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

    gap: 20px;

    margin-top: 20px;

}


.zoom-controls button {

    width: 42px;
    height: 42px;

    border: none;

    border-radius: 50%;

    background:
        rgba(255,255,255,.08);

    color: white;

    font-size: 25px;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;

}


.zoom-controls button:hover {

    background:
        var(--accent-soft);

    transform:
        scale(1.08);

}


.zoom-controls span {

    font-size: 18px;

}


/* =========================================================
   CROP BUTTONS
========================================================= */

.crop-buttons {

    display: flex;

    gap: 10px;

    margin-top: 20px;

}


.crop-buttons button {

    flex: 1;

    height: 48px;

    border: none;

    border-radius: 13px;

    font-size: 12px;

    font-family: inherit;

    cursor: pointer;

}


.cancel-btn {

    background:
        rgba(255,255,255,.07);

    color: #aaa;

}


.save-btn {

    background:
        linear-gradient(
            135deg,
            var(--accent-1),
            var(--accent-2)
        );

    color: white;

}


/* =========================================================
   DELETE / LOGOUT MODALS
========================================================= */

.delete-modal,
.logout-modal {

    opacity: 0;

    visibility: hidden;

    transition:
        opacity .3s ease,
        visibility .3s ease;

}


.delete-modal.active,
.logout-modal.active {

    opacity: 1;

    visibility: visible;

}


.delete-box,
.logout-box {

    width: 100%;

    max-width: 390px;

    padding:
        30px 25px;

    text-align: center;

    border-radius: 26px;

    background:
        rgba(25,25,34,.96);

    border:
        1px solid
        rgba(255,255,255,.1);

    box-shadow:
        0 25px 70px
        rgba(0,0,0,.55);

    transform:
        translateY(20px)
        scale(.94);

    transition:
        transform .3s ease;

}


.delete-modal.active .delete-box,
.logout-modal.active .logout-box {

    transform:
        translateY(0)
        scale(1);

}


.delete-icon,
.logout-icon {

    width: 70px;
    height: 70px;

    margin:
        0 auto 18px;

    display: flex;

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

    border-radius: 50%;

    font-size: 30px;

}


.delete-icon {

    background:
        rgba(220,50,70,.12);

    border:
        1px solid
        rgba(220,50,70,.2);

}


.logout-icon {

    background:
        rgba(168,85,247,.12);

    border:
        1px solid
        rgba(168,85,247,.2);

}


.delete-box h2,
.logout-box h2 {

    margin-bottom: 12px;

    font-size: 23px;

}


.delete-box p,
.logout-box p {

    color: #aaa;

    font-size: 13px;

    line-height: 2;

    margin-bottom: 25px;

}


.delete-buttons,
.logout-buttons {

    display: flex;

    gap: 12px;

}


.delete-buttons button,
.logout-buttons button {

    flex: 1;

    height: 48px;

    border: 0;

    border-radius: 14px;

    font-family: inherit;

    font-size: 13px;

    cursor: pointer;

    transition:
        transform .25s ease;

}


.delete-buttons button:hover,
.logout-buttons button:hover {

    transform:
        translateY(-2px);

}


.cancel-delete-btn,
.cancel-logout-btn {

    color: white;

    background:
        rgba(255,255,255,.08);

}


.confirm-delete-btn {

    color: white;

    background:
        linear-gradient(
            135deg,
            #e11d48,
            #be123c
        );

}


.confirm-logout-btn {

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--accent-1),
            var(--accent-2)
        );

}


/* =========================================================
   IMAGE PREVIEW
========================================================= */

.image-preview-modal {

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .3s ease,
        visibility .3s ease;

}


.image-preview-modal.active {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

}


.image-preview-modal img {

    max-width: 85vw;
    max-height: 80vh;

    object-fit: contain;

    border-radius: 20px;

    box-shadow:
        0 30px 100px
        rgba(0,0,0,.7);

    transform:
        scale(.9);

    transition:
        transform .35s ease;

}


.image-preview-modal.active img {

    transform:
        scale(1);

}


.close-preview-btn {

    position: absolute;

    top: 25px;
    right: 30px;

    width: 45px;
    height: 45px;

    border: none;

    border-radius: 50%;

    background:
        rgba(255,255,255,.1);

    color: white;

    font-size: 32px;

    line-height: 1;

    cursor: pointer;

    transition:
        transform .25s ease,
        background .25s ease;

}


.close-preview-btn:hover {

    transform:
        rotate(90deg);

    background:
        rgba(255,255,255,.18);

}


/* =========================================================
   LIGHT MODE
========================================================= */

body.light-mode {

    background:
        #f4f4f7;

    color:
        #18181b;

}


body.light-mode .top-bar {

    background:
        rgba(255,255,255,.8);

    border-color:
        rgba(0,0,0,.08);

}


body.light-mode .logo {

    color:
        #18181b;

}


body.light-mode .back-btn {

    color:
        #666;

}


body.light-mode .profile-card {

    background:
        rgba(255,255,255,.82);

    border-color:
        rgba(0,0,0,.08);

    box-shadow:
        0 30px 80px
        rgba(0,0,0,.12);

}


body.light-mode .info-item,
body.light-mode .stat {

    background:
        rgba(0,0,0,.025);

    border-color:
        rgba(0,0,0,.05);

}


body.light-mode .info-item:hover,
body.light-mode .stat:hover {

    background:
        rgba(0,0,0,.045);

}


body.light-mode .edit-info-btn {

    background:
        rgba(0,0,0,.05);

    color:
        #666;

}


body.light-mode .theme-section {

    border-color:
        rgba(0,0,0,.08);

}


body.light-mode .edit-box,
body.light-mode .delete-box,
body.light-mode .logout-box {

    background:
        #ffffff;

    border-color:
        rgba(0,0,0,.08);

}


body.light-mode .edit-box h2,
body.light-mode .delete-box h2,
body.light-mode .logout-box h2 {

    color:
        #18181b;

}


body.light-mode .edit-input {

    background:
        #f5f5f7;

    color:
        #18181b;

    border-color:
        rgba(0,0,0,.1);

}


body.light-mode .cancel-edit-btn,
body.light-mode .cancel-delete-btn,
body.light-mode .cancel-logout-btn {

    color:
        #555;

    background:
        rgba(0,0,0,.06);

}


/* =========================================================
   COLOR THEMES
========================================================= */

body.theme-blue {

    --accent-1: #2563eb;
    --accent-2: #06b6d4;
    --accent-soft: rgba(37,99,235,.15);

}


body.theme-pink {

    --accent-1: #ec4899;
    --accent-2: #f43f5e;
    --accent-soft: rgba(236,72,153,.15);

}


body.theme-green {

    --accent-1: #10b981;
    --accent-2: #14b8a6;
    --accent-soft: rgba(16,185,129,.15);

}


body.theme-orange {

    --accent-1: #f97316;
    --accent-2: #eab308;
    --accent-soft: rgba(249,115,22,.15);

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 500px) {

    .top-bar {

        height: 68px;

        padding:
            0 5%;

    }


    .logo {

        font-size: 16px;

    }


    .back-btn {

        font-size: 12px;

    }


    .profile-container {

        padding:
            95px 15px 30px;

    }


    .profile-card {

        padding:
            30px 18px;

        border-radius:
            25px;

    }


    .profile-card h1 {

        font-size: 21px;

    }


    .profile-avatar {

        width: 100px;
        height: 100px;

    }


    .crop-box {

        padding:
            22px 15px;

    }


    .crop-area {

        width: 280px;
        height: 280px;

    }


    .delete-box,
    .logout-box,
    .edit-box {

        padding:
            25px 20px;

        border-radius:
            22px;

    }


    .delete-box h2,
    .logout-box h2 {

        font-size: 21px;

    }


    .delete-buttons button,
    .logout-buttons button {

        font-size: 12px;

    }


    .theme-colors {

        gap: 10px;

    }

}body.theme-purple {
    --main-color: #8b5cf6;
}

body.theme-blue {
    --main-color: #3b82f6;
}

body.theme-pink {
    --main-color: #ec4899;
}

body.theme-green {
    --main-color: #22c55e;
}

body.theme-orange {
    --main-color: #f97316;
}


/* دکمه بازگشت به صفحه قبل */
.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 20px;
    border: 1px solid var(--main-color);
    border-radius: 14px;

    background: linear-gradient(
        135deg,
        var(--main-color),
        var(--main-color-2)
    );

    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
    text-decoration: none;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
    filter: brightness(1.1);
}

.back-button:active {
    transform: scale(0.96);
}


/* =========================================================
   نوار بالای پروفایل: بازگشت | لوگو | تغییر تم
========================================================= */

.top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.top-bar .back-button {
    justify-self: start;
    padding: 9px 16px;
    font-size: 13px;
}

.top-bar .logo {
    justify-self: center;
    text-align: center;
    white-space: nowrap;
}

.top-bar .top-theme-btn {
    justify-self: end;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.top-bar .top-theme-btn:hover {
    transform: scale(1.07);
    border-color: var(--main-color);
}

.top-bar .top-theme-btn:active {
    transform: scale(0.92);
}

body.light-mode .top-bar .top-theme-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

#themeIcon {
    display: inline-block;
    line-height: 1;
    transform-origin: center;
}

#themeIcon.rotate {
    animation: themeSpin 0.55s ease-in-out;
}

@keyframes themeSpin {
    0%   { transform: rotate(0deg)   scale(0.75); opacity: 0.5; }
    50%  { transform: rotate(180deg) scale(1.15); opacity: 1; }
    100% { transform: rotate(360deg) scale(1);    opacity: 1; }
}

@media (max-width: 500px) {

    .top-bar {
        padding: 0 4%;
    }

    .top-bar .logo {
        font-size: 14px;
    }

    .top-bar .back-text {
        display: none;
    }

    .top-bar .back-button {
        padding: 9px 14px;
        font-size: 16px;
    }

}

/* =========================================================
   انیمیشن ورود و خروج صفحه
========================================================= */

@keyframes pageIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pageIn2 { from { opacity: 0; } to { opacity: 1; } }

body {
    animation: pageIn 0.45s ease backwards;
}

/* وقتی از حافظه‌ی مرورگر (دکمه‌ی برگشت) صفحه برمی‌گردد */
body.page-enter {
    animation: pageIn2 0.45s ease backwards;
}

@keyframes pageOut { from { opacity: 1; } to { opacity: 0; } }

body.page-leave {
    animation: pageOut 0.26s ease forwards !important;
    pointer-events: none;
}

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

    body,
    body.page-enter {
        animation: none;
    }

    body.page-leave {
        animation: none !important;
        opacity: 0;
    }

}


/* بیوگرافی: چند خطی و شکستن کلمات طولانی */
#profileBio {
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: normal;
    line-height: 1.8;
}



       /* کادر مشترک دکمه‌های سربرگ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;

    flex-shrink: 0;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.04);
}

/* دکمه پروفایل */
.profile-button {
    width: 44px;
    height: 44px;

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

    flex-shrink: 0;

    border-radius: 12px;
    border: 1px solid transparent;

    background: transparent;
    color: inherit;
    text-decoration: none;

    font-size: 23px;

    transition:
        background 0.25s,
        border-color 0.25s,
        transform 0.25s;
}

.profile-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--main-color);
    transform: scale(1.04);
}

/* هماهنگی دکمه تغییر تم با کادر جدید */
.header-actions .theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;

    border-radius: 12px;
    border-color: transparent;
    background: transparent;
}

.header-actions .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--main-color);
}

body.light-mode .header-actions {
    background: #eeeef5;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .profile-button:hover,
body.light-mode .header-actions .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* دایره‌ای کردن دکمه‌های پروفایل و تغییر تم */
.header-actions .profile-button,
.header-actions .theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    padding: 0;

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

/* افکت هنگام لمس یا قرار گرفتن ماوس */
.header-actions .profile-button:hover,
.header-actions .theme-toggle:hover {
    background: var(--main-color);
    border-color: var(--main-color);
    transform: scale(1.06);
}

/* گرد کردن کادر مشترک دکمه‌ها */
.header-actions {
    border-radius: 50px;
    padding: 5px;
    gap: 6px;
    overflow: hidden;
}

/* =========================================================
تنظیم نهایی هدر پروفایل
========================================================= */

.top-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;

direction: ltr;
padding: 0 4%;

}

/* لوگو سمت راست */
.top-bar .logo {
order: 2;
margin-left: auto;
margin-right: 0;

direction: rtl;
text-align: right;

}

/* کادر سه دکمه سمت چپ */
.top-bar .header-actions {
order: 1;
margin-left: 0;
margin-right: auto;

direction: ltr;
flex-shrink: 0;

}

/* بزرگ‌تر کردن دکمه تغییر تم */
.header-actions .theme-toggle {
width: 42px;
height: 42px;
min-width: 42px;
font-size: 20px;
}


/* =========================================
   اطلاعات حلقه و وضعیت عضویت
   پیام‌رسان حلقات صالحین
   ========================================= */

#profileRing,
#profileStatus {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 7px 13px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
    transition: background-color 0.25s ease,
                color 0.25s ease;
    overflow-wrap: anywhere;
}

/* حلقه صالحین */
#profileRing {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.13);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* وضعیت فعال */
#profileStatus {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* وضعیت غیرفعال */
#profileStatus[data-status="inactive"] {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

/* هماهنگی با صفحه موبایل */
@media (max-width: 480px) {
    #profileRing,
    #profileStatus {
        font-size: 13px;
        padding: 6px 10px;
    }
}