/* ═══════════════════════════════════════════════════════════
   DESERT CITY RP — profile.css
   Player profile page — premium dark-gold design
═══════════════════════════════════════════════════════════ */

/* ── Page Layout ─────────────────────────────────────────── */
.profile-page {
  margin-left: var(--sidebar-w);
  width: calc(100vw - var(--sidebar-w));
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 0%,   rgba(228,208,126,0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 100%, rgba(228,208,126,0.04) 0%, transparent 45%),
    var(--bg-1);
  padding: 80px 60px 100px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* ── Back button ─────────────────────────────────────────── */
.prof-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  transition: color var(--transition);
}
.prof-back-btn:hover { color: var(--accent); }

/* ── Hero header card ────────────────────────────────────── */
.prof-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(228,208,126,0.07) 0%, rgba(0,0,0,0.3) 100%);
  border: 1px solid rgba(228,208,126,0.22);
  border-radius: 28px;
  padding: 48px 52px;
  display: flex;
  align-items: center;
  gap: 40px;
  overflow: hidden;
}
.prof-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228,208,126,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.prof-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.prof-hero-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 40px rgba(228,208,126,0.3);
}
.prof-hero-avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(228,208,126,0.25);
  animation: profileRingSpin 8s linear infinite;
}
@keyframes profileRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.prof-hero-avatar-ring::before {
  content: '';
  position: absolute;
  top: -3px; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}
.prof-hero-info { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.prof-hero-name {
  font-size: 2.2rem; font-weight: 900;
  letter-spacing: -0.02em; color: var(--text);
}
.prof-hero-name span { color: var(--accent); }
.prof-hero-tag {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); opacity: 0.8;
}
.prof-hero-meta {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px;
}
.prof-meta-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(228,208,126,0.06);
  border: 1px solid rgba(228,208,126,0.18);
  border-radius: 999px; padding: 6px 16px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
}
.prof-meta-pill i { color: var(--accent); font-size: 0.85rem; }
.prof-meta-pill.highlight { color: var(--accent); border-color: rgba(228,208,126,0.35); background: rgba(228,208,126,0.1); }

/* ── Section heading ─────────────────────────────────────── */
.prof-section-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px;
}
.prof-section-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(228,208,126,0.1);
  border: 1px solid rgba(228,208,126,0.22);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1rem;
  flex-shrink: 0;
}
.prof-section-title {
  font-size: 1.1rem; font-weight: 800;
  letter-spacing: -0.01em; color: var(--text);
}
.prof-section-count {
  margin-left: auto;
  background: rgba(228,208,126,0.09);
  border: 1px solid rgba(228,208,126,0.2);
  border-radius: 999px; padding: 3px 12px;
  font-size: 0.75rem; font-weight: 700; color: var(--accent);
}

/* ── Characters grid ─────────────────────────────────────── */
.prof-chars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: 22px;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.char-card:hover {
  border-color: rgba(228,208,126,0.35);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px rgba(228,208,126,0.08);
}
.char-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(228,208,126,0.3), 0 20px 50px rgba(228,208,126,0.12);
}

/* Mugshot / header */
.char-card-top {
  position: relative;
  background: linear-gradient(160deg, rgba(228,208,126,0.08) 0%, rgba(0,0,0,0.3) 100%);
  padding: 28px 24px 20px;
  display: flex; align-items: flex-start; gap: 18px;
}
.char-mugshot-wrap {
  position: relative; flex-shrink: 0;
}
.char-mugshot {
  width: 88px; height: 88px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(228,208,126,0.3);
  background: var(--bg-3);
}
.char-mugshot-placeholder {
  width: 88px; height: 88px;
  border-radius: 16px;
  background: rgba(228,208,126,0.06);
  border: 2px dashed rgba(228,208,126,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 2rem;
}
.char-job-badge {
  position: absolute; bottom: -8px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid rgba(228,208,126,0.25);
  border-radius: 999px; padding: 3px 10px;
  font-size: 0.65rem; font-weight: 700;
  color: var(--accent); white-space: nowrap;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.char-info { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.char-name { font-size: 1.15rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.char-id-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; color: var(--text-faint);
}
.char-id-badge span { color: var(--accent); }
.char-phone {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); margin-top: 2px;
}
.char-phone i { color: var(--accent); }
.char-job-info {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); margin-top: 2px;
}
.char-job-info i { color: var(--accent); }
.char-job-info span { color: var(--text); font-weight: 700; }
.char-card-divider { height: 1px; background: var(--border-muted); margin: 0; }

/* Character stats row */
.char-stats-row {
  display: flex; gap: 0;
}
.char-stat {
  flex: 1; text-align: center;
  padding: 14px 10px;
  border-right: 1px solid var(--border-muted);
  display: flex; flex-direction: column; gap: 4px;
}
.char-stat:last-child { border-right: none; }
.char-stat-val {
  font-size: 1.05rem; font-weight: 800;
  color: var(--accent); line-height: 1;
}
.char-stat-lbl {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint);
}

/* Expand button */
.char-expand-btn {
  width: 100%; padding: 12px;
  background: transparent;
  border: none; border-top: 1px solid var(--border-muted);
  color: var(--text-faint); font-size: 0.8rem; font-weight: 600;
  font-family: inherit; letter-spacing: 0.05em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: color var(--transition), background var(--transition);
}
.char-expand-btn:hover { color: var(--accent); background: rgba(228,208,126,0.04); }
.char-expand-btn i { transition: transform var(--transition); }
.char-card.open .char-expand-btn i { transform: rotate(180deg); }

/* ── Character Detail Panel ──────────────────────────────── */
.char-detail-panel {
  display: none;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid var(--border-muted);
  animation: panelSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.char-card.open .char-detail-panel { display: flex; }
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Inventory Grid ──────────────────────────────────────── */
.inv-heading {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.inv-slot {
  position: relative;
  background: rgba(228,208,126,0.04);
  border: 1px solid rgba(228,208,126,0.12);
  border-radius: 14px;
  padding: 10px 8px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.inv-slot:hover {
  border-color: rgba(228,208,126,0.35);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}
.inv-slot-img {
  width: 52px; height: 52px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.inv-slot-img-ph {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: rgba(228,208,126,0.25);
}
.inv-slot-name {
  font-size: 0.62rem; font-weight: 700;
  text-align: center; color: var(--text-muted);
  line-height: 1.3; word-break: break-word;
  max-width: 100%;
}
.inv-slot-qty {
  position: absolute; top: 6px; right: 7px;
  background: var(--accent); color: #111;
  font-size: 0.6rem; font-weight: 800;
  border-radius: 999px; padding: 1px 6px;
  line-height: 1.4;
}
.inv-slot-weight {
  font-size: 0.58rem; color: var(--text-faint); font-weight: 600;
}

/* Empty inventory */
.inv-empty {
  text-align: center; padding: 32px 20px;
  color: var(--text-faint); font-size: 0.85rem;
}
.inv-empty i { font-size: 2rem; display: block; margin-bottom: 10px; opacity: 0.3; }

/* ── Character info fields ───────────────────────────────── */
.char-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.char-field {
  background: rgba(228,208,126,0.04);
  border: 1px solid var(--border-muted);
  border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.char-field-label {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint);
}
.char-field-value {
  font-size: 0.92rem; font-weight: 700;
  color: var(--text);
}
.char-field-value.accent { color: var(--accent); }

/* ── Not logged in gate ──────────────────────────────────── */
.prof-gate {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh; gap: 24px; text-align: center;
}
.prof-gate-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(228,208,126,0.08);
  border: 1px solid rgba(228,208,126,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--accent);
}
.prof-gate h2 { font-size: 1.6rem; font-weight: 800; }
.prof-gate p { color: var(--text-muted); max-width: 380px; }

/* ── Loader ──────────────────────────────────────────────── */
.prof-loader-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; min-height: 50vh;
}

/* ── DB Config notice ────────────────────────────────────── */
.prof-db-notice {
  background: rgba(228,208,126,0.06);
  border: 1px dashed rgba(228,208,126,0.3);
  border-radius: 18px;
  padding: 32px 40px;
  display: flex; flex-direction: column; gap: 12px;
}
.prof-db-notice h3 { color: var(--accent); font-size: 1rem; font-weight: 700; }
.prof-db-notice p, .prof-db-notice code {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.7;
}
.prof-db-notice code {
  background: var(--bg-3); padding: 2px 8px;
  border-radius: 6px; color: var(--accent);
  font-family: 'Courier New', monospace;
}

/* ── Tooltip ─────────────────────────────────────────────── */
.inv-slot[data-tip] { position: relative; }
.inv-slot[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); font-size: 0.7rem; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .profile-page { padding: 60px 24px 80px; }
  .prof-hero { flex-direction: column; padding: 36px 28px; align-items: flex-start; }
  .prof-chars-grid { grid-template-columns: 1fr; }
  .char-detail-panel { padding: 20px; }
}
@media (max-width: 600px) {
  .profile-page { padding: 50px 16px 60px; }
  .char-fields-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Map Container inside Details ─────────────────────────── */
.char-map-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.char-map-container {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(228, 208, 126, 0.22);
  cursor: pointer;
  background: #0d2b4f;
}
.char-map-inner {
  width: 100%;
  height: 100%;
  z-index: 10;
  background: #0d2b4f;
}
.leaflet-container {
  background: #0d2b4f !important;
}
.char-map-overlay-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.char-map-container:hover .char-map-overlay-btn {
  background: var(--accent);
  color: #111;
  box-shadow: 0 0 15px rgba(228, 208, 126, 0.4);
}

/* ── Custom Pulsing Map Marker ────────────────────────────── */
.custom-map-marker {
  position: relative;
  width: 20px;
  height: 20px;
}
.marker-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-left: -6px;
  background: #ff3b30;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.9);
  z-index: 2;
  box-sizing: border-box;
}
.marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  margin-left: -14px;
  border: 2px solid #ff3b30;
  border-radius: 50%;
  animation: markerPulse 1.8s infinite ease-out;
  opacity: 0;
  z-index: 1;
  box-sizing: border-box;
}
@keyframes markerPulse {
  0% { transform: scale(0.3); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── Fullscreen Map Modal ─────────────────────────────────── */
.map-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 40px;
  backdrop-filter: blur(10px);
}
.map-modal.open {
  display: flex;
}
.map-modal-content {
  position: relative;
  width: 95%;
  max-width: 1200px;
  height: 85%;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.9), 0 0 50px rgba(228,208,126,0.15);
}
.map-modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(228, 208, 126, 0.3);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10100;
  transition: all var(--transition);
}
.map-modal-close:hover {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  transform: scale(1.05);
}

/* ── Actions Row & Delete Button ──────────────────────────── */
.char-actions-row {
  display: flex;
  border-top: 1px solid var(--border-muted);
}
.char-actions-row .char-expand-btn {
  flex: 1;
  border-top: none;
  border-right: 1px solid var(--border-muted);
}
.char-delete-btn {
  padding: 12px 24px;
  background: rgba(255, 59, 48, 0.03);
  border: none;
  color: #ff453a;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.char-delete-btn:hover {
  background: #ff453a;
  color: #fff;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}
.char-delete-btn.locked {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-faint);
  cursor: not-allowed;
}
.char-delete-btn.locked:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

/* ── Admin Permissions Lists ──────────────────────────────── */
.perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: border-color var(--transition);
}
.perm-item:hover {
  border-color: rgba(228, 208, 126, 0.2);
}
.perm-item-code {
  color: #e4d07e;
  font-weight: bold;
}
.btn-revoke-perm {
  background: transparent;
  border: none;
  color: #ff453a;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}
.btn-revoke-perm:hover {
  background: rgba(255, 59, 48, 0.1);
  transform: scale(1.05);
}

