/* ODSLocal Contributor Profiles ─ styles */
:root {
  --odslp-primary:   #1e3270;
  --odslp-accent:    #2563eb;
  --odslp-green:     #16a34a;
  --odslp-yellow:    #d97706;
  --odslp-red:       #dc2626;
  --odslp-surface:   #fff;
  --odslp-bg:        #f8fafc;
  --odslp-border:    #e2e8f0;
  --odslp-text:      #111827;
  --odslp-muted:     #6b7280;
  --odslp-radius:    14px;
  --odslp-shadow:    0 4px 18px rgba(15,23,42,.09);
  --odslp-shadow-lg: 0 16px 48px rgba(15,23,42,.14);
  --odslp-ease:      cubic-bezier(.4,0,.2,1);
}

/* ── Base wrapper ──────────────────────────────────────────────────── */
.odslp-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--odslp-text);
  font-size: 14px;
  line-height: 1.6;
}
.odslp-card {
  background: var(--odslp-surface);
  border: 1px solid var(--odslp-border);
  border-radius: var(--odslp-radius);
  padding: 20px 24px;
  box-shadow: var(--odslp-shadow);
  margin-bottom: 18px;
}
.odslp-empty {
  text-align: center;
  color: var(--odslp-muted);
  padding: 40px 24px;
  background: var(--odslp-bg);
  border-style: dashed;
}

/* ── Profile hero ──────────────────────────────────────────────────── */
.odslp-hero {
  background: linear-gradient(135deg, var(--odslp-primary) 0%, #2a4580 100%);
  color: #fff;
  border-radius: var(--odslp-radius);
  padding: 28px 28px 22px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
  box-shadow: var(--odslp-shadow-lg);
}
.odslp-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.4);
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(255,255,255,.15);
}
.odslp-hero-info { flex: 1; min-width: 0; }
.odslp-hero-name {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.2;
}
.odslp-hero-role {
  font-size: 13px;
  opacity: .8;
  margin: 0 0 8px;
}
.odslp-hero-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  opacity: .75;
}
.odslp-hero-meta span { display: flex; align-items: center; gap: 4px; }
.odslp-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-end;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.odslp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  white-space: nowrap;
}
.odslp-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); text-decoration: none; }
.odslp-btn-primary   { background: var(--odslp-accent); color: #fff; }
.odslp-btn-secondary { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.odslp-btn-outline   { background: transparent; color: var(--odslp-primary); border: 1.5px solid var(--odslp-border); }
.odslp-btn-outline:hover { border-color: var(--odslp-accent); color: var(--odslp-accent); }
.odslp-btn-ghost  { background: var(--odslp-bg); color: var(--odslp-text); }
.odslp-btn-sm     { padding: 5px 12px; font-size: 12px; }
.odslp-btn-group  { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Stats grid ────────────────────────────────────────────────────── */
.odslp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.odslp-stat-card {
  background: var(--odslp-surface);
  border: 1px solid var(--odslp-border);
  border-radius: var(--odslp-radius);
  padding: 16px 18px;
  text-align: center;
  transition: box-shadow .15s, border-color .15s;
}
.odslp-stat-card:hover { box-shadow: var(--odslp-shadow); border-color: #cbd5e1; }
.odslp-stat-value { font-size: 34px; font-weight: 900; color: var(--odslp-primary); line-height: 1; margin-bottom: 4px; letter-spacing: -1px; }
.odslp-stat-label { font-size: 11px; color: var(--odslp-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ── QR section ────────────────────────────────────────────────────── */
.odslp-qr-section {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.odslp-qr-img {
  width: 140px;
  height: 140px;
  border: 2px solid var(--odslp-border);
  border-radius: 10px;
  padding: 6px;
  background: #fff;
  flex-shrink: 0;
}
.odslp-qr-info { flex: 1; min-width: 200px; }
.odslp-qr-info h3 { margin: 0 0 6px; font-size: 15px; }
.odslp-qr-info p  { margin: 0 0 10px; color: var(--odslp-muted); font-size: 13px; }
.odslp-verify-url {
  font-size: 11px;
  background: var(--odslp-bg);
  border: 1px solid var(--odslp-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  color: var(--odslp-muted);
  display: block;
  margin-bottom: 8px;
}

/* ── Territory table ───────────────────────────────────────────────── */
.odslp-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--odslp-border); }
.odslp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.odslp-table thead th {
  padding: 8px 14px;
  background: var(--odslp-bg);
  font-weight: 700;
  color: var(--odslp-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 10px;
  text-align: left;
  border-bottom: 1px solid var(--odslp-border);
}
.odslp-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.odslp-table tbody tr:last-child { border-bottom: none; }
.odslp-table tbody tr:nth-child(even) { background: var(--odslp-bg); }
.odslp-table tbody tr:hover { background: #eff6ff; }
.odslp-table td { padding: 9px 14px; vertical-align: middle; }
.odslp-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e0e7ff;
  color: #3730a3;
}
.odslp-badge.approved  { background: #dcfce7; color: #14532d; }
.odslp-badge.pending   { background: #fef3c7; color: #78350f; }
.odslp-badge.rejected  { background: #fee2e2; color: #7f1d1d; }

/* ── Year chart bars ───────────────────────────────────────────────── */
.odslp-year-bars { display: flex; gap: 6px; align-items: flex-end; height: 80px; margin-top: 8px; }
.odslp-year-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.odslp-year-bar {
  width: 100%;
  min-height: 4px;
  background: var(--odslp-primary);
  border-radius: 4px 4px 0 0;
  opacity: .75;
  transition: opacity .15s;
}
.odslp-year-bar:hover { opacity: 1; }
.odslp-year-label { font-size: 9px; color: var(--odslp-muted); font-weight: 600; writing-mode: vertical-lr; transform: rotate(180deg); white-space: nowrap; }

/* ── Section heading ───────────────────────────────────────────────── */
.odslp-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--odslp-primary);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.odslp-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--odslp-border);
}

/* ── Verify badge ──────────────────────────────────────────────────── */
.odslp-verify-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 24px;
  background: linear-gradient(135deg, #14532d 0%, #16a34a 100%);
  border-radius: var(--odslp-radius);
  color: #fff;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: var(--odslp-shadow-lg);
}
.odslp-verify-icon { font-size: 48px; }
.odslp-verify-badge h2 { margin: 0; font-size: 20px; font-weight: 800; }
.odslp-verify-badge p  { margin: 0; opacity: .85; font-size: 13px; }
.odslp-verify-invalid {
  border-radius: var(--odslp-radius);
  padding: 28px 24px;
  background: #fee2e2;
  border: 2px solid #fca5a5;
  text-align: center;
  color: #7f1d1d;
}

/* ── Bio text ──────────────────────────────────────────────────────── */
.odslp-bio { color: var(--odslp-muted); font-size: 13px; margin: 0; line-height: 1.65; }
.odslp-orcid { font-size: 12px; color: var(--odslp-muted); }
.odslp-orcid a { color: #a6ce39; font-weight: 700; text-decoration: none; }
.odslp-orcid a:hover { text-decoration: underline; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.odslp-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e3270;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--odslp-shadow-lg);
  z-index: 9999;
  animation: odslp-toast-in .25s var(--odslp-ease);
}
@keyframes odslp-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Edit profile ──────────────────────────────────────────────────── */
.odslp-edit-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.odslp-edit-avatar-card { padding: 20px 24px; }
.odslp-edit-avatar-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.odslp-edit-avatar-preview-wrap { position: relative; }
.odslp-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--odslp-border);
  display: block;
}
.odslp-avatar-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--odslp-accent);
  cursor: pointer;
  text-decoration: underline dotted;
}
.odslp-avatar-upload-label:hover { color: var(--odslp-primary); }
.odslp-edit-avatar-info { flex: 1; min-width: 200px; }
.odslp-edit-avatar-info p { font-size: 12px; color: var(--odslp-muted); margin: 0 0 10px; }

.odslp-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.odslp-field { display: flex; flex-direction: column; gap: 4px; }
.odslp-label { font-size: 12px; font-weight: 700; color: var(--odslp-text); }
.odslp-input {
  padding: 9px 12px;
  border: 1.5px solid var(--odslp-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--odslp-text);
  background: var(--odslp-bg);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.odslp-input:focus { border-color: var(--odslp-accent); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.odslp-textarea { resize: vertical; min-height: 90px; }
.odslp-field-hint { font-size: 11px; color: var(--odslp-muted); }

.odslp-edit-visibility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--odslp-bg);
  border-radius: 10px;
  border: 1px solid var(--odslp-border);
  flex-wrap: wrap;
}
.odslp-edit-visibility-row p { margin: 4px 0 0; }

.odslp-edit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.odslp-edit-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--odslp-green);
}
.odslp-edit-status.is-error { color: var(--odslp-red); }

/* ── Social links (public profile display) ─────────────────────────── */
.odslp-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.odslp-social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.25);
  transition: background .15s;
}
.odslp-social-link:hover { background: rgba(255,255,255,.28); color: #fff; text-decoration: none; }

/* On white background (stats cards / outside hero) */
.odslp-social-links-muted .odslp-social-link {
  background: var(--odslp-bg);
  color: var(--odslp-accent);
  border-color: var(--odslp-border);
}
.odslp-social-links-muted .odslp-social-link:hover { border-color: var(--odslp-accent); }

/* ── Print report ──────────────────────────────────────────────────── */
@media print {
  .odslp-no-print { display: none !important; }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .odslp-hero { flex-direction: column; }
  .odslp-hero-actions { flex-direction: row; align-items: flex-start; }
  .odslp-stats-grid { grid-template-columns: 1fr 1fr; }
  .odslp-qr-section { flex-direction: column; align-items: flex-start; }
}

/* UX hardening: focus states, long content, and compact screens */
.odslp-wrapper *,
.odslp-toast * {
  box-sizing: border-box;
}

.odslp-wrapper a:focus-visible,
.odslp-btn:focus-visible,
.odslp-social-link:focus-visible,
.odslp-avatar-upload-label:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 3px;
  text-decoration: none;
}

.odslp-input {
  min-height: 40px;
}

.odslp-hero-name,
.odslp-hero-role,
.odslp-bio,
.odslp-verify-url,
.odslp-toast,
.odslp-table td {
  overflow-wrap: anywhere;
}

.odslp-table-wrap {
  max-width: 100%;
  scrollbar-width: thin;
}

@media (max-width: 600px) {
  .odslp-wrapper {
    padding-inline: 12px;
  }

  .odslp-card,
  .odslp-hero,
  .odslp-verify-badge,
  .odslp-verify-invalid {
    padding: 20px;
  }

  .odslp-hero-actions,
  .odslp-edit-actions,
  .odslp-btn-group {
    width: 100%;
  }

  .odslp-hero-actions .odslp-btn,
  .odslp-edit-actions .odslp-btn,
  .odslp-btn-group .odslp-btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .odslp-toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .odslp-btn,
  .odslp-stat-card,
  .odslp-year-bar,
  .odslp-social-link,
  .odslp-input {
    transition: none;
  }

  .odslp-btn:hover,
  .odslp-toast {
    transform: none;
    animation: none;
  }
}
