/* ═══════════════════════════════════════════════════════════════════════════ */
/* PROFILE PANEL                                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

.profile-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.3); display: none;
}
.profile-overlay.open { display: block; }

.profile-panel {
  position: fixed; z-index: 550;
  bottom: 80px; left: 16px;
  width: 420px;
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: none;
}
.profile-panel.open { display: block; animation: scaleIn 0.2s ease; }

.profile-banner {
  height: 100px; background: var(--card-bg);
  position: relative; display: flex; align-items: center;
  justify-content: center; overflow: hidden;
}

.profile-photo-wrap {
  position: relative; width: 72px; height: 72px;
  border-radius: var(--radius-full); cursor: pointer;
  overflow: hidden;
}
.profile-photo {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--radius-full);
}
.profile-photo-placeholder {
  color: var(--text-dim); opacity: 0.4;
}
.profile-photo-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  opacity: 0; transition: var(--transition); color: #fff;
}
.profile-photo-wrap:hover .profile-photo-overlay { opacity: 1; }

.profile-body { padding: 20px 24px; }

.profile-name-row {
  display: flex; align-items: center; gap: 8px;
  justify-content: center; margin-bottom: 4px;
}
.profile-name { font-size: 1.1rem; font-weight: 600; color: var(--text); }

.profile-email {
  text-align: center; color: var(--text-muted);
  font-size: 0.8rem; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); display: inline-block;
}

.profile-field { margin-bottom: 10px; }
.profile-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--primary); margin-bottom: 2px;
}
.profile-label svg { color: var(--text-dim); }
.profile-value { font-size: 0.875rem; color: var(--text); }

.profile-row-3 {
  display: flex; gap: 16px; margin: 16px 0;
  flex-wrap: wrap;
}
.profile-field-sm { flex: 1; min-width: 100px; }
.profile-select-row {
  display: flex; align-items: center; gap: 4px;
  color: var(--text); font-size: 0.8rem; cursor: pointer;
}
.flag-icon { font-size: 1rem; }

.profile-theme-toggle {
  display: flex; align-items: center; gap: 6px;
}
.theme-toggle {
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--text-dim); position: relative;
  transition: var(--transition);
}
.theme-toggle.active { background: var(--primary); }
.theme-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text); transition: var(--transition);
}
.theme-toggle.active .theme-thumb { left: 20px; }
.theme-icon { font-size: 0.85rem; }

.profile-actions {
  display: flex; gap: 12px; margin-top: 16px;
}
.profile-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 6px; padding: 14px 12px;
  border-radius: var(--radius); font-size: 0.7rem;
  font-weight: 700; letter-spacing: 0.05em;
  transition: var(--transition);
}
.profile-btn.green {
  border: 1px solid var(--primary); color: var(--primary);
}
.profile-btn.green:hover { background: var(--primary-light); }
.profile-btn.red {
  border: 1px solid var(--destructive); color: var(--destructive);
}
.profile-btn.red:hover { background: rgba(239, 68, 68, 0.1); }

/* Name inline edit */
.profile-name-input {
  font-size: 1.1rem; font-weight: 600; color: var(--text);
  background: transparent; border: none;
  border-bottom: 2px solid var(--primary);
  outline: none; text-align: center; font-family: inherit;
  width: 200px;
}

/* Timezone dropdown */
.profile-tz-trigger { cursor: pointer; }
.profile-tz-dropdown {
  display: none; position: absolute; z-index: 30;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-xl);
  max-height: 200px; overflow-y: auto; padding: 4px;
  min-width: 260px; margin-top: 4px;
}
.profile-tz-dropdown.open { display: block; animation: slideDown 0.15s ease; }
.profile-tz-option {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; font-size: 0.8rem; color: var(--text);
  border-radius: var(--radius); transition: var(--transition);
}
.profile-tz-option:hover { background: rgba(27, 38, 59, 0.5); }
.profile-tz-option.selected { color: var(--primary); font-weight: 500; }

.profile-field-sm { position: relative; }

@media (max-width: 768px) {
  .profile-body {
    padding: 16px;
  }

  .profile-actions {
    gap: 8px;
  }

  .profile-btn {
    padding: 12px 8px;
  }
}

@media (max-width: 480px) {
  .profile-actions {
    flex-direction: column;
  }

  .profile-tz-dropdown {
    min-width: 100%;
    left: 0;
  }
}
