/* ============================================================
   SUGAM — profile.css
   Page 3: User Profile — avatar, QR code, stats, edit form
   ============================================================ */

/* ── Page Layout ─────────────────────────────────────────── */
.profile-page {
  display: flex;
  min-height: calc(100vh - 56px);
  background: var(--gray-light);
}

/* ── Left Column (blue panel) ────────────────────────────── */
.profile-left {
  width: 260px;
  background: var(--blue);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 24px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

/* Avatar */
.profile-avatar-wrap {
  position: relative;
  margin-bottom: 14px;
  cursor: pointer;
}
.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--red-light);
  border: 3px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--red);
  overflow: hidden;
  transition: opacity 0.2s;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-wrap:hover .profile-avatar { opacity: 0.85; }
.avatar-edit-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-edit-badge i { font-size: 12px; color: var(--white); }

/* Name & role */
.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  margin-bottom: 6px;
}
.profile-role-badge {
  background: var(--red-dark);
  color: var(--white);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}
.profile-contact {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  text-align: center;
  line-height: 1.8;
  margin-bottom: 16px;
}
.profile-contact i {
  font-size: 13px;
  margin-right: 5px;
  color: rgba(255,255,255,0.55);
}

/* Divider in left panel */
.profile-left-divider {
  width: 100%;
  height: 0.5px;
  background: rgba(255,255,255,0.2);
  margin: 4px 0 14px;
}

/* ── QR Code Card ────────────────────────────────────────── */
.qr-card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  text-align: center;
}
.qr-card-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.qr-code-img {
  width: 130px;
  height: 130px;
  margin: 0 auto 12px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  overflow: hidden;
}
.qr-code-img canvas,
.qr-code-img img { width: 100%; height: 100%; }
.qr-code-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}
.qr-code-placeholder i { font-size: 36px; }
.qr-code-placeholder span { font-size: 11px; }
.qr-btns {
  display: flex;
  gap: 8px;
}
.qr-btn {
  flex: 1;
  padding: 7px 6px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.qr-btn-download {
  background: var(--red);
  color: var(--white);
  border: none;
}
.qr-btn-download:hover { background: var(--red-dark); }
.qr-btn-share {
  background: var(--white);
  color: var(--red);
  border: 1.5px solid var(--red);
}
.qr-btn-share:hover { background: var(--red-light); }

/* ── Right Column ────────────────────────────────────────── */
.profile-right {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

/* Section heading */
.section-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.section-heading i { font-size: 18px; color: var(--blue); }

/* ── Stats Row ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-card {
  background: var(--white);
  border-radius: 10px;
  padding: 14px 12px;
  border: 0.5px solid var(--border);
  text-align: center;
}
.stat-card-number {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 5px;
}
.stat-card-label {
  font-size: 11px;
  color: var(--muted);
}

/* ── Edit Profile Form Card ──────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 0.5px solid var(--border);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.form-label .required { color: var(--red); margin-left: 2px; }
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--blue); }
.form-input:disabled {
  background: var(--gray-light);
  color: var(--muted);
  cursor: not-allowed;
}

/* Avatar upload row */
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar-preview-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red-light);
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--red);
  flex-shrink: 0;
}
.avatar-preview-sm img { width: 100%; height: 100%; object-fit: cover; }
.btn-browse {
  padding: 7px 14px;
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}
.btn-browse:hover { background: #E0E0E0; }
.avatar-hint { font-size: 11px; color: var(--muted); }
#avatarFileInput { display: none; }

/* Form actions */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.btn-save {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s;
  font-family: var(--font);
}
.btn-save:hover { background: var(--red-dark); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-reset {
  background: var(--white);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}
.btn-reset:hover { background: var(--gray-light); }

/* Success banner */
.save-success {
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--green);
  display: none;
  align-items: center;
  gap: 7px;
}
.save-success.show { display: flex; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .profile-page  { flex-direction: column; }
  .profile-left  { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 20px; }
  .qr-card       { width: auto; }
  .form-row      { grid-template-columns: 1fr; }
  .stats-row     { grid-template-columns: repeat(3, 1fr); }
  .profile-right { padding: 16px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
