/*--------------------------------------*\
  AVATAR ENHANCEMENTS - PHASE 3
\*--------------------------------------*/

/* Standard avatar styling */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bga-green);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border-color: var(--bga-gold);
}

.avatar-xs {
  width: 30px;
  height: 30px;
}

.avatar-sm {
  width: 50px;
  height: 50px;
}

.avatar-md {
  width: 100px;
  height: 100px;
}

.avatar-lg {
  width: 150px;
  height: 150px;
}

.avatar-xl {
  width: 200px;
  height: 200px;
}

/* Avatar upload container */
.avatar-upload {
  position: relative;
  max-width: 200px;
  margin: 0 auto;
}

.avatar-preview {
  width: 200px;
  height: 200px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--bga-green);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  margin-bottom: 1rem;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  background-color: var(--bga-green);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.avatar-edit:hover {
  background-color: var(--bga-green-dark);
  transform: scale(1.1);
}

.avatar-edit i {
  color: white;
  font-size: 16px;
}

.avatar-edit input {
  display: none;
}

/* File validation */
.file-validation {
  font-size: 0.8rem;
  color: var(--bga-gray);
  margin-top: 0.5rem;
}

.file-validation.error {
  color: var(--bga-error);
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.file-validation.success {
  color: var(--bga-success);
  animation: pulse 0.5s;
}

/* Avatar cropper */
.avatar-cropper-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.avatar-cropper-content {
  background-color: white;
  border-radius: 10px;
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.avatar-cropper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bga-light);
}

.avatar-cropper-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--bga-dark);
  transition: color 0.2s;
}

.avatar-cropper-close:hover {
  color: var(--bga-error);
}

.avatar-cropper-title {
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0;
}

.avatar-cropper-body {
  margin-bottom: 1rem;
}

.avatar-cropper-preview {
  width: 100%;
  max-height: 50vh;
  overflow: hidden;
  margin-bottom: 1rem;
}

.avatar-cropper-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 575.98px) {
  .avatar-lg {
    width: 120px;
    height: 120px;
  }
  
  .avatar-xl {
    width: 150px;
    height: 150px;
  }
  
  .avatar-preview {
    width: 150px;
    height: 150px;
  }
}

/* Avatar list */
.avatar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.avatar-with-name {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.avatar-with-name .avatar {
  margin-right: 10px;
}

.avatar-name {
  font-weight: 500;
}

/* Profile page enhancements */
.profile-header {
  position: relative;
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  background-color: var(--bga-light);
  border-radius: 1rem;
  box-shadow: var(--bga-shadow);
}

.profile-header .avatar {
  margin-bottom: 1rem;
}

.profile-name {
  margin-bottom: 0.5rem;
}

.profile-bio {
  color: var(--bga-gray);
  margin-bottom: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bga-green);
}

.profile-stat-label {
  font-size: 0.875rem;
  color: var(--bga-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Upload status indicators */
.upload-progress {
  height: 4px;
  background-color: var(--bga-light);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  border-radius: 2px;
}

.upload-progress-bar {
  height: 100%;
  background-color: var(--bga-green);
  width: 0;
  transition: width 0.3s ease;
}

/* Avatar skeleton loader for placeholder */
@keyframes pulse-avatar {
  0% { opacity: 0.6; }
  50% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

.avatar-skeleton {
  border-radius: 50%;
  background-color: #e0e0e0;
  animation: pulse-avatar 1.5s infinite;
}