.profile-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.75);
  z-index:999;
  backdrop-filter:blur(4px);
  animation:overlayFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-popup{
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:95%;
  max-width:420px;
  max-height:90vh;
  background:linear-gradient(135deg, #1a1a2e 0%, #0f172a 100%);
  border-radius:16px;
  z-index:1000;
  display:flex;
  flex-direction:column;
  border:1px solid rgba(37, 99, 235, 0.2);
  box-shadow:0 20px 60px rgba(0, 0, 0, 0.6);
}

.popup-header{
  padding:16px;
  font-weight:700;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid rgba(37, 99, 235, 0.1);
  color:#60a5fa;
  font-size:16px;
  animation:fadeInDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

.popup-header button{
  background:none;
  border:none;
  color:#9ca3af;
  cursor:pointer;
  font-size:20px;
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-header button:hover{
  color:#ef4444;
  transform:rotate(90deg) scale(1.1);
}

.popup-body{
  padding:16px;
  overflow-y:auto;
  flex:1;
  animation:slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

.popup-body::-webkit-scrollbar{
  width:6px;
}

.popup-body::-webkit-scrollbar-track{
  background:rgba(37, 99, 235, 0.05);
  border-radius:10px;
}

.popup-body::-webkit-scrollbar-thumb{
  background:rgba(37, 99, 235, 0.2);
  border-radius:10px;
}

.popup-body::-webkit-scrollbar-thumb:hover{
  background:rgba(37, 99, 235, 0.3);
}

.popup-footer{
  padding:16px;
  border-top:1px solid rgba(37, 99, 235, 0.1);
  animation:slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

.profile-popup label{
  color:#60a5fa;
  font-weight:600;
  font-size:14px;
  margin-top:12px;
  margin-bottom:6px;
  display:block;
  animation:fadeInDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.profile-popup input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(37, 99, 235, 0.2);
  background:rgba(255, 255, 255, 0.05);
  margin-bottom:10px;
  color:#e5e7eb;
  font-size:14px;
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation:slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.profile-popup input::placeholder{
  color:rgba(229, 231, 235, 0.4);
}

.profile-popup input:focus{
  outline:none;
  border-color:#2563eb;
  background:rgba(37, 99, 235, 0.08);
  box-shadow:0 0 0 3px rgba(37, 99, 235, 0.2);
}

.disabled-field{
  background:rgba(107, 114, 128, 0.1) !important;
  cursor:not-allowed;
  color:#9ca3af;
}

.disabled-field:focus{
  border-color:rgba(107, 114, 128, 0.2) !important;
  box-shadow:none !important;
}

.password-accordion{
  margin-top:14px;
  border:1px solid rgba(37, 99, 235, 0.15);
  border-radius:10px;
  background:rgba(37, 99, 235, 0.05);
  animation:slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s backwards;
  overflow:hidden;
}

.accordion-header{
  padding:12px;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-weight:600;
  color:#60a5fa;
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select:none;
}

.accordion-header:hover{
  background:rgba(37, 99, 235, 0.1);
}

#pwdArrow{
  transition:transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size:12px;
  color:#9ca3af;
}

.accordion-body{
  display:none;
  padding:12px;
  border-top:1px solid rgba(37, 99, 235, 0.1);
  animation:slideInDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwd-wrap{
  position:relative;
  margin-bottom:10px;
}

.pwd-wrap input{
  padding-right:40px !important;
}

.pwd-wrap span{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  cursor:pointer;
  color:#9ca3af;
  font-size:16px;
  transition:all 0.2s ease;
  user-select:none;
}

.pwd-wrap span:hover{
  color:#60a5fa;
  transform:translateY(-50%) scale(1.15);
}

.strength-meter{
  height:6px;
  background:rgba(107, 114, 128, 0.2);
  border-radius:4px;
  overflow:hidden;
  margin:8px 0 10px 0;
}

#strengthBar{
  height:100%;
  width:0%;
  /*background:linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);*/
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:0 0 10px rgba(34, 197, 94, 0.3);
}

/* DEFAULT HIDDEN */
.profile-overlay,
.profile-popup {
  display: none;
}

/* ===== PROFILE TRIGGER ===== */
.profile-wrapper{
  position: relative;
}

.profile-chip{
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  border: 1px solid rgba(37, 99, 235, 0.2);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-chip:hover{
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  transform: translateY(-2px);
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.4);
}

/* Avatar circle */
.profile-avatar{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  object-fit:cover;
  box-shadow:0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Name + role */
.profile-meta{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.profile-name{
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role{
  font-size: 11px;
  color: #9ca3af;
  text-transform: capitalize;
}

/* Caret */
.profile-caret{
  font-size: 12px;
  color: #9ca3af;
}

/* ===== MOBILE ===== */
@media(max-width:768px){
  .profile-name{ display:none; }
  .profile-role{ display:none; }
  .profile-chip{ padding-right:10px; }
}

/* ======================================================================== */
/* ===== Smooth popup animation ===== */
.profile-popup{
  animation: popupFadeScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupFadeScale{
  from{
    opacity:0;
    transform:translate(-50%, -50%) scale(0.92);
  }
  to{
    opacity:1;
    transform:translate(-50%, -50%) scale(1);
  }
}

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

@keyframes fadeInDown{
  from{
    opacity:0;
    transform:translateY(-10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@keyframes slideInUp{
  from{
    opacity:0;
    transform:translateY(10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@keyframes slideInDown{
  from{
    opacity:0;
    transform:translateY(-10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

.toast-msg{
  position:fixed;
  bottom:25px;
  right:25px;
  background:rgba(17, 24, 39, 0.9);
  color:#fff;
  padding:12px 18px;
  border-radius:10px;
  opacity:0;
  transform:translateY(15px);
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index:99999;
  border:1px solid rgba(37, 99, 235, 0.2);
  box-shadow:0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast-msg.show{
  opacity:1;
  transform:translateY(0);
}

.toast-msg.success{
  background:linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
  border:1px solid rgba(34, 197, 94, 0.3);
  color:#22c55e;
}

.toast-msg.error{
  background:linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.08));
  border:1px solid rgba(220, 38, 38, 0.3);
  color:#ef4444;
}

.profile-popup{
  display:none;
}

.profile-popup.active{
  display:flex;
}

/* ============POPUP avatar CSS============ */
.profile-avatar-wrap{
  display:flex;
  justify-content:center;
  margin-bottom:20px;
  animation:scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

.avatar-label{
  position:relative;
  cursor:pointer;
}

.profile-avatar{
  width:110px;
  height:110px;
  border-radius:50%;
  object-fit:cover;
  border:4px solid rgba(37, 99, 235, 0.3);
  box-shadow:0 8px 24px rgba(37, 99, 235, 0.2);
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-label:hover .profile-avatar{
  transform:scale(1.08);
  border-color:rgba(37, 99, 235, 0.6);
  box-shadow:0 12px 32px rgba(37, 99, 235, 0.3);
}

.avatar-edit{
  position:absolute;
  bottom:6px;
  right:6px;
  background:linear-gradient(135deg, #2563eb, #1d4ed8);
  color:#fff;
  font-size:14px;
  padding:6px 8px;
  border-radius:50%;
  box-shadow:0 4px 12px rgba(37, 99, 235, 0.4);
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation:scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

.avatar-label:hover .avatar-edit{
  transform:scale(1.15);
  box-shadow:0 6px 16px rgba(37, 99, 235, 0.5);
}

/* ==========Top Profile========== */
.top-profile{
  width:42px;
  height:42px;
  border-radius:50%;
  overflow:hidden;
  cursor:pointer;
  background:linear-gradient(135deg, #2563eb, #1d4ed8);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  transition:all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:0 4px 12px rgba(37, 99, 235, 0.3);
}

.top-profile:hover{
  transform:scale(1.1);
  box-shadow:0 6px 16px rgba(37, 99, 235, 0.4);
}

.top-profile img{
  width:100%;
  height:100%;
  object-fit:cover;
}

@keyframes scaleIn{
  from{
    opacity:0;
    transform:scale(0.9);
  }
  to{
    opacity:1;
    transform:scale(1);
  }
}
