/* ==========================================================================
   KARTY V2 "KARTA REKORDU" - moduł Zlecenia
   Wersja 2026-07-17c:
     - IKONY USUNIĘTE z nagłówka (rozpychały wiersz -> nazwy łamały się w linie).
     - BADGE typu = główny wyróżnik: błyszcząca pigułka w kolorze typu (krótka
       etykieta: LABORATORIUM / ZLECENIE / USŁUGA / SPECJALISTA / FIRMA).
     - WOW: gradientowy rail z poświatą, aura koloru w rogu, reflektor podążający
       za kursorem, przejeżdżający połysk (sheen), unoszenie + barwny cień.
   Layout BLOCK + rail przez ::before - odporne na nadpisania `display`.

   Ładowany WYŁĄCZNIE gdy opcja `lrj_zlecenia_cards_v2` włączona.
   Rollback: checkbox „Karty v2" w Zlecenia -> Ustawienia modułu.
   ========================================================================== */

.lrj-vcard {
    --vc: #14A077;          /* kolor typu - nadpisywany inline z PHP */
    position: relative;
    display: block;
    isolation: isolate;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    /* Przechył 3D ustawia JS bezpośrednio w style.transform (var() w transform
       bywa nieresolwowane przez niektóre silniki). Tu tylko wygładzenie. */
    transition: transform .16s ease, box-shadow .26s ease, border-color .2s ease;
    transform-style: preserve-3d;
}

/* --- RAIL: gradientowy pasek typu + poświata --- */
.lrj-vcard::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    z-index: 3;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--vc) 100%, #fff) 0%,
        color-mix(in srgb, var(--vc) 62%, #fff) 100%);
    transition: width .26s cubic-bezier(.22, .8, .32, 1), box-shadow .26s ease;
}
.lrj-vcard:hover::before {
    width: 8px;
    box-shadow: 0 0 20px 2px color-mix(in srgb, var(--vc) 60%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard::before { background: var(--vc); }
}

/* --- AURA: delikatny narożny glow (NIE wash pod tekstem - nie zasłania treści) --- */
.lrj-vcard::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(66% 48% at 100% -8%,
        color-mix(in srgb, var(--vc) 9%, transparent), transparent 56%);
    opacity: .4;
    transition: opacity .3s ease;
}
.lrj-vcard:hover::after { opacity: .8; }
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard::after { background: none; }
}

.lrj-vcard:hover {
    z-index: 3;             /* uniesiona/przechylona karta nad sąsiadami */
    transform: translateY(-4px);   /* baza gdy brak JS (focus/dotyk); JS nadpisuje delikatnym tiltem. Bez scale - tekst ostry */
    border-color: color-mix(in srgb, var(--vc) 40%, #e8edf3);
    box-shadow:
        0 22px 46px -20px color-mix(in srgb, var(--vc) 55%, rgba(15, 23, 42, .6)),
        0 2px 8px -4px rgba(15, 23, 42, .12);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard:hover { border-color: #cbd5e1; box-shadow: 0 22px 46px -20px rgba(15, 23, 42, .32); }
}
.lrj-vcard:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 162, 221, .38);
}

.lrj-vcard__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 9px;
    height: 100%;
    padding: 15px 18px 14px 21px;
}
/* --- SHEEN: przejeżdżający połysk na hover --- */
.lrj-vcard__body::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(104deg, transparent 42%, rgba(255, 255, 255, .3) 49%, rgba(255,255,255,.06) 56%, transparent 66%);
    transform: translateX(-130%);
}
.lrj-vcard:hover .lrj-vcard__body::after {
    animation: lrj-vc-sheen .9s cubic-bezier(.3, .7, .4, 1) both;
}
@keyframes lrj-vc-sheen {
    from { transform: translateX(-130%); }
    to   { transform: translateX(130%); }
}

/* ---------- NAGŁÓWEK: badge + flagi (bez ikon, odporny na łamanie) ---------- */
.lrj-vcard__hd {
    display: flex;
    align-items: center;
    gap: 7px 9px;
    flex-wrap: wrap;      /* awaryjnie łamie się CZYSTO, nie "rozjeżdża" */
    min-height: 26px;
}

/* ⭐ BADGE TYPU - główny wyróżnik: błyszcząca pigułka w kolorze typu */
.lrj-vcard__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 5px 12px 5px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--vc) 92%, #fff) 0%,
        var(--vc) 45%,
        color-mix(in srgb, var(--vc) 72%, #000) 100%);
    box-shadow:
        0 4px 12px -3px color-mix(in srgb, var(--vc) 70%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .32);
    transition: transform .22s cubic-bezier(.22, .8, .32, 1), box-shadow .22s ease;
}
.lrj-vcard__badge::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 7px rgba(255, 255, 255, .95);
    flex: none;
}
.lrj-vcard:hover .lrj-vcard__badge {
    transform: translateY(-1px);   /* bez scale - napis na badge ostry */
    box-shadow:
        0 8px 20px -4px color-mix(in srgb, var(--vc) 80%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .4);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard__badge { background: var(--vc); box-shadow: 0 4px 12px -3px rgba(15,23,42,.25); }
}

.lrj-vcard__flags {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: none;
}
.lrj-vcard__flag {
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.lrj-vcard__flag--ok     { color: #15803d; }
.lrj-vcard__flag--promo  { color: #0089bc; }
.lrj-vcard__flag--avail  { color: #475569; font-weight: 600; }
.lrj-vcard__flag--urgent { color: #dc2626; letter-spacing: .06em; }
.lrj-vcard__flag--urgent::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: lrj-vc-pulse 1.4s ease-in-out infinite;
}
@keyframes lrj-vc-pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); }
    50%      { opacity: .5; transform: scale(.8); box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}
.lrj-vcard__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--st, #15803d);
    white-space: nowrap;
}
.lrj-vcard__status::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, #15803d) 16%, transparent);
}
.lrj-vcard__date { font-size: 11px; color: #94a3b8; white-space: nowrap; }

/* ---------- IDENT (avatar/logo + nazwa) ---------- */
.lrj-vcard__ident { display: flex; align-items: center; gap: 11px; min-width: 0; }
.lrj-vcard__ident-text { min-width: 0; }
.lrj-vcard__avatar {
    width: 44px; height: 44px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--vc) 12%, #fff);
    border: 2px solid color-mix(in srgb, var(--vc) 30%, #fff);
    box-shadow: 0 4px 12px -5px color-mix(in srgb, var(--vc) 60%, transparent);
    transition: transform .22s ease, box-shadow .22s ease;
}
.lrj-vcard:hover .lrj-vcard__avatar {
    transform: scale(1.06);
    box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--vc) 75%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard__avatar { background: #f1f5f9; border-color: #e2e8f0; box-shadow: none; }
}
.lrj-vcard__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lrj-vcard__avatar--logo { border-radius: 11px; }
.lrj-vcard__avatar--logo img { object-fit: contain; padding: 4px; background: #fff; }
.lrj-vcard__avatar-initials { font-size: 14.5px; font-weight: 800; color: var(--vc); }
.lrj-vcard__avatar-fallback { color: var(--vc); display: grid; place-items: center; }

/* ---------- TREŚĆ ---------- */
.lrj-vcard__title {
    margin: 0;
    font-family: var(--lrj-font-heading, 'Plus Jakarta Sans', 'Inter', sans-serif);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.3;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;      /* długie nazwy nie rozpychają karty */
    transition: color .18s ease;
}
.lrj-vcard:hover .lrj-vcard__title { color: var(--vc); }

.lrj-vcard__meta {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.lrj-vcard__owner { font-weight: 600; color: #475569; }
.lrj-vcard__sep { margin: 0 3px; color: #cbd5e1; }

.lrj-vcard__excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.58;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- SPEC ROW: dyscyplina (filtrowana) + parametry (cleanroom/BSL/metraż/dostępność) ---------- */
.lrj-vcard__specs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Chip GŁÓWNEJ DYSCYPLINY - wyróżniony w kolorze typu (kluczowa oś filtrowania) */
.lrj-vcard__disc {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .01em;
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--vc) 88%, #fff), var(--vc));
    border-radius: 6px;
    padding: 3px 9px 3px 8px;
    line-height: 1.35;
    box-shadow: 0 3px 9px -4px color-mix(in srgb, var(--vc) 75%, transparent);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.lrj-vcard__disc::before {
    content: "◆";
    font-size: 8px;
    opacity: .9;
    flex: none;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard__disc { background: var(--vc); box-shadow: none; }
}
/* Pigułki parametrów - neutralne, ale "twarde dane" (mocna waga, tabular) */
.lrj-vcard__spec {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    background: #eef2f7;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 9px;
    line-height: 1.35;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.lrj-vcard__spec--avail {
    color: #15803d;
    background: #eafaf0;
    border-color: #bbf7d0;
}
.lrj-vcard__spec--avail::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 5px;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, .18);
}

/* ---------- CHIPY (zawijane - nic nie jest ucinane) ---------- */
.lrj-vcard__chips { display: flex; flex-wrap: wrap; gap: 5px; }
.lrj-vcard__chip {
    font-size: 11.5px;
    font-weight: 500;
    color: #475569;
    background: #f5f8fb;
    border: 1px solid #e8edf3;
    border-radius: 6px;
    padding: 2.5px 8px;
    line-height: 1.45;
    transition: border-color .2s ease, background .2s ease;
}
.lrj-vcard:hover .lrj-vcard__chip { border-color: #dde5ee; background: #f8fbfe; }
.lrj-vcard__chip--more { color: #94a3b8; }

.lrj-vcard__accreds { display: flex; flex-wrap: wrap; gap: 5px; }
.lrj-vcard__accred {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: color-mix(in srgb, var(--vc) 78%, #0f172a);
    background: color-mix(in srgb, var(--vc) 7%, #fff);
    border: 1px solid color-mix(in srgb, var(--vc) 22%, #fff);
    border-radius: 6px;
    padding: 2.5px 8px 2.5px 6px;
    line-height: 1.45;
    white-space: nowrap;
    transition: box-shadow .2s ease, transform .2s ease;
}
.lrj-vcard__accred::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--vc);
    flex: none;
}
.lrj-vcard:hover .lrj-vcard__accred {
    box-shadow: 0 2px 8px -3px color-mix(in srgb, var(--vc) 55%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard__accred { color: #334155; background: #f8fafc; border-color: #e2e8f0; }
}
.lrj-vcard__accred--more { color: #94a3b8; background: #f5f8fb; border-color: #e8edf3; font-weight: 600; }
.lrj-vcard__accred--more::before { display: none; }

/* Wpis własny (IA V2: poza filtrami) */
.lrj-vcard__accred--own, .lrj-vcard__chip--own {
    background: #fff; border-style: dashed; color: #64748b;
}
.lrj-vcard__accred--own::before { background: #cbd5e1; }

/* ---------- STOPKA ---------- */
.lrj-vcard__foot {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-top: 11px;
    border-top: 1px solid #f1f5f9;
}
.lrj-vcard__price { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lrj-vcard__price-val {
    font-family: var(--lrj-font-heading, 'Plus Jakarta Sans', 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.015em;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    transition: transform .22s cubic-bezier(.22, .8, .32, 1), color .22s ease;
    transform-origin: left center;
}
.lrj-vcard:hover .lrj-vcard__price-val { color: var(--vc); }   /* tylko kolor - cena zostaje ostra */
.lrj-vcard__price-sub {
    font-size: 11px; color: #94a3b8; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lrj-vcard__go {
    flex: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--vc) 42%, #e2e8f0);
    color: var(--vc);
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 700;
    transition: background .22s ease, color .22s ease, transform .22s cubic-bezier(.22,.8,.32,1), border-color .22s ease, box-shadow .22s ease;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .lrj-vcard__go { border-color: #cbd5e1; }
}
.lrj-vcard:hover .lrj-vcard__go {
    background: var(--vc);
    border-color: var(--vc);
    color: #fff;
    transform: translateX(3px) scale(1.08);
    box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--vc) 80%, transparent);
}

/* ---------- WARIANTY ---------- */
.lrj-vcard--featured {
    border-color: rgba(0, 162, 221, .42);
    box-shadow: 0 0 0 1px rgba(0, 162, 221, .18), 0 8px 24px -14px rgba(0, 138, 188, .32);
}
.lrj-vcard--urgent::before { background: linear-gradient(180deg, #ef4444, #991b1b); }

/* ---------- RESPONSYWNOŚĆ ---------- */
@media (max-width: 560px) {
    .lrj-vcard__body { padding: 13px 15px 12px 18px; }
    .lrj-vcard__title { font-size: 16px; }
    .lrj-vcard__flags .lrj-vcard__flag--avail { display: none; }
}

/* ---------- DOSTĘPNOŚĆ / RUCH ---------- */
@media (prefers-reduced-motion: reduce) {
    .lrj-vcard, .lrj-vcard__go, .lrj-vcard__badge, .lrj-vcard__avatar,
    .lrj-vcard::before, .lrj-vcard__price-val { transition: none; }
    .lrj-vcard { transform: none; }        /* bez przechyłu 3D */
    .lrj-vcard:hover { transform: none; }
    .lrj-vcard:hover .lrj-vcard__badge,
    .lrj-vcard:hover .lrj-vcard__avatar,
    .lrj-vcard:hover .lrj-vcard__price-val,
    .lrj-vcard:hover .lrj-vcard__go { transform: none; }
    .lrj-vcard:hover .lrj-vcard__body::after { animation: none; }
    .lrj-vcard__flag--urgent::before { animation: none; }
}
