/* === PROFILE PAGE === */
.profile-layout {
  display: flex;
  gap: 24px;
  max-width: 900px;
  margin: 0;
}
.profile-left {
  width: 280px;
  flex-shrink: 0;
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-avatar-wrapper {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  position: relative;
  cursor: default;
}
.profile-avatar-wrapper.editable {
  cursor: pointer;
}
.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  transition: opacity 0.2s;
}
.profile-avatar-wrapper.editable .profile-avatar-overlay {
  display: flex;
}
.profile-avatar-wrapper.editable:hover .profile-avatar-overlay {
  background: rgba(0, 0, 0, 0.65);
}
.profile-left h2 {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 6px;
}
.profile-role {
  font-size: 15px;
  font-family: var(--font-small);
  color: var(--accent);
  text-transform: capitalize;
  margin-bottom: 4px;
}
.profile-group {
  font-size: 14px;
  font-family: var(--font-small);
  color: var(--text-muted);
}

.profile-right {
  flex: 1;
  padding: 30px;
}
.profile-right h3 {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 20px;
}
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}
.profile-field label {
  display: block;
  font-size: 13px;
  font-family: var(--font-small);
  color: var(--text-muted);
  margin-bottom: 6px;
}
.profile-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  transition: var(--transition);
}
.profile-input:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-glass);
}
.profile-actions {
  display: flex;
  gap: 12px;
}
.profile-actions .auth-btn {
  font-size: 16px;
  padding: 14px 24px;
}

/* === AVATAR CROP MODAL === */
.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.avatar-crop-box {
  position: relative;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
}
.avatar-crop-box h3 {
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text-primary);
}
.avatar-crop-container {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}
.avatar-crop-container img {
  display: block;
  max-width: 100%;
}
.avatar-crop-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: flex-end;
}
.avatar-crop-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}
.avatar-crop-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.avatar-crop-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}
.avatar-crop-btn.save {
  background: var(--accent);
  color: #fff;
}
.avatar-crop-btn.save:hover {
  opacity: 0.85;
}

/* Circular crop guide overlay */
.cropper-view-box,
.cropper-face {
  border-radius: 50%;
}

/* Light theme: lightly darken panels so the white text stays readable */
[data-theme="light"] .profile-left,
[data-theme="light"] .profile-right,
[data-theme="light"] #page-profile .section-header {
  background: rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="light"] .profile-input {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff !important;
}
[data-theme="light"] .profile-input:not(:disabled) {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}
[data-theme="light"] .profile-left h2 { color: #fff !important; }
[data-theme="light"] .profile-role { color: var(--accent) !important; }
[data-theme="light"] .profile-group { color: rgba(255,255,255,0.6) !important; }
[data-theme="light"] .profile-right h3 { color: #fff !important; }
[data-theme="light"] .profile-field label { color: rgba(255,255,255,0.65) !important; }
[data-theme="light"] #page-profile .section-header h1,
[data-theme="light"] #page-profile .section-header h2 { color: #fff !important; }

@media (max-width: 768px) {
  .profile-layout { flex-direction: column; }
  .profile-left { width: 100%; }
}
