.profile-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.profile-table th {
    background-color: #3498db;
    color: white;
    padding: 15px;
    text-align: right;
}
.profile-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}
.profile-table input {
    width: 90%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.top-nav {
    position: absolute; /* برای اینکه از جریانِ اصلی صفحه جدا شود */
    top: 20px;
    left: 20px;        /* این کد دکمه را می‌چسباند به گوشه سمت چپ بالا */
    z-index: 10;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #555;
    background: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* برای اینکه بقیه متن‌ها مثل "ویرایش پروفایل" وسط بمانند */
.edit-profile-container {
    text-align: center;
    padding-top: 60px; /* فاصله از بالا برای اینکه دکمه با عنوان تداخل نداشته باشد */
}

.back-link:hover {
    color: #3498db;
    border-color: #3498db;
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.15);
    transform: translateX(-5px); /* یک حرکت نرم به سمت چپ */
}

.back-link .arrow {
    font-weight: bold;
    font-size: 16px;
}

/* =========================================================
   بخش تغییر رمز عبور - طراحی کارتی با آیکون و انیمیشن
========================================================= */
.password-change-section {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: #f8f9fc;
  border: 1px solid #eceef4;
}

.password-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.password-toggle-row .label-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.password-toggle-row .label-with-icon .icon-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* سوییچ سفارشی به‌جای چک‌باکس ساده */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 25px;
  flex-shrink: 0;
}
.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ios-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 25px;
  transition: .25s;
}
.ios-switch .slider::before {
  content: "";
  position: absolute;
  height: 19px;
  width: 19px;
  right: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.ios-switch input:checked + .slider {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
}
.ios-switch input:checked + .slider::before {
  transform: translateX(-19px);
}

/* باکس تایید رمز فعلی */
.current-password-verify-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #dde1ec;
  animation: fadeSlideDown .25s ease;
}

.password-field-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.password-field-row input[type="password"],
.password-field-row input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #dde1ec;
  font-size: 14px;
  transition: border-color .2s;
  outline: none;
}
.password-field-row input:focus {
  border-color: #6a11cb;
}

.btn-verify-password {
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  white-space: nowrap;
}
.btn-verify-password:hover { transform: translateY(-1px); opacity: .92; }
.btn-verify-password:active { transform: translateY(0); }
.btn-verify-password:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.btn-eye-toggle {
  width: 42px;
  border: 1.5px solid #dde1ec;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s;
}
.btn-eye-toggle:hover { border-color: #6a11cb; }

.password-status-msg {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  align-items: center;
  gap: 6px;
}
.password-status-msg.show { display: flex; align-items: center; }
.password-status-msg.success { color: #1fa460; }
.password-status-msg.error { color: #e74c3c; }

.password-status-msg .status-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1fa460;
  color: #fff;
  font-size: 11px;
  animation: popIn .3s ease;
}

.new-password-fields {
  margin-top: 14px;
  animation: fadeSlideDown .25s ease;
}

.new-password-fields label {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  display: block;
}

.new-password-fields .password-field-row {
  margin-bottom: 12px;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* =========================================================
   باکس کد دعوت + دوستان دعوت‌شده - نسخه جذاب
========================================================= */
.invite-hub {
  margin-top: 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, #6a11cb 0%, #4c1fb8 45%, #2575fc 100%);
  padding: 18px 16px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(106, 17, 203, 0.25);
}

.invite-hub::before {
  content: "";
  position: absolute;
  top: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.invite-hub::after {
  content: "";
  position: absolute;
  bottom: -60px;
  right: -30px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}

.invite-hub-top {
  position: relative;
  z-index: 1;
  text-align: center;
}

.invite-hub-label {
  font-size: 13px;
  opacity: .9;
  margin-bottom: 8px;
}

.invite-hub-code {
  background: rgba(255,255,255,.15);
  border: 1.5px dashed rgba(255,255,255,.5);
  border-radius: 12px;
  padding: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 12px;
  backdrop-filter: blur(4px);
}

/* نوار پیشرفت به سمت جایزه بعدی */
.invite-progress-wrap {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  text-align: right;
}

.invite-progress-text {
  font-size: 12px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  opacity: .95;
}

.invite-progress-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.2);
  overflow: hidden;
}
.invite-progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #ffd166, #ff9f43);
  transition: width .5s ease;
}

/* باکس تعداد دوستان - کلیک‌پذیر */
.invited-friends-box {
  position: relative;
  z-index: 1;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .2s, transform .15s;
  margin-bottom: 12px;
}
.invited-friends-box:hover {
  background: rgba(255,255,255,.22);
  transform: translateY(-1px);
}
.invited-friends-box .friends-emoji { font-size: 20px; }
.invited-friends-box .friends-count-num {
  font-size: 18px;
  font-weight: 800;
}
.invited-friends-box .invited-friends-hint {
  font-size: 11px;
  opacity: .85;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-invite-cta {
  position: relative;
  z-index: 1;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px;
  background: linear-gradient(135deg, #26de81, #20bf6b);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(32, 191, 107, .4);
  transition: transform .15s, box-shadow .15s;
}
.btn-invite-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(32, 191, 107, .5);
}
.btn-invite-cta:active { transform: translateY(0); }

/* =========================================================
   مودال لیست دوستان دعوت‌شده
========================================================= */
.invited-friends-modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 10, 40, .55);
  backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
  z-index: 9999;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.invited-friends-modal-content {
  background: #fff;
  border-radius: 20px;
  width: 92%; max-width: 400px;
  max-height: 75vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popIn .25s ease;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}

.invited-friends-modal-header {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.invited-friends-modal-header h3 {
  margin: 0;
  font-size: 16px;
}
.invited-friends-modal-header button {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s;
}
.invited-friends-modal-header button:hover {
  background: rgba(255,255,255,.35);
}

#invitedFriendsListContainer {
  padding: 14px;
  overflow-y: auto;
}

.invited-friend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 14px;
  background: #f7f8fc;
  margin-bottom: 8px;
  transition: background .2s;
}
.invited-friend-item:hover { background: #eef0fa; }

.invited-friend-item .rank-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.invited-friend-item img {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #6a11cb;
  object-fit: cover;
  flex-shrink: 0;
}

.invited-friend-info { flex: 1; min-width: 0; }
.invited-friend-name {
  font-weight: 700; font-size: 14px; color: #2b2b40;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.invited-friend-meta {
  font-size: 12px; color: #8a8a9a;
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.level-chip {
  background: linear-gradient(135deg, #ffd166, #ff9f43);
  color: #7a4900;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.invited-friends-empty {
  text-align: center;
  padding: 36px 16px;
  color: #999;
}
.invited-friends-empty .empty-emoji {
  font-size: 42px;
  margin-bottom: 10px;
  display: block;
}
.invited-friends-empty .empty-title {
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
  font-size: 14.5px;
}
.invited-friends-empty .empty-sub {
  font-size: 12.5px;
  line-height: 1.8;
}