/**
 * DrawLeague Profile Styles
 * Follows the graphic charter: Playful Minimal Creative
 */

/* Profile Page Layout */
.profile-page {
  min-height: calc(100vh - 200px);
  padding: var(--space-xl) 0;
  background: linear-gradient(180deg, var(--color-light-blue) 0%, var(--color-background) 50%);
  position: relative;
}

.profile-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background-image: url('../images/watercolor-texture.svg');
  background-size: 500px 500px;
  opacity: 0.12;
  pointer-events: none;
}

.profile-container {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-xl);
}

@media (max-width: 600px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-light-blue) 0%, #E6E6FA 50%, var(--color-warm-cream, #FFF8F3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 4px solid var(--color-surface);
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.12);
  position: relative;
}

/* Subtle decorative ring */
.profile-avatar::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px dashed var(--color-border);
  opacity: 0.4;
}

.profile-avatar .avatar-initial {
  font-size: 3rem;
  font-weight: 600;
  color: var(--color-text);
}

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

.profile-info {
  flex: 1;
}

.profile-info h2 {
  margin-bottom: var(--space-xs);
}

.profile-info .muted {
  margin-bottom: var(--space-md);
}

.profile-badges {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.role-badge.admin {
  background-color: #fef3c7;
  color: #92400e;
}

.role-badge.artiste {
  background-color: #dbeafe;
  color: #1e40af;
}

.member-since {
  font-size: var(--font-size-sm);
}

/* Profile Form */
.profile-form {
  padding: var(--space-xl);
}

.profile-form h3 {
  margin-bottom: var(--space-lg);
}

.profile-form form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.profile-form .form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-md);
}

/* Stats */
.profile-stats {
  padding: var(--space-xl);
}

.profile-stats h3 {
  margin-bottom: var(--space-lg);
}

.profile-stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .profile-stats .stats-grid {
    grid-template-columns: 1fr;
  }
}

.profile-stats .stat-item {
  text-align: center;
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--color-background) 0%, var(--color-warm-cream, #FFF8F3) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 41, 55, 0.04);
}

.profile-stats .stat-number {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.profile-stats .stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-muted);
}

/* Danger Zone */
.danger-zone {
  padding: var(--space-xl);
  border: 1px solid #fecaca;
}

.danger-zone h3 {
  color: #dc2626;
  margin-bottom: var(--space-sm);
}

.danger-zone .muted {
  margin-bottom: var(--space-lg);
}

.danger-zone .btn {
  color: #dc2626;
  border-color: #fecaca;
}

.danger-zone .btn:hover {
  background-color: #fef2f2;
}

/* Upload overlay animation */
.profile-avatar.uploading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image preview */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background-color: rgba(0, 0, 0, 0.5);
}

.image-preview-content {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.image-preview-content h3 {
  margin-bottom: var(--space-md);
}

.preview-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-lg);
  border: 4px solid var(--color-border);
}

.preview-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
}
