/* ==========================================================================
   The digital business card (Phase 33) — _BusinessCardModal.cshtml
   ==========================================================================
   The card face is the company's printed template: a black band with the logo
   over a constellation of linked points, a blue face below, the photograph in
   a circle straddling the two, the name in white capitals, the title in black,
   the QR code in a white tile, then the contact rows with round black icons.

   THE CARD'S COLOURS ARE ITS OWN, NOT THE THEME'S. A business card looks the
   same on a dark screen and a light one, because it is a picture of a printed
   object. Everything around it — the dialog, the buttons, the hint — follows
   the theme like the rest of the application.

   THE PHOTOGRAPH IS ALWAYS BLACK AND WHITE. business-card.js converts the
   picture before it is uploaded, and the filter here does it again on display,
   so a colour file that reached the server by another route still shows as
   the template wants it.
   ========================================================================== */

.bizcard-backdrop { z-index: 1070; }

.bizcard-dialog {
    width: 100%;
    max-width: 420px;
    max-height: 96vh;
    overflow-y: auto;
    background: var(--t-bg-1);
    border: 1px solid var(--t-line);
    border-top: 2px solid var(--t-blue);
    border-radius: var(--t-radius-lg);
    box-shadow: var(--t-shadow-modal);
    animation: modal-in 180ms cubic-bezier(0.2, 0, 0.2, 1) both;
}

.bizcard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.9rem 0.7rem 1.1rem;
    border-bottom: 1px solid var(--t-line);
    background: var(--t-bg-2);
}

.bizcard-head h2 {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--t-text-dim);
}

.bizcard-stage {
    display: flex;
    justify-content: center;
    padding: 1.1rem 1rem 0.6rem;
}

/* --------------------------------------------------------------------------
   The card itself
   -------------------------------------------------------------------------- */

.bizcard {
    --card-black: #0a0b0d;
    --card-blue: #1e9be9;
    --card-w: 340px;
    position: relative;
    width: var(--card-w);
    max-width: 100%;
    background: var(--card-blue);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    font-family: "Montserrat", "Noto Sans", system-ui, sans-serif;
    color: #0a0b0d;
    user-select: none;
}

.bizcard-top {
    position: relative;
    height: 150px;
    background: var(--card-black);
    overflow: hidden;
}

.bizcard-net {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.bizcard-net-lines line { stroke: rgba(255, 255, 255, 0.28); stroke-width: 0.8; }
.bizcard-net-dots circle { fill: rgba(255, 255, 255, 0.85); }

.bizcard-logo {
    position: absolute;
    left: 50%;
    top: 34px;
    width: 196px;
    transform: translateX(-50%);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.25));
}

.bizcard-photo {
    position: absolute;
    left: 50%;
    top: 96px;
    width: 108px;
    height: 108px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #d9dde2;
    border: 4px solid #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.bizcard-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.05);
}

.bizcard-initials {
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.04em;
    color: #4a5560;
}

.bizcard-face {
    padding: 66px 22px 22px;
    text-align: center;
}

.bizcard-name {
    font-weight: 700;
    font-size: 1.22rem;
    line-height: 1.15;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.bizcard-title {
    margin-top: 0.3rem;
    font-weight: 700;
    font-size: 0.86rem;
    color: #0a0b0d;
    min-height: 1.2em;
}

.bizcard-title.is-missing {
    font-weight: 500;
    font-style: italic;
    color: rgba(10, 11, 13, 0.65);
}

/* The QR tile. A button, so a tap enlarges it for the phone across the desk. */
.bizcard-qr {
    display: block;
    margin: 0.95rem auto 0.9rem;
    padding: 8px;
    background: #ffffff;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    cursor: zoom-in;
    line-height: 0;
}

.bizcard-qr canvas {
    width: 168px;
    height: 168px;
    image-rendering: pixelated;
}

.bizcard-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.bizcard-rows li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: "Noto Sans", system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffffff;
    min-width: 0;
}

.bizcard-rows li[hidden] { display: none; }

.bizcard-text { overflow-wrap: anywhere; }

.bizcard-ico {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--card-black);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.bizcard-ico svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.bizcard-ico-text {
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Enlarged code: the whole card gives way to the QR for scanning
   -------------------------------------------------------------------------- */

.bizcard-dialog.is-zoomed .bizcard-stage { padding: 0.8rem; }

.bizcard-dialog.is-zoomed .bizcard-top,
.bizcard-dialog.is-zoomed .bizcard-photo,
.bizcard-dialog.is-zoomed .bizcard-rows,
.bizcard-dialog.is-zoomed .bizcard-actions .bizcard-buttons { display: none; }

.bizcard-dialog.is-zoomed .bizcard-face { padding: 18px 18px 14px; }

.bizcard-dialog.is-zoomed .bizcard-qr { cursor: zoom-out; }

.bizcard-dialog.is-zoomed .bizcard-qr canvas {
    width: min(300px, 78vw);
    height: min(300px, 78vw);
}

/* --------------------------------------------------------------------------
   Below the card: the hint, the photo controls, the download
   -------------------------------------------------------------------------- */

.bizcard-actions {
    padding: 0.4rem 1.1rem 1.1rem;
    text-align: center;
}

.bizcard-hint,
.bizcard-note {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    color: var(--t-text-dim);
}

.bizcard-error {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    color: var(--t-text-danger, #d9534f);
}

.bizcard-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.bizcard-buttons .btn { margin: 0; cursor: pointer; }

.bizcard-buttons .btn.is-busy { opacity: 0.6; pointer-events: none; }

/* --------------------------------------------------------------------------
   The avatar as a button. Same look as the span it replaced, plus a hand.
   -------------------------------------------------------------------------- */

.avatar-button {
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.avatar-button:hover,
.avatar-button:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(0, 126, 196, 0.35);
    outline: none;
}

@media (max-width: 480px) {
    .bizcard-stage { padding: 0.8rem 0.6rem 0.4rem; }
    .bizcard { --card-w: 100%; }
}
