/**
 * Profile Hub Button Styles
 * Matches agencies.html implementation - floating login button in bottom-right corner
 */

/* Profile Hub Container - Positioned Above Support Container */
/* ISSUE-024 FIX: Changed from bottom: 90px to prevent icon overlapping */
/* SPACING FIX: Updated to 245px for even 20px gaps between all icons */
.profile-hub-container {
  position: fixed;
  bottom: 245px;
  right: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  z-index: 10003 !important; /* CLICKABILITY FIX: Boost above all other elements */
}

/* Profile Icon with Yellow Glow */
.profile-icon {
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, #ffee00 0%, #ffd700 100%);
  border: 3px solid #28a745;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(255, 238, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: profileGlow 3s ease-in-out infinite;
  overflow: hidden;
}

/* OAuth Profile Picture */
.profile-icon .profile-picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Initial Letter Fallback */
.profile-icon .profile-initial {
  font-size: 18px;
  font-weight: 600;
  color: #ffee00;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.4);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FontAwesome Icon Fallback (logged out) */
.profile-icon i.fa-user {
  font-size: 24px;
  color: #000000;
  transition: all 0.3s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.profile-icon:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 30px rgba(255, 238, 0, 0.9), 0 6px 20px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ffd700 0%, #ffee00 100%);
}

.profile-icon:hover i {
  color: #333333;
}

/* Login Status Button - Positioned Beside Profile Icon */
/* Profile Hub Button - Shows Login or Username with Logout */
.profile-hub-btn {
  background: #000000;
  color: #ffee00;
  border: 2px solid #ffee00;
  border-radius: 25px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Arial', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  box-shadow: 0 4px 12px rgba(255, 238, 0, 0.2);
  letter-spacing: 0;
  text-transform: none !important;
  white-space: nowrap;
}

.profile-hub-btn:hover {
  background: #ffee00;
  color: #000000;
  border-color: #28a745;
  box-shadow: 0 6px 20px rgba(255, 238, 0, 0.5);
  transform: scale(1.05);
}

/* Logged-in state - green accent */
.profile-hub-btn.logged-in {
  border-color: #28a745;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.profile-hub-btn.logged-in:hover {
  background: #28a745;
  color: #ffffff;
  border-color: #ffee00;
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

/* Username and Logout text styling */
.profile-username {
  font-weight: bold;
  margin-right: 6px;
}

.profile-logout {
  font-size: 10px;
  font-weight: normal;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* Glow animation for profile icon */
@keyframes profileGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 238, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 238, 0, 0.9), 0 6px 16px rgba(0, 0, 0, 0.3);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* ISSUE-024 FIX: Changed from bottom: 75px to prevent icon overlapping on mobile */
  /* SPACING FIX: Updated to 195px for even 15px gaps between all icons */
  .profile-hub-container {
    bottom: 195px;
    right: 15px;
    gap: 12px;
    z-index: 10003 !important; /* CLICKABILITY FIX: Boost above titleBar (10001) and navPanel (10002) */
  }

  /* MOBILE FIX: Hide pill button, show only circle icon */
  .profile-hub-btn {
    display: none;
  }

  /* ISSUE-015 FIX: Ensure profile icon remains circular on mobile */
  .profile-icon {
    width: 45px;
    height: 45px;
    min-width: 45px; /* Prevent oval on flex squeeze */
    aspect-ratio: 1 / 1; /* Ensure perfect circle */
    flex-shrink: 0; /* Don't allow flex to compress */
  }

  .profile-icon i {
    font-size: 18px;
  }

  .profile-icon .profile-initial {
    font-size: 16px;
  }

  .profile-icon i.fa-user {
    font-size: 18px;
  }

  .profile-username {
    font-size: 11px;
  }

  .profile-logout {
    font-size: 9px;
  }
}

/* Modal should be above profile hub */
.modal {
  z-index: 10004 !important; /* Above profile-hub-container (10003) */
}

/* ===== TEXT OVERFLOW FIX - Domain Zero Standard ===== */
/* Protect username from overflow */
.profile-username {
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
