/* ========== BODY & BASE ========== */
body, html {
  font-family: 'Almarai', sans-serif;
  background: #f8f8fc;
  margin: 0;
  color: #232343;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ========== USER PROFILE DROPDOWN ========== */
.user-profile-dropdown {
  position: absolute;
  right: 0;
  top: 50px;
  min-width: 145px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 24px #7a51e023;
  border: 1px solid #eaeaff;
  z-index: 2100;
  display: none;
  flex-direction: column;
  padding: 6px 0;
}
.user-profile-dropdown a {
  color: #333;
  padding: 8px 18px 8px 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.16s, color 0.16s;
  border: none;
  background: none;
}
.user-profile-dropdown a.logout-link {
  color: #d32f2f !important;
}
.user-profile-dropdown a.logout-link:hover {
  background: #fff0f0;
  color: #b71c1c !important;
}
.user-profile-dropdown a:hover {
  background: #f5f0ff;
  color: #9e67ff;
}

@media (max-width: 900px) {
  .user-profile-dropdown {
    top: 100%;
    left: 50%;
    right: auto;
    width: 60vw;
    min-width: unset;
    border-radius: 12px;
    transform: translateX(-50%);
    margin-top: 1px;
    z-index: 3000;
  }
}

/* ========== USER PROFILE SECTION ========== */
.user-profile-section {
  border-radius: 24px;
  max-width: 1000px;
  margin: 32px auto 26px auto;
  box-shadow: 0 4px 24px #ede7fa2f;
  padding: 30px 20px 23px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.user-profile-row {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1.5px solid #f2f2f7;
  padding-bottom: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
  z-index: 2110;
}
.user-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #e3dbff;
  background: #f4f3fd;
}
.user-info {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.user-name {
  font-size: 22px;
  font-weight: 800;
  color: #683ada;
  margin-bottom: 2px;
}
.user-role-label {
  font-size: 15px;
  color: #fff;
  background: linear-gradient(90deg, #a777fb 60%, #6e3de9 100%);
  padding: 4px 17px;
  border-radius: 7px;
  display: inline-flex;         /* تغيير هنا */
  align-items: center;          /* توسيط عمودي */
  justify-content: center;      /* توسيط أفقي */
  font-weight: bold;
  margin-top: 4px;
  letter-spacing: 1px;
  box-shadow: 0 1px 8px #bba2fa2a;
}


/* ========== USER STATS CARDS (GRID) ========== */
.user-stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 0 12px 0;
  justify-items: center;
}
@media (max-width: 850px) {
  .user-stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .user-stats-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* ========== USER STAT CARD ========== */
.user-stat-card {
  background: linear-gradient(135deg, #f8f8fc 60%, #ece9fc 100%);
  border-radius: 18px;
  padding: 20px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: bold;
  color: #5f38a8;
  position: relative;
  box-shadow: 0 4px 18px 0 rgba(135, 114, 251, 0.10), 0 1.5px 6px 0 rgba(145, 116, 255, 0.09);
  transition: transform 0.17s cubic-bezier(.34,1.56,.64,1), box-shadow 0.15s;
  user-select: none;
  cursor: pointer;
  backdrop-filter: blur(2.5px);
  width: 100%;
  box-sizing: border-box;
}
.user-stat-card:hover,
.user-stat-card:active {
  transform: scale(1.045);
  box-shadow: 0 6px 24px 2px rgba(135, 114, 251, 0.17), 0 3px 12px 0 rgba(145, 116, 255, 0.16);
  background: linear-gradient(135deg, #f4f1ff 60%, #ece9fc 100%);
}
.user-stat-card .stat-title {
  font-size: 14px;
  color: #9273c8;
  font-weight: 600;
  letter-spacing: 0.1px;
  margin: 0 0 0 0;
}
.user-stat-card .stat-num {
  font-size: 22px;
  color: #6e3de9;
  font-weight: bold;
  margin-top: 3px;
}
.stat-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  justify-content: center;
}
.user-stat-card .material-symbols-rounded {
  font-size: 23px;
  margin-bottom: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .user-profile-section { padding: 16px 5vw 12px 5vw; }
  .user-profile-row { flex-direction: column; gap: 11px; text-align: center; }
  .user-avatar { width: 90px; height: 90px; }
  .user-banner.user-banner-slider img { height: 280px; }
}
@media (max-width: 600px) {
  .user-profile-section { max-width: 99vw; padding: 8px 2vw 8px 2vw; }
  .user-profile-row { gap: 8px; }
  .user-avatar { width: 70px; height: 70px; }
  .user-banner.user-banner-slider img { height: 170px; }
  .user-role-label {
    font-size: 11px;
    padding: 7px 12px;
    margin-top: 2px;
  }
}

/* ========== BANNER ========== */
.user-banner.user-banner-slider {
  width: 100%;
margin: -20px 0 0 0;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}
.user-banner.user-banner-slider img {
  width: 100%;
  height: 270px;
  object-fit: cover;
  border-radius: 15px;
  display: block;
  transition: opacity 0.4s;
}
@media (max-width: 800px) {
  .user-banner.user-banner-slider img { height: 250px; }
}
@media (max-width: 600px) {
  .user-banner.user-banner-slider img { height: 240px; }
}
@media (max-width: 520px) {
  .user-banner.user-banner-slider img { height: 200px; }
}
@media (max-width: 450px) {
  .user-banner.user-banner-slider img { height: 170px; }
}
