.profile-header {
  position: relative;
  margin-bottom: 80px;
}

.profile-banner {
  background-image: url('../img/default-banner.jpg'); 
  background-size: cover;
  background-position: center;
  height: 250px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg), var(--shadow-inset);
}

.profile-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  background: linear-gradient(to top, rgba(39, 41, 61, 0.8) 0%, rgba(39, 41, 61, 0.1) 50%);
}

.profile-header-content {
  position: absolute;
  bottom: -60px;
  width: 100%;
  padding: 0 30px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 5px solid var(--card-bg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  transition: transform 0.3s ease;
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.profile-user-info {
  flex-grow: 1;
  padding-bottom: 15px;
}

.profile-username {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bright-text);
  line-height: 1.2;
}

.profile-rank {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
  transition: all 0.2s ease;
}

.profile-actions {
  padding-bottom: 15px;
  display: flex;
  gap: 10px;
}

.profile-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.profile-card-header {
  background-color: var(--card-header-bg);
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--bright-text);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-card-header i {
  color: var(--primary-color);
}

.profile-card-body {
  padding: 20px;
  line-height: 1.7;
}

.profile-about-content {
  color: var(--light-text);
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:first-child {
  padding-top: 0;
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-icon {
  font-size: 1.2rem;
  color: var(--muted-text);
  margin-top: 2px;
  width: 20px;
  text-align: center;
}

.activity-text a {
  font-weight: 600;
  color: var(--light-text);
}

.activity-text a:hover {
  color: var(--primary-color);
}

.activity-time {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted-text);
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.info-label {
  color: var(--muted-text);
}
.info-value {
  color: var(--bright-text);
  font-weight: 500;
}

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.achievement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 60px;
  text-align: center;
  cursor: help;
}

.achievement-icon {
  font-size: 2.5rem;
  color: var(--muted-text);
  background-color: rgba(0,0,0,0.2);
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.achievement-item:hover .achievement-icon {
  color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: var(--glow);
  transform: translateY(-3px);
}

.achievement-name {
  font-size: 12px;
  color: var(--muted-text);
  white-space: nowrap;
}

.reputation-display {
  text-align: center;
  margin-bottom: 20px;
}

.rep-label {
  font-size: 14px;
  color: var(--muted-text);
  margin-bottom: 5px;
}

.rep-score {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--bright-text);
  line-height: 1;
}

.rep-button.neutral {
    background-color: #72767d;
}

.rep-button.neutral:hover {
    background-color: #5d6269;
    transform: scale(1.1);
}

.rep-score.positive { color: #43b581; }
.rep-score.negative { color: #f04747; }

.reputation-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.rep-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

.rep-button.give {
  background-color: #43b581;
}
.rep-button.give:hover {
  background-color: #3aa873;
  transform: scale(1.1);
}

.rep-button.take {
  background-color: #f04747;
}
.rep-button.take:hover {
  background-color: #d84040;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .profile-header {
    margin-bottom: 25px;
  }

  .profile-banner {
    height: 200px;
  }
  
  .profile-header-content {
    position: relative;
    bottom: auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -100px; 
    padding: 0 15px;
  }
  
  .profile-user-info {
    padding-bottom: 0;
  }
  
  .profile-actions {
    padding-bottom: 0;
    margin-top: 15px;
  }
}

@media (max-width: 576px) {
  .profile-avatar {
    width: 120px;
    height: 120px;
  }
  
  .profile-header-content {
    margin-top: -80px;
  }
  
  .profile-username {
    font-size: 1.75rem;
  }
  
  .profile-rank {
    font-size: 0.9rem;
  }
  
  .profile-actions .btn {
    width: 100%;
  }
  
  .achievements-grid {
    gap: 10px;
    justify-content: center;
  }
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 20px;
    text-align: center;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: help;
    transition: transform 0.2s ease-in-out;
}

.badge-item:hover {
    transform: translateY(-5px);
}

.badge-icon-background {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background-color: #2a2a3e; 
    transition: all 0.2s ease;
}

.badge-icon-background i {
    font-size: 2em;
    color: var(--ms-primary-color); 
}

.badge-name {
    font-size: 0.8em;
    color: var(--text-color);
    font-weight: 500;
}

.achievement-name {
    font-size: 0.8em;
    color: var(--text-color);
    font-weight: 500;
    margin-top: 5px;
}

.achievement-item .achievement-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.8em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.achievement-item.locked .achievement-icon {
    color: #555;
    background-color: #2a2a3e;
    filter: grayscale(80%);
    opacity: 0.6;
}

.achievement-item:not(.locked) .achievement-icon {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

#profile-report-btn {
    background-color: #f04747; 
    border-color: #f04747;
}
#profile-report-btn:hover {
    background-color: #d84040; 
    border-color: #d84040;
}
.profile-report-overlay {
    display: none; position: fixed; z-index: 9999; top: 0; left: 0;
    width: 100vw; height: 100vh; background-color: rgba(0, 0, 0, 0.75);
    opacity: 0; transition: opacity 0.3s ease-in-out;
    align-items: center; justify-content: center;
}
.profile-report-overlay.visible { display: flex; opacity: 1; }
.profile-report-content {
    background-color: var(--card-bg); /* FIX: Was --card-bg-color */
    border: 1px solid var(--border-color);
    border-radius: 12px; box-shadow: var(--shadow-lg);
    width: 90%; max-width: 550px; position: relative;
    display: flex; flex-direction: column;
    transform: scale(0.95); transition: transform 0.3s ease-in-out;
}
.profile-report-overlay.visible .profile-report-content { transform: scale(1); }
.profile-report-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color);
}
.profile-report-header h3 { margin: 0; font-size: 1.25rem; color: var(--bright-text); }
.profile-report-close-btn {
    padding: 0.5rem; margin: -0.5rem; font-size: 1.5rem; font-weight: 700;
    line-height: 1; color: var(--muted-text); background-color: transparent;
    border: 0; cursor: pointer; opacity: 0.7; transition: opacity 0.2s ease;
}
.profile-report-close-btn:hover { opacity: 1; }
.profile-report-body { padding: 1.5rem; flex: 1 1 auto; }
.profile-report-body .form-group { margin-bottom: 1rem; }
.profile-report-body label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--light-text); }
.profile-report-body select, .profile-report-body textarea {
    display: block; width: 100%; padding: 0.75rem; font-size: 1rem;
    background-color: var(--dark-bg); /* FIX: Was --input-bg-color, using a defined variable */
    border: 1px solid var(--border-color);
    border-radius: 6px; color: var(--text-color);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.profile-report-body select:focus, .profile-report-body textarea:focus {
    border-color: var(--primary-color); outline: 0; box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}
.profile-report-body textarea { min-height: 100px; resize: vertical; }
.profile-report-footer {
    display: flex; justify-content: flex-end;
    padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); gap: 0.75rem;
}