/* Profile Page Styles */
.profile-container {
  width: 100%;
  padding: 16px;
  background-color: rgba(20, 20, 20, 0.95);
  background-image: 
    linear-gradient(rgba(40, 40, 40, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 40, 40, 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  border: 1px solid rgba(30, 30, 30, 0.5);
  border-top: 2px solid #3498db;
  color: #ffffff;
  overflow-y: auto;
  position: relative;
}

.profile-container::before {
  display: none;
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(50, 50, 50, 0.5);
  position: relative;
  flex-wrap: nowrap;
}

.profile-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 1px;
  background-color: #e74c3c;
}

.profile-avatar-container {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-right: 12px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(70, 70, 70, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.profile-avatar-container::before {
  display: none;
}

.profile-avatar-placeholder {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  line-height: 44px;
}

.profile-user-info {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.profile-display-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.profile-display-name {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 2px 0;
  color: #e74c3c;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-edit-name-button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 4px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-edit-name-button img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.75;
}

.profile-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.profile-overall-rating {
  text-align: center;
  padding: 2px 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 4px;
}

.profile-overall-rating-value {
  font-size: 18px;
  font-weight: 700;
  color: #3498db;
  font-family: 'Orbitron', sans-serif;
  line-height: 1.2;
}

.profile-overall-rating-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-header-actions {
  flex: 0 0 auto;
}

/* Career Progress Section */
.profile-career-container {
  margin-bottom: 12px;
}

.career-progress-card {
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.95), rgba(30, 35, 50, 0.9));
  border: 1px solid rgba(52, 152, 219, 0.25);
  border-radius: 4px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}

.career-progress-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3498db, #e74c3c);
}

.career-progress-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.career-rank-badge-small {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(52, 152, 219, 0.2));
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.career-rank-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.career-rank-number-label {
  font-size: 9px;
  font-weight: 700;
  color: #e74c3c;
  font-family: 'Orbitron', sans-serif;
  line-height: 1;
}

.career-rank-details {
  flex: 1;
  min-width: 0;
}

.career-rank-name-label {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.career-rank-points-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.career-missions-stat {
  flex-shrink: 0;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 4px 10px;
  border: 1px solid rgba(50, 50, 50, 0.5);
}

.career-missions-value {
  font-size: 14px;
  font-weight: 700;
  color: #2ecc71;
  font-family: 'Orbitron', sans-serif;
}

.career-missions-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.career-progress-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.career-progress-track {
  flex: 1;
  height: 4px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
}

.career-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #e74c3c);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.career-next-rank-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Section Titles */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #e74c3c;
  margin: 12px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(50, 50, 50, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-text {
  display: flex;
  align-items: center;
}

.section-title-text::before {
  content: "★";
  margin-right: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.section-title::before {
  content: none;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, rgba(50, 50, 50, 0.5), transparent);
  z-index: 0;
}

.section-title-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-wl-record {
  font-size: 12px;
  font-weight: 600;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
}

.wl-wins {
  color: #2ecc71;
}

.wl-losses {
  color: #e74c3c;
}

/* Games List Container */
.games-list-container {
  width: 100%;
  height: 300px;
  overflow-y: auto;
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 2px;
  border: 1px solid rgba(50, 50, 50, 0.5);
  margin-bottom: 12px;
  position: relative;
}

.games-list-container::-webkit-scrollbar {
  width: 4px;
}

.games-list-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.games-list-container::-webkit-scrollbar-thumb {
  background: rgba(80, 80, 80, 0.5);
}

.games-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.7);
}

/* Game Item */
.game-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(50, 50, 50, 0.3);
  cursor: pointer;
  transition: background-color 0.2s;
  gap: 10px;
}

.game-item:last-child {
  border-bottom: none;
}

.game-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.game-item:active {
  background-color: rgba(255, 255, 255, 0.08);
}

.game-item-result {
  width: 4px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
}

.game-item-result.win {
  background-color: #2ecc71;
}

.game-item-result.loss {
  background-color: #e74c3c;
}

.game-item-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.game-item-opponents {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.game-item-opponents .opponent-name {
  cursor: pointer;
  transition: color 0.15s;
}

.game-item-opponents .opponent-name:hover {
  color: #3498db;
  text-decoration: underline;
}

.game-item-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.game-item-score {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Orbitron', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.games-loading, .games-empty {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

/* Profile error message */
.profile-error {
  padding: 15px;
  text-align: center;
  color: #e74c3c;
  background-color: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 2px;
  margin: 20px auto;
  max-width: 90%;
}

/* Error Logs Button Styles */
.error-logs-button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #393939;
  color: #fff;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  position: relative;
  transition: background-color 0.2s ease;
  z-index: 1;
  opacity: 0.3;
}

.error-logs-button:hover {
  background-color: #999;
}

.error-logs-button.has-errors {
  background-color: #e74c3c;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
  }
}

/* Player Profile Overlay (other player full-screen page) */
.player-profile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding-top: var(--sat);
  padding-bottom: var(--sab);
  background-color: rgba(10, 10, 10, 0.98);
  z-index: 2000;
  overflow-y: auto;
}

.player-profile-page {
  width: 100%;
  min-height: 100%;
}
