/* =============================================
   BVetter — my-pets.css
   Page: My Pets — pet grid + slide-in health detail panel

   .mp-detail-overlay is position:fixed — it overlays the
   full viewport without pushing or hiding the navbar/hero.
   Body scroll is locked while the panel is open.

   Depends: variables.css, components.css (load first in HTML)
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
}

/* ── Hero ───────────────────────────────────── */
.mp-hero-wrap {
  padding: 24px 20px 20px;
  background: var(--bg-page);
}

.mp-hero {
  background: linear-gradient(120deg, #002A58 0%, #0a4f8e 55%, #1B6D24 100%);
  border-radius: 18px;
  padding: 36px 44px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 160px;
  overflow: hidden;
  position: relative;
}

.mp-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(27, 109, 36, 0.15);
  pointer-events: none;
}

.mp-hero-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.mp-hero h1 {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 10px;
  line-height: 1.1;
}

.mp-hero p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.65;
  max-width: 460px;
}

.mp-hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 18px 32px;
  flex-shrink: 0;
}

.mp-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mp-hero-stat-num {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.mp-hero-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* ── Section ────────────────────────────────── */
.mp-section {
  padding: 8px 20px 60px;
}

.mp-header {
  padding: 0 4px;
  margin-bottom: 20px;
}

.mp-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mp-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Pet grid ───────────────────────────────── */
.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.mp-card {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.mp-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-color: #C8E8C8;
  transform: translateY(-2px);
}

.mp-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--color-green-pale);
  display: block;
}

.mp-card-body {
  padding: 16px 18px 18px;
}

.mp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.mp-card-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.mp-card-breed {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.mp-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
}

/* ── Badges ─────────────────────────────────── */
.mp-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.mp-badge-success { background: var(--color-green-light); color: var(--color-green-dark); }
.mp-badge-warning  { background: var(--color-yellow-light); color: var(--color-yellow); }
.mp-badge-danger   { background: var(--color-red-light); color: var(--color-red); }

/* ── Empty states ───────────────────────────── */
.mp-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 4px;
  grid-column: 1 / -1;
}

.mp-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px dashed var(--border-default);
  border-radius: 16px;
}

.mp-empty-icon {
  width: 40px;
  height: 40px;
  opacity: 0.35;
  margin-bottom: 14px;
}

.mp-empty-state h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.mp-empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════
   DETAIL PANEL
   ══════════════════════════════════════════════ */
.mp-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  z-index: 999;
  justify-content: flex-end;
  align-items: stretch;
}

.mp-detail-overlay.open {
  display: flex;
}

.mp-detail-panel {
  width: min(720px, 92vw);
  height: 100vh;
  max-height: 100vh;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mpPanelSlideIn 0.3s ease;
}

@keyframes mpPanelSlideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.mp-detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.mp-detail-panel-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.mp-detail-panel-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.mp-detail-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-page);
  border: 1px solid var(--border-default);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.mp-detail-close:hover { background: var(--border-default); }

.mp-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overscroll-behavior: contain;
}

.mp-detail-body::-webkit-scrollbar { width: 5px; }
.mp-detail-body::-webkit-scrollbar-track { background: transparent; }
.mp-detail-body::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 10px; }

/* ── Detail: profile ────────────────────────── */
.mp-detail-profile {
  display: flex;
  gap: 18px;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 18px;
}

.mp-detail-profile-img {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-green-pale);
}

.mp-detail-profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mp-detail-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
}

.mp-detail-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.mp-detail-value {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Detail: sections ───────────────────────── */
.mp-detail-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ── Visit timeline ─────────────────────────── */
.mp-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mp-timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
}

.mp-timeline-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--border-default);
}

.mp-timeline-item:last-child::before { display: none; }

.mp-timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-green);
  margin-top: 5px;
  flex-shrink: 0;
}

.mp-timeline-content {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 12px 14px;
}

.mp-timeline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.mp-timeline-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.mp-timeline-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.mp-timeline-vet {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mp-timeline-diag {
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 2px;
}

/* ── Vaccination list ───────────────────────── */
.mp-vacc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-vacc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 12px 14px;
}

.mp-vacc-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.mp-vacc-meta {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .mp-hero { flex-wrap: wrap; padding: 28px; }
  .mp-hero-stats { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .mp-hero-wrap { padding: 12px 16px 0; }
  .mp-hero { padding: 24px 20px; }
  .mp-hero h1 { font-size: 24px; }
  .mp-section { padding: 8px 16px 40px; }
  .mp-grid { grid-template-columns: 1fr; }
  .mp-detail-panel { width: 100vw; }
  .mp-detail-panel-header { padding: 16px; }
  .mp-detail-body { padding: 18px 16px 36px; }
  .mp-detail-profile { flex-direction: column; }
  .mp-detail-profile-grid { grid-template-columns: repeat(2, 1fr); }
}
