/* ===== USER PROFILE MODAL ===== */

.user-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease;
}

.user-profile-container {
  position: relative;
  width: 90%;
  max-width: 500px;
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
}

body[data-theme="blue"] .user-profile-modal{
  background: rgba(3, 10, 32, 0.86);
}
body[data-theme="blue"] .user-profile-container{
  background: linear-gradient(135deg, #0b1b3b 0%, #0f224d 100%);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.user-profile-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.user-profile-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

/* Header */

.user-profile-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.user-profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 4px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.user-profile-avatar-letter {
  color: white;
  font-size: 48px;
  font-weight: bold;
}

.user-profile-username {
  color: white;
  font-size: 1.75rem;
  margin: 0 0 0.25rem 0;
  font-weight: bold;
}

.user-profile-display-name {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin: 0;
  font-style: italic;
}

.user-profile-avatar-actions{
  margin-top: 0.4rem;
}
.user-profile-privacy-row{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.9);
}
.user-profile-privacy-row select{
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(148,163,184,0.4);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
}
.user-profile-input{
  width: 100%;
  margin-bottom: 0.4rem;
  background: rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  color: #e2e8f0;
  font-size: 0.72rem;
}
.user-profile-btn-ghost{
  background: rgba(15, 23, 42, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,0.45);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.user-profile-btn-ghost:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

/* Bio */

.user-profile-bio {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.user-profile-bio p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Stats */

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

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

.user-profile-stat-value {
  display: block;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.user-profile-stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Actions */

.user-profile-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.user-profile-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-profile-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.user-profile-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.user-profile-btn-primary:active {
  transform: translateY(0);
}

/* Footer */

.user-profile-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile-seed {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  margin: 0;
}

.user-profile-version {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.7rem;
  margin: 4px 0 0 0;
}

/* Friends list in profile */
.user-profile-friends {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile-no-friends {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin: 0;
}

.user-profile-friends-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-profile-friend {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  color: #7dd3fc;
}

/* Loading & No Island */

.user-profile-loading,
.user-profile-no-island {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive */

@media (max-width: 600px) {
  .user-profile-container {
    width: 95%;
    padding: 1.5rem;
  }

  .user-profile-avatar {
    width: 80px;
    height: 80px;
  }

  .user-profile-avatar-letter {
    font-size: 36px;
  }

  .user-profile-username {
    font-size: 1.5rem;
  }

  .user-profile-stats {
    gap: 1rem;
  }

  .user-profile-stat-value {
    font-size: 1.25rem;
  }
}

/* Light theme */

body[data-theme="light"] .user-profile-container {
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
}

body[data-theme="light"] .user-profile-username {
  color: #1e3a8a;
}

body[data-theme="light"] .user-profile-display-name {
  color: rgba(30, 58, 138, 0.7);
}

body[data-theme="light"] .user-profile-btn-ghost{
  background: rgba(255, 255, 255, 0.85);
  color: #1e293b;
  border-color: rgba(99, 102, 241, 0.45);
}
body[data-theme="light"] .user-profile-privacy-row{
  color: rgba(30, 41, 59, 0.9);
}
body[data-theme="light"] .user-profile-privacy-row select{
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
  border-color: rgba(99, 102, 241, 0.45);
}
body[data-theme="light"] .user-profile-input{
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
  border-color: rgba(99, 102, 241, 0.45);
}

body[data-theme="light"] .user-profile-bio {
  background: rgba(255, 255, 255, 0.5);
}

body[data-theme="light"] .user-profile-bio p {
  color: #1e3a8a;
}

body[data-theme="light"] .user-profile-stat-value {
  color: #1e3a8a;
}

body[data-theme="light"] .user-profile-stat-label {
  color: rgba(30, 58, 138, 0.6);
}

body[data-theme="light"] .user-profile-seed {
  color: rgba(30, 58, 138, 0.5);
}

body[data-theme="light"] .user-profile-loading,
body[data-theme="light"] .user-profile-no-island {
  color: rgba(30, 58, 138, 0.7);
}

body[data-theme="light"] .user-profile-close {
  background: rgba(30, 58, 138, 0.15);
  color: #1e3a8a;
}

body[data-theme="light"] .user-profile-close:hover {
  background: rgba(30, 58, 138, 0.25);
}

body[data-theme="light"] .user-profile-footer {
  border-top-color: rgba(30, 58, 138, 0.1);
}

/* Password Change Form */
.user-profile-password-form {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile-form-group {
  margin-bottom: 0.75rem;
}

.user-profile-form-group label {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.user-profile-form-group .user-profile-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.user-profile-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.user-profile-success {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.user-profile-password-form .user-profile-btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

body[data-theme="light"] .user-profile-password-form {
  background: rgba(255, 255, 255, 0.5);
}

body[data-theme="light"] .user-profile-form-group label {
  color: rgba(30, 58, 138, 0.8);
}

body[data-theme="light"] .user-profile-error {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}

body[data-theme="light"] .user-profile-success {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
}
