/* Auth Menu Styles - Shared across landing pages */

/* Container for auth state - hidden by default until JS determines state */
.auth-buttons-loading,
.auth-buttons-guest,
.auth-buttons-user {
  display: none;
}

.auth-buttons-loading.visible {
  display: flex;
  align-items: center;
}

.auth-buttons-guest.visible {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-buttons-user.visible {
  display: flex;
  align-items: center;
}

/* Hide user avatar button in header on mobile - it's shown in hamburger menu instead */
@media screen and (max-width: 991px) {
  .auth-buttons-user.visible {
    display: none;
  }
}

/* Loading skeleton for auth buttons */
.auth-loading-skeleton {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Mobile loading state */
.mobile-auth-loading {
  display: none;
  padding: 0 20px;
  margin-bottom: 16px;
}

.mobile-auth-loading.visible {
  display: block;
}

.mobile-loading-skeleton {
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* User Avatar Button */
.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #5379f6;
  color: white;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.user-avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(83, 120, 246, 0.3);
}

/* Stack span and img absolutely so they don't affect each other's layout */
.user-avatar-btn span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-btn img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* User Dropdown Menu */
.user-dropdown {
  position: relative;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  min-width: 200px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.user-dropdown-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-email {
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.user-dropdown-item:hover {
  background-color: #f3f4f6;
}

.user-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.user-dropdown-item.logout {
  color: #dc2626;
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
  padding-top: 14px;
}

.user-dropdown-item.logout svg {
  color: #dc2626;
}

/* Mobile User Menu */
.mobile-user-section {
  padding: 0 20px;
  margin-bottom: 16px;
}

.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.mobile-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #5379f6;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

/* Stack span and img absolutely for mobile avatar */
.mobile-user-avatar span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-user-avatar img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mobile-user-details {
  overflow: hidden;
}

.mobile-user-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-user-email {
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-dashboard-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background-color: #5379f6;
  color: white;
  border: none;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.mobile-dashboard-btn:hover {
  background-color: #4854ff;
}

.mobile-logout-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background-color: transparent;
  color: #dc2626;
  border: 2px solid #dc2626;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-logout-btn:hover {
  background-color: #dc2626;
  color: white;
}

/* Hide mobile guest/user sections appropriately */
.mobile-auth-guest,
.mobile-auth-user {
  display: none;
}

.mobile-auth-guest.visible {
  display: block;
}

.mobile-auth-user.visible {
  display: block;
}
