/**
 * Member ID Card v3 — Premium Design
 * - Bigger member photo (110px)
 * - Membership Expiry pill replaces Serial
 * - Active / Expired status badge
 */

/* ── Wrapper ──────────────────────────────────────────────────── */
.imd-id-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
}

/* ── Card shell ───────────────────────────────────────────────── */
.imd-id-card-v2 {
    width: 300px;
    max-width: 300px;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff, #f8fbff);
    border: 1px solid rgba(255,255,255,.5);
    position: relative;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow:
        0 2px 4px rgba(15,45,107,.08),
        0 8px 24px rgba(15,45,107,.12),
        0 24px 64px rgba(15,45,107,.16),
        0 0 0 1px rgba(15,45,107,.06);
    transition: transform .35s cubic-bezier(.34,1.56,.64,1),
                box-shadow .35s ease;
}
.imd-id-card-v2:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 4px 8px rgba(15,45,107,.10),
        0 16px 40px rgba(15,45,107,.18),
        0 40px 80px rgba(15,45,107,.20),
        0 0 0 1px rgba(15,45,107,.08);
}

/* ── Decorative elements ──────────────────────────────────────── */
.imdv2-deco-dot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.imdv2-dot-1 {
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(6,182,212,.12) 0%, transparent 70%);
    bottom: 40px; right: -30px;
}
.imdv2-dot-2 {
    width: 80px; height: 80px;
    background: radial-gradient(circle, rgba(26,86,219,.10) 0%, transparent 70%);
    bottom: 20px; left: 20px;
}
.imdv2-deco-line {
    position: absolute;
    pointer-events: none;
}
.imdv2-line-1 {
    left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #06b6d4, #1a56db, transparent);
    opacity: .25;
    top: 91px;
}

/* ── Top accent / wave ────────────────────────────────────────── */
.imdv2-top-accent {
    position: relative;
    height: 90px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e40af, #7c3aed);
}
.imdv2-wave-svg {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    display: block;
}
.imdv2-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 100%;
}

/* Logo in header */
.imdv2-logo-wrap { flex-shrink: 0; }
.imdv2-logo {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.6);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    background: rgba(255,255,255,.1);
}
.imdv2-logo-placeholder {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 2px solid rgba(255,255,255,.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

/* Institution info in header */
.imdv2-inst-info {
    flex: 1;
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
}
.imdv2-inst-name {
    font-size: 10px; font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.imdv2-card-title {
    font-size: 7px; font-weight: 700;
    color: rgba(255,255,255,.75);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* Join date pill (top-right header badge) */
.imdv2-join-pill {
    flex-shrink: 0;
    font-size: 8.5px; font-weight: 800;
    color: #ffffff;
    background: rgba(6,182,212,.28);
    border: 1px solid rgba(6,182,212,.55);
    padding: 4px 9px;
    border-radius: 20px;
    letter-spacing: .4px;
    backdrop-filter: blur(6px);
    white-space: nowrap;
    box-shadow: 0 0 8px rgba(6,182,212,.25);
}

/* ── Main body ────────────────────────────────────────────────── */
.imdv2-body {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 12px 10px 10px;
    background: linear-gradient(145deg, #ffffff, #f8fbff);
    position: relative;
    z-index: 1;
}

/* ── Left: photo + QR ─────────────────────────────────────────── */
.imdv2-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-right: 8px;
    width: 80px;
}

/* Rectangular ID-style photo */
.imdv2-photo-ring {
    width: 72px; height: 92px;
    border-radius: 8px;
    padding: 3px;
    background: linear-gradient(135deg, #0f2d6b, #1a56db, #06b6d4);
    box-shadow: 0 4px 14px rgba(15,45,107,.3);
    flex-shrink: 0;
}
.imdv2-photo-wrap {
    width: 66px; height: 86px;
    border-radius: 6px;
    overflow: hidden;
    background: #cbd5e1;
}
.imdv2-photo {
    width: 66px; height: 86px;
    object-fit: cover;
    object-position: center top;
    display: block;
}


/* ── Center: info ─────────────────────────────────────────────── */
.imdv2-center {
    flex: 1;
    min-width: 0;
}
.imdv2-name {
    font-size: 12px; font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.imdv2-profession {
    font-size: 8px; font-weight: 700;
    color: #1a56db;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.imdv2-divider {
    height: 2px;
    background: linear-gradient(90deg, #1a56db, #06b6d4, transparent);
    border-radius: 2px;
    margin-bottom: 9px;
    width: 80%;
}
.imdv2-fields {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.imdv2-field {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.imdv2-field-label {
    font-size: 7px; font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .7px;
}
.imdv2-field-value {
    font-size: 10px; font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}
.imdv2-field-highlight {
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
    border-left: 3px solid #1a56db;
    border-radius: 0 6px 6px 0;
    padding: 4px 7px;
    margin-bottom: 3px;
}
.imdv2-id-value {
    font-size: 11px; font-weight: 900;
    color: #0f2d6b;
    letter-spacing: .5px;
}
.imdv2-address-value {
    font-size: 9px; font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.imdv2-row2 {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.imdv2-row2 .imdv2-field {
    flex: 1;
    min-width: 0;
}
/* Right column — stacks Exp. Date + Blood Group vertically */
.imdv2-col-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Blood group (inside row2) ────────────────────────────────── */
.imdv2-blood-value {
    color: #dc2626 !important;
    font-weight: 800;
}

/* Expiry value styling */
.imdv2-expiry-value { color: #0f2d6b; }
.imdv2-text-expired { color: #dc2626 !important; }

/* ── QR (inside left column, below photo) ─────────────────────── */
.imdv2-qr-frame {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(15,45,107,.08);
    margin-top: 2px;
}
.imdv2-qr-target img,
.imdv2-qr-target canvas { display: block; }
.imdv2-qr-label {
    font-size: 6.5px; font-weight: 800;
    color: #94a3b8;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────── */
.imdv2-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: linear-gradient(135deg, #0f2d6b 0%, #1a56db 60%, #0891b2 100%);
    position: relative;
    z-index: 1;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.imdv2-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(255,255,255,0.04)' fill-rule='evenodd'%3E%3Ccircle cx='20' cy='20' r='8'/%3E%3C/g%3E%3C/svg%3E");
}
.imdv2-footer-left,
.imdv2-footer-right {
    position: relative;
    z-index: 1;
}
.imdv2-valid {
    font-size: 8.5px; font-weight: 800;
    color: rgba(255,255,255,.9);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.imdv2-footer-right span {
    font-size: 8.5px; font-weight: 600;
    color: rgba(255,255,255,.65);
}

/* ── Actions ──────────────────────────────────────────────────── */
.imd-id-actions {
    display: flex; gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Print ────────────────────────────────────────────────────── */
@media print {
    html, body { display: block !important; visibility: visible !important; background: #fff !important; }
    body > * { display: none !important; }
    .imd-id-card-wrapper {
        display: flex !important;
        position: fixed; inset: 0;
        align-items: center; justify-content: center;
        background: #fff;
    }
    .imd-id-card-v2 {
        display: block !important;
        transform: none !important;
        width: 300px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .imd-id-actions { display: none !important; }
    .imdv2-deco-dot, .imdv2-deco-line { display: none !important; }
    .imdv2-top-accent, .imdv2-footer, .imdv2-photo-ring {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 340px) {
    .imd-id-card-v2 { width: calc(100vw - 24px); max-width: 300px; }
    .imdv2-name { font-size: 11px; }
    .imdv2-photo-ring { width: 60px; height: 76px; }
    .imdv2-photo-wrap { width: 54px; height: 70px; }
    .imdv2-photo { width: 54px; height: 70px; }
    .imdv2-left { width: 68px; padding-right: 6px; }
    .imdv2-body { padding: 10px 8px 8px; }
}

/* Dashboard header / profile jobs compatibility */
.imd-dash-header { background: linear-gradient(135deg, #0f172a, #2563eb); color: #fff; padding: 24px; border-radius: 16px; }
.imd-job-publisher { font-size: 13px; color: #475569; margin: 6px 0; }
.imd-profile-jobs { margin-top: 20px; padding: 20px; background: #fff; border: 1px solid #e5e7eb; }
