/* Client Profile Page Styles */

.client-profile-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

.client-profile {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* Header */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.profile-header .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 28px;
  color: #111827;
  background: linear-gradient(135deg, #93c5fd 0%, #a78bfa 100%);
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 6px 18px rgba(59,130,246,0.25);
  flex-shrink: 0;
}

.title-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.client-name {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 800;
  color: #111827;
}

.client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: #374151;
}

.client-meta .meta-item i { margin-inline-end: 6px; color: #2563eb; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f8fafc;
  color: #0f172a;
}
.chip-green { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.chip-purple { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.chip-blue { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.profile-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  background: #2563eb;
  color: #fff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 6px 16px rgba(37,99,235,0.25);
}
.profile-actions .btn:hover { background: #1d4ed8; }

/* Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 24px 24px;
}

.profile-section {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 16px;
}

.section-title {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title i { color: #2563eb; }

/* Key-Value pairs */
.kv { display: grid; gap: 10px; }
.kv-row { display: grid; grid-template-columns: 180px 1fr; gap: 10px; align-items: center; }
.kv-row .k { color: #374151; font-weight: 600; }
.kv-row .v { color: #111827; }

.status { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.status.on { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.status.off { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Responsive */
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .kv-row { grid-template-columns: 140px 1fr; }
}

@media (max-width: 600px) {
  .profile-header { flex-direction: column; align-items: flex-start; }
  .profile-actions { width: 100%; display: flex; justify-content: flex-start; }
  .kv-row { grid-template-columns: 1fr; }
}

/* Dark Mode Tweaks (complement global dark-mode.css) */
body.dark-mode .client-profile {
  background: #0f172a;
  border-color: rgba(255,255,255,0.08);
}
body.dark-mode .profile-header {
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  border-bottom-color: rgba(255,255,255,0.06);
}
body.dark-mode .client-name { color: #e5e7eb; }
body.dark-mode .client-meta { color: #9ca3af; }
body.dark-mode .profile-section { background: #0f172a; border-color: rgba(255,255,255,0.08); }
body.dark-mode .section-title { color: #e5e7eb; }
body.dark-mode .kv-row .k { color: #9ca3af; }
body.dark-mode .kv-row .v { color: #e5e7eb; }
body.dark-mode .chip { background: #111827; color: #e5e7eb; border-color: rgba(255,255,255,0.08); }

/* --------------------------------------------------
   Report Section (ACF "تقرير_الملف") typography
   Scoped to avoid bleeding into other areas
-------------------------------------------------- */
.profile-section-report .report-content {
  color: #111827;
  font-size: 15px;
  line-height: 1.7;
}
.profile-section-report h1,
.profile-section-report h2,
.profile-section-report h3,
.profile-section-report h4,
.profile-section-report h5,
.profile-section-report h6 {
  color: #111827;
  margin: 0 0 12px;
  line-height: 1.3;
}
.profile-section-report h1 { font-size: 1.6rem; }
.profile-section-report h2 { font-size: 1.35rem; }
.profile-section-report h3 { font-size: 1.2rem; }
.profile-section-report h4 { font-size: 1.08rem; }
.profile-section-report h5 { font-size: 1rem; }
.profile-section-report h6 { font-size: 0.95rem; }

.profile-section-report .report-content p { margin: 0 0 10px; }
.profile-section-report .report-content p + p { margin-top: 8px; }

.profile-section-report .report-content ul,
.profile-section-report .report-content ol {
  margin: 0 0 12px;
  padding-inline-start: 22px;
}
.profile-section-report .report-content li { margin: 4px 0; }

.profile-section-report .report-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-section-report .report-content a:hover { color: #1d4ed8; }

.profile-section-report .report-content img,
.profile-section-report .report-content video,
.profile-section-report .report-content iframe {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.profile-section-report .report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  border: 1px solid rgba(0,0,0,0.08);
}
.profile-section-report .report-content th,
.profile-section-report .report-content td {
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.08);
  text-align: start;
}
.profile-section-report .report-content thead th {
  background: #f8fafc;
  color: #111827;
}

.profile-section-report .report-content blockquote {
  margin: 10px 0;
  padding: 10px 14px;
  border-inline-start: 3px solid #2563eb;
  background: #f8fafc;
  border-radius: 8px;
}

.profile-section-report .report-content pre,
.profile-section-report .report-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #f8fafc;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
}
.profile-section-report .report-content code { padding: 0 4px; }
.profile-section-report .report-content pre { padding: 10px; overflow: auto; }

.profile-section-report .report-content hr {
  border: 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 14px 0;
}

/* Dark mode for report content */
body.dark-mode .profile-section-report .report-content { color: #e5e7eb; }
body.dark-mode .profile-section-report h1,
body.dark-mode .profile-section-report h2,
body.dark-mode .profile-section-report h3,
body.dark-mode .profile-section-report h4,
body.dark-mode .profile-section-report h5,
body.dark-mode .profile-section-report h6 { color: #e5e7eb; }
body.dark-mode .profile-section-report .report-content a { color: #93c5fd; }
body.dark-mode .profile-section-report .report-content a:hover { color: #60a5fa; }
body.dark-mode .profile-section-report .report-content table { border-color: rgba(255,255,255,0.08); }
body.dark-mode .profile-section-report .report-content th,
body.dark-mode .profile-section-report .report-content td { border-color: rgba(255,255,255,0.08); }
body.dark-mode .profile-section-report .report-content thead th { background: #0b1220; color: #e5e7eb; }
body.dark-mode .profile-section-report .report-content blockquote { background: #0b1220; border-inline-start-color: #3b82f6; }
body.dark-mode .profile-section-report .report-content pre,
body.dark-mode .profile-section-report .report-content code { background: #0b1220; border-color: rgba(255,255,255,0.06); color: #e5e7eb; }
body.dark-mode .profile-section-report .report-content hr { border-top-color: rgba(255,255,255,0.08); }
