.form-width {
  max-width: 640px;
}

/* Default for unknown or no rank - already bg-light text-dark border */

.rank-icon {
  width: 30px; /* Adjust as needed */
  height: 30px; /* Adjust as needed */
  object-fit: contain; /* Ensures the image scales nicely within the dimensions */
}

/* Rank-specific badge colors */
.rank-badge-bronze {
  background-color: #CD7F32 !important; /* Bronze color */
  color: white !important;
  border-color: #B8682C !important;
  transition: all 0.2s ease;
}

.rank-badge-bronze:hover {
  background-color: #B8682C !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
}

.rank-badge-silver {
  background-color: #C0C0C0 !important; /* Silver color */
  color: #333 !important;
  border-color: #A8A8A8 !important;
  transition: all 0.2s ease;
}

.rank-badge-silver:hover {
  background-color: #A8A8A8 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
}

.rank-badge-gold {
  background-color: #FFD700 !important; /* Gold color */
  color: #333 !important;
  border-color: #E6C200 !important;
  transition: all 0.2s ease;
}

.rank-badge-gold:hover {
  background-color: #E6C200 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.rank-badge-platinum {
  background-color: #E5E4E2 !important; /* Platinum color */
  color: #333 !important;
  border-color: #D0CFCD !important;
  transition: all 0.2s ease;
}

.rank-badge-platinum:hover {
  background-color: #D0CFCD !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(229, 228, 226, 0.3);
}

.rank-badge-diamond {
  background-color: #4EE3F7 !important; /* Diamond color (light blue) */
  color: #0A3A4A !important;
  border-color: #3BC9DB !important;
  transition: all 0.2s ease;
}

.rank-badge-diamond:hover {
  background-color: #3BC9DB !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(78, 227, 247, 0.3);
}

.rank-badge-master {
  background-color: #66BB6A !important; /* Master color (green) */
  color: white !important;
  border-color: #4CAF50 !important;
  transition: all 0.2s ease;
}

.rank-badge-master:hover {
  background-color: #4CAF50 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(102, 187, 106, 0.3);
}

.rank-badge-grandmaster {
  background-color: #B833FF !important; /* Grandmaster color (purple) */
  color: white !important;
  border-color: #A01FE6 !important;
  transition: all 0.2s ease;
}

.rank-badge-grandmaster:hover {
  background-color: #A01FE6 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(184, 51, 255, 0.3);
}

.rank-badge-champion {
  background-color: #FF4081 !important; /* Champion color (pink) */
  color: white !important;
  border-color: #F50057 !important;
  transition: all 0.2s ease;
}

.rank-badge-champion:hover {
  background-color: #F50057 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(255, 64, 129, 0.3);
}

/* Modern User Card Styling */
.user-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #e9ecef !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.user-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  opacity: 0.3;
}

.user-card-body {
  padding: 2rem !important;
}

.user-card-title {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #1a202c;
  margin-bottom: 1rem !important;
  position: relative;
  display: inline-block;
}

.user-card-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
}

.user-card-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid #e9ecef;
}

.user-card-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.user-card-comment {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.5rem;
  border: 1px solid #dee2e6;
  position: relative;
}

.user-card-comment::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 3rem;
  color: #6366f1;
  opacity: 0.3;
  font-family: Georgia, serif;
}

.btn-friend-request {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 12px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  color: white !important;
}

.btn-friend-request::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn-friend-request:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-friend-request:hover::before {
  left: 100%;
}

.btn-friend-request:disabled {
  background: #e9ecef;
  color: #6c757d !important;
  cursor: not-allowed;
}

.btn-friend-request:disabled:hover {
  transform: none;
  box-shadow: none;
}

.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-badge {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 20px;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.user-badge:hover {
  border-color: #6366f1;
  background: #f0f4ff;
  transform: translateY(-2px);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 24px;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.role-badge:hover {
  border-color: #8b5cf6;
  background: #faf5ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

/* Friend Search Intro Section */
.friend-search-intro {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid #e9ecef;
}

.friend-search-intro .lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: #495057;
}

.friend-search-intro .bi-people-fill {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}