/**
 * Pet Details hub — /pets/{id} view mode
 * Global stylesheet (scoped .razor.css is not loaded by _Master.cshtml)
 * Restyled to match the Ryxova pet profile mockups.
 */

.rx-pet-hub {
    --rx-hub-radius: 14px;
    --rx-hub-border: 1px solid #e8edf3;
    --rx-hub-bg: #ffffff;
    --rx-hub-gap: 1rem;
    --rx-hub-ink: #1a2a3a;
    --rx-hub-muted: #64748b;
    --rx-hub-faint: #94a3b8;
    --rx-hub-line: #eef2f7;
    max-width: 100%;
    color: var(--rx-hub-ink);
}

/* Prevent Metronic / Bootstrap from stretching MudButtons full-width inside the hub */
.rx-pet-hub .mud-button-root {
    width: auto;
    max-width: 100%;
    text-transform: none;
    letter-spacing: normal;
}

.rx-pet-hub .rx-pet-hub-back-btn {
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 8px;
}

.rx-pet-hub .rx-pet-hub-kpi__footer .mud-button-root {
    padding-left: 0;
    padding-right: 0;
    min-height: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    justify-content: flex-start;
}

/* —— Generic card —— */
.rx-pet-hub-card {
    background: var(--rx-hub-bg);
    border: var(--rx-hub-border);
    border-radius: var(--rx-hub-radius);
    padding: 1.125rem 1.25rem;
    height: 100%;
    box-shadow: 0 1px 2px rgba(26, 42, 58, 0.04);
}

.rx-pet-hub-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--rx-hub-ink);
    margin: 0 0 0.9rem;
    line-height: 1.3;
}

.rx-pet-hub-card__title-icon {
    color: var(--rx-hub-muted);
    font-size: 1.15rem !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
}

/* —— Hero —— */
.rx-pet-hub-hero {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 60%, #fff8f5 100%);
    border: var(--rx-hub-border);
    border-radius: var(--rx-hub-radius);
    padding: 1.5rem 1.75rem;
    margin-bottom: var(--rx-hub-gap);
    box-shadow: 0 1px 3px rgba(26, 42, 58, 0.05);
}

.rx-pet-hub-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.rx-pet-hub-hero__identity {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    flex: 1;
    min-width: 260px;
}

.rx-pet-hub-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    outline: 1px solid #e8edf3;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(26, 42, 58, 0.12);
}

.rx-pet-hub-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffe6de, #fff5f2);
    color: #ff8a6f;
}

.rx-pet-hub-hero__name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rx-hub-ink);
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.01em;
}

.rx-pet-hub-hero__traits {
    font-size: 0.875rem;
    color: var(--rx-hub-muted);
    margin: 0.4rem 0 0;
}

.rx-pet-hub-hero__ids {
    font-size: 0.75rem;
    color: var(--rx-hub-faint);
    margin: 0.3rem 0 0;
    letter-spacing: 0.01em;
}

.rx-pet-hub-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.1rem;
}

.rx-pet-hub-hero__actions .mud-button-root {
    border-radius: 8px;
}

/* —— KPI row —— */
.rx-pet-hub-kpi-row {
    display: grid;
    gap: var(--rx-hub-gap);
    grid-template-columns: 1fr;
    margin-bottom: var(--rx-hub-gap);
}

@media (min-width: 600px) {
    .rx-pet-hub-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
    .rx-pet-hub-kpi-row { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
    .rx-pet-hub-kpi-row { grid-template-columns: repeat(5, 1fr); }
}

.rx-pet-hub-kpi {
    position: relative;
    background: var(--rx-hub-bg);
    border: var(--rx-hub-border);
    border-radius: var(--rx-hub-radius);
    padding: 1.125rem 1.125rem 1rem;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    box-shadow: 0 1px 2px rgba(26, 42, 58, 0.04);
}

.rx-pet-hub-kpi:hover {
    box-shadow: 0 8px 22px rgba(26, 42, 58, 0.09);
    transform: translateY(-2px);
}

.rx-pet-hub-kpi__head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.15rem;
}

.rx-pet-hub-kpi__icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rx-pet-hub-kpi__icon--blue { background: rgba(59, 130, 246, 0.14); }
.rx-pet-hub-kpi__icon--blue .mud-icon-root { color: #3b82f6 !important; }

.rx-pet-hub-kpi__icon--green { background: rgba(34, 197, 94, 0.14); }
.rx-pet-hub-kpi__icon--green .mud-icon-root { color: #16a34a !important; }

.rx-pet-hub-kpi__icon--amber { background: rgba(245, 158, 11, 0.16); }
.rx-pet-hub-kpi__icon--amber .mud-icon-root { color: #d97706 !important; }

.rx-pet-hub-kpi__icon--purple { background: rgba(139, 92, 246, 0.14); }
.rx-pet-hub-kpi__icon--purple .mud-icon-root { color: #8b5cf6 !important; }

.rx-pet-hub-kpi__icon--teal { background: rgba(20, 184, 166, 0.14); }
.rx-pet-hub-kpi__icon--teal .mud-icon-root { color: #0d9488 !important; }

.rx-pet-hub-kpi__title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--rx-hub-muted);
    margin: 0;
    line-height: 1.2;
}

.rx-pet-hub-kpi__value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rx-hub-ink);
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.01em;
}

.rx-pet-hub-kpi__desc {
    font-size: 0.75rem;
    color: var(--rx-hub-muted);
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.rx-pet-hub-kpi__footer {
    margin-top: auto;
    padding-top: 0.25rem;
}

/* Tinted KPI cards + colored titles + accent footer links (per metric) */
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--blue) {
    background: linear-gradient(160deg, #f5f9ff 0%, #ffffff 72%);
    border-color: #dbeafe;
}
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--blue) .rx-pet-hub-kpi__title { color: #2563eb; }
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--blue) .rx-pet-hub-kpi-action,
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--blue) .rx-pet-hub-kpi-action .mud-icon-root { color: #2563eb !important; }

.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--green) {
    background: linear-gradient(160deg, #f1fdf5 0%, #ffffff 72%);
    border-color: #dcfce7;
}
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--green) .rx-pet-hub-kpi__title { color: #16a34a; }
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--green) .rx-pet-hub-kpi-action,
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--green) .rx-pet-hub-kpi-action .mud-icon-root { color: #16a34a !important; }

.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--amber) {
    background: linear-gradient(160deg, #fffaf0 0%, #ffffff 72%);
    border-color: #fde68a;
}
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--amber) .rx-pet-hub-kpi__title { color: #d97706; }
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--amber) .rx-pet-hub-kpi-action,
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--amber) .rx-pet-hub-kpi-action .mud-icon-root { color: #d97706 !important; }

.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--purple) {
    background: linear-gradient(160deg, #f8f6ff 0%, #ffffff 72%);
    border-color: #ede9fe;
}
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--purple) .rx-pet-hub-kpi__title { color: #7c3aed; }
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--purple) .rx-pet-hub-kpi-action,
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--purple) .rx-pet-hub-kpi-action .mud-icon-root { color: #7c3aed !important; }

.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--teal) {
    background: linear-gradient(160deg, #f0fdfa 0%, #ffffff 72%);
    border-color: #ccfbf1;
}
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--teal) .rx-pet-hub-kpi__title { color: #0d9488; }
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--teal) .rx-pet-hub-kpi-action,
.rx-pet-hub-kpi:has(.rx-pet-hub-kpi__icon--teal) .rx-pet-hub-kpi-action .mud-icon-root { color: #0d9488 !important; }

/* —— Info rows —— */
.rx-pet-hub-info {
    margin: 0;
    padding: 0;
}

.rx-pet-hub-info__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--rx-hub-line);
}

.rx-pet-hub-info__row:last-child {
    border-bottom: none;
}

.rx-pet-hub-info__label {
    color: var(--rx-hub-muted);
    flex: 0 0 42%;
    margin: 0;
}

.rx-pet-hub-info__value {
    color: var(--rx-hub-ink);
    font-weight: 600;
    text-align: right;
    margin: 0;
    word-break: break-word;
}

/* —— Pet information (info list + photo) —— */
.rx-pet-hub-petinfo {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.rx-pet-hub-petinfo .rx-pet-hub-info {
    flex: 1 1 auto;
    min-width: 0;
}

.rx-pet-hub-petinfo__photo {
    flex: 0 0 40%;
    max-width: 220px;
    align-self: stretch;
}

.rx-pet-hub-petinfo__photo img {
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 280px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e8edf3;
    box-shadow: 0 1px 3px rgba(26, 42, 58, 0.06);
    display: block;
}

.rx-pet-hub-petinfo__photo-ph {
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 280px;
    border-radius: 10px;
    border: 1px solid #e8edf3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffe6de, #fff5f2);
    color: #ff8a6f;
}

.rx-pet-hub-petinfo__photo-ph .mud-icon-root {
    font-size: 2.6rem;
}

@media (max-width: 599px) {
    .rx-pet-hub-petinfo {
        flex-direction: column;
    }
    .rx-pet-hub-petinfo__photo {
        flex-basis: auto;
        max-width: none;
    }
    .rx-pet-hub-petinfo__photo img {
        min-height: 0;
        max-height: 240px;
    }
}

/* —— Quick action tiles —— */
.rx-pet-hub-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.rx-pet-hub-tile {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 78px;
    padding: 0.7rem 0.6rem !important;
    border: 1px solid #e8edf3 !important;
    border-radius: 11px !important;
    background: #ffffff !important;
    cursor: pointer;
    text-align: center;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    user-select: none;
}

.rx-pet-hub-tile:hover {
    box-shadow: 0 6px 16px rgba(26, 42, 58, 0.1);
    transform: translateY(-2px);
}

.rx-pet-hub-tile .mud-icon-root {
    font-size: 1.35rem;
}

.rx-pet-hub-tile__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--rx-hub-ink);
    line-height: 1.25;
}

.rx-pet-hub-tile--consult { background: #f5f9ff !important; border-color: #dbeafe !important; }
.rx-pet-hub-tile--consult .mud-icon-root { color: #3b82f6 !important; }

.rx-pet-hub-tile--vaccine { background: #f1fdf5 !important; border-color: #dcfce7 !important; }
.rx-pet-hub-tile--vaccine .mud-icon-root { color: #16a34a !important; }

.rx-pet-hub-tile--vitals { background: #fef4f4 !important; border-color: #fecdd3 !important; }
.rx-pet-hub-tile--vitals .mud-icon-root { color: #ef4444 !important; }

.rx-pet-hub-tile--rx { background: #f8f6ff !important; border-color: #ede9fe !important; }
.rx-pet-hub-tile--rx .mud-icon-root { color: #8b5cf6 !important; }

.rx-pet-hub-tile--invoice { background: #fffaf0 !important; border-color: #fde68a !important; }
.rx-pet-hub-tile--invoice .mud-icon-root { color: #d97706 !important; }

.rx-pet-hub-tile--doc { background: #f5f9ff !important; border-color: #dbeafe !important; }
.rx-pet-hub-tile--doc .mud-icon-root { color: #3b82f6 !important; }

.rx-pet-hub-tile--image { background: #f0fdfa !important; border-color: #ccfbf1 !important; }
.rx-pet-hub-tile--image .mud-icon-root { color: #14b8a6 !important; }

.rx-pet-hub-tile--reminders { background: #f8fafc !important; border-color: #e8edf3 !important; }
.rx-pet-hub-tile--reminders .mud-icon-root { color: #64748b !important; }

/* —— Overview / tabs —— */
.rx-pet-hub-overview-card {
    min-height: 244px;
}

.rx-pet-hub-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.75rem 1rem;
    color: var(--rx-hub-muted);
    gap: 0.5rem;
    min-height: 160px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px dashed #e2e8f0;
}

.rx-pet-hub-reminder {
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #e8edf3;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rx-pet-hub-reminder:hover {
    border-color: #dbe3ec;
    box-shadow: 0 2px 8px rgba(26, 42, 58, 0.05);
}

.rx-pet-hub-reminder__title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--rx-hub-ink);
}

.rx-pet-hub-tabs {
    background: var(--rx-hub-bg);
    border: var(--rx-hub-border);
    border-radius: var(--rx-hub-radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(26, 42, 58, 0.04);
}

.rx-pet-hub-tabs .mud-tabs-toolbar {
    background: #ffffff;
    border-bottom: 1px solid #e8edf3;
    padding: 0 0.25rem;
}

.rx-pet-hub-tabs .mud-tab {
    text-transform: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--rx-hub-muted);
    min-height: 52px;
}

.rx-pet-hub-tabs .mud-tab.mud-tab-active {
    color: var(--mud-palette-primary, #3b82f6);
}

.rx-pet-hub-tabs .mud-tab-slider {
    height: 2.5px;
    border-radius: 2px;
}

.rx-pet-hub-footer {
    border-top: 1px solid #e8edf3;
    padding-top: 0.875rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--rx-hub-faint);
}

.rx-pet-hub-three-col {
    margin-bottom: var(--rx-hub-gap);
}
