/* User Profile Dropdown Styles */
.xcodee-user-profile-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.xcodee-user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none !important;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #0071bd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.xcodee-user-profile-trigger:hover,
.xcodee-user-profile-trigger:focus {
  color: #0071bd;
  background: transparent !important;
}

.xcodee-user-profile-trigger i.far {
  font-size: 24px;
}

.xcodee-user-name {
  font-size: 14px;
  font-weight: 500;
}

.xcodee-user-avatar-trigger {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.xcodee-user-avatar-trigger:hover {
  transform: scale(1.05);
}

.xcodee-user-avatar-trigger i {
  margin: 0;
  line-height: 1;
  color: #0071bd;
}

/* User icon (shown on desktop when logged in) */
.xcodee-user-icon {
  display: block;
}

.xcodee-user-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

/* Mobile: Show only first 3 letters */
@media (max-width: 768px) {
  .xcodee-user-name {
    max-width: 40px;
    font-size: 13px;
  }

  .xcodee-user-name::after {
    content: "...";
  }

  /* Truncate to 3 characters using JavaScript or CSS - CSS approach */
  .xcodee-user-name {
    max-width: 4ch;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.xcodee-user-avatar-trigger img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.xcodee-dropdown-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.xcodee-user-profile-dropdown-wrapper.active .xcodee-dropdown-icon {
  transform: rotate(180deg);
}

.xcodee-user-profile-trigger:hover .xcodee-dropdown-icon {
  color: #0071bd;
}

.xcodee-user-profile-dropdown {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  width: 350px;
  max-width: 90vw;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  display: none;
  transform: translateY(-10px);
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

.xcodee-user-profile-dropdown.active {
  display: block;
  transform: translateY(0);
}

/* Login Form Styles */
.xcodee-user-login-form {
  padding: 20px;
}

.xcodee-user-login-form .um {
  margin: 0;
}

/* Logged in User Menu */
.xcodee-user-profile-menu {
  padding: 0;
}

.xcodee-user-profile-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.xcodee-user-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.xcodee-user-info {
  flex: 1;
}

.xcodee-user-display-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.xcodee-user-email {
  font-size: 13px;
  color: #666;
}

.xcodee-user-profile-links {
  padding: 10px 0;
}

.xcodee-profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
}

.xcodee-profile-link:hover {
  background: #f5f5f5;
  color: #0071bd;
}

.xcodee-profile-link i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 480px) {
  .xcodee-user-profile-dropdown {
    width: calc(100vw - 40px);
    right: -25px;
  }

  .xcodee-dropdown-icon {
    display: none;
  }
}

.um input[type="submit"].um-button {
  background: #0071bd !important;
}

.um .um-button.um-alt,
.um input[type="submit"].um-button.um-alt {
  background: var(--e-global-color-5b522ed) !important;
  color: #fff !important;
}

/* Form Content Wrapper */
.xcodee-form-content {
  position: relative;
  transition: opacity 0.3s ease;
}

/* Back to Login Button */
.xcodee-back-to-login {
  display: inline-block;
  margin-bottom: 15px;
  padding: 8px 12px;
  color: #0071bd;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.xcodee-back-to-login:hover {
  background: #f5f5f5;
  color: #005a9e;
}

/* Smooth form transitions */
.xcodee-user-login-form {
  position: relative;
  overflow: hidden;
}

.xcodee-form-content {
  animation: fadeIn 0.3s ease;
}

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

/* Form containers */
.xcodee-um-form {
  transition: opacity 0.3s ease;
}

.xcodee-um-register-form {
  display: none;
}

/* Back to login button */
.xcodee-back-to-login {
  display: inline-block;
  margin-bottom: 15px;
  padding: 8px 12px;
  color: #0071bd;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.xcodee-back-to-login:hover {
  color: #eb1b24;
  text-decoration: underline;
}
