* { box-sizing: border-box; }

:root {
  --bg-primary: #0f1115;
  --bg-secondary: #151922;
  --bg-card: linear-gradient(145deg, #1c2230 0%, #171c26 100%);
  --bg-card-hover: linear-gradient(145deg, #232a3b 0%, #1c2230 100%);
  --text-primary: #eaeaea;
  --text-secondary: #a0a0a0;
  --border-color: rgba(255, 255, 255, 0.05);
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-elevated: rgba(0, 0, 0, 0.5);
  --accent-blue: #4a9eff;
  --accent-green: #4ade80;
  --accent-purple: #a78bfa;
  --gradient-overlay: linear-gradient(135deg, rgba(74, 158, 255, 0.03) 0%, rgba(167, 139, 250, 0.03) 100%);
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  pointer-events: none;
  z-index: 0;
}

header {
  padding: 20px;
  text-align: center;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  font-size: 24px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px var(--shadow), 0 1px 0 var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.home-btn {
  position: absolute;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  left: 15px;
}

.home-btn:hover {
  background: var(--border-color);
  transform: scale(1.1);
}

.header-title {
  flex: 1;
}

.header-actions {
  position: absolute;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.messages-icon {
  width: 35px;
  height: 35px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  position: relative;
}

.messages-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--shadow);
}

.messages-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ff4757 0%, #e84118 100%);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
  min-width: 18px;
  text-align: center;
}

.user-icon {
  width: 35px;
  height: 35px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
}

.user-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--shadow);
}

.profile-wrapper {
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 30px;
  position: relative;
  z-index: 1;
}

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 15px var(--shadow), 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3245 0%, #1f2633 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: bold;
  color: var(--text-secondary);
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.05);
  border: 3px solid var(--border-color);
}

.username {
  margin: 0 0 8px 0;
  font-size: 24px;
}

.user-status {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: var(--accent-green);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.btn:hover {
  background: var(--border-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #3a7fd5 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-blue);
  padding: 10px;
  font-size: 13px;
}

.btn-link:hover {
  background: var(--border-color);
  transform: none;
}

.friends-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px var(--shadow), 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.section-title {
  margin: 0 0 15px 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.count {
  background: var(--border-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: normal;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.2s;
  cursor: pointer;
}

.friend-item:hover {
  background: var(--border-color);
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3245 0%, #1f2633 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.friend-status {
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card, .activity-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 15px var(--shadow), 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 15px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.info-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.info-value {
  font-weight: 500;
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 25px 20px;
  text-align: center;
  transition: all 0.3s;
  box-shadow: 0 4px 15px var(--shadow), 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px var(--shadow-elevated), 0 4px 8px rgba(0, 0, 0, 0.2);
  background: var(--bg-card-hover);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.stat-card h3 {
  margin: 10px 0 5px;
  font-size: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card p {
  margin: 0;
  opacity: 0.7;
  font-size: 14px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.activity-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.activity-item:hover {
  background: var(--border-color);
  transform: translateX(5px);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.2), rgba(167, 139, 250, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 14px;
  margin-bottom: 4px;
}

.activity-time {
  font-size: 12px;
  color: var(--text-secondary);
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  opacity: 0.5;
  margin-top: 40px;
}

@media (max-width: 1024px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  
  .profile-sidebar {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .profile-wrapper {
    padding: 0 20px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
