/* =============================================================
   DePraktijkDigitaal.nl — Certificaat v4.0
   Print-ready · Modern actions · Logo support
   ============================================================= */

/* ── Back link ── */
.dpd-cert-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 13.5px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color .15s ease;
}
.dpd-cert-back:hover { color: #1A73B5; }
.dpd-cert-back svg { flex-shrink: 0; }

/* ── Wrapper ── */
.dpd-cert-wrapper {
    max-width: 920px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ── Certificate frame ── */
.dpd-certificaat {
    position: relative;
    background: #ffffff;
    border: 2px solid #1A73B5;
    border-radius: 4px;
    padding: 64px 72px;
    aspect-ratio: 1.414 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
}

/* ── Corner accents ── */
.dpd-cert__corner {
    position: absolute;
    width: 48px;
    height: 48px;
    border-color: #1A73B5;
    border-style: solid;
    border-width: 0;
    opacity: .4;
}
.dpd-cert__corner--tl { top: 16px;    left: 16px;  border-top-width: 3px; border-left-width: 3px; }
.dpd-cert__corner--tr { top: 16px;    right: 16px; border-top-width: 3px; border-right-width: 3px; }
.dpd-cert__corner--bl { bottom: 16px; left: 16px;  border-bottom-width: 3px; border-left-width: 3px; }
.dpd-cert__corner--br { bottom: 16px; right: 16px; border-bottom-width: 3px; border-right-width: 3px; }

/* ── Background pattern ── */
.dpd-cert__bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(26,115,181,.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(15,165,115,.03) 0%, transparent 50%);
    pointer-events: none;
}

/* ── Header (logo + subtitle) ── */
.dpd-cert__header {
    text-align: center;
    z-index: 1;
}
.dpd-cert__logo-img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
    padding-bottom: 4px;
}
.dpd-cert__subtitle {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 4px 0 0;
}

/* ── Seal (top right) ── */
.dpd-cert__seal {
    position: absolute;
    top: 32px;
    right: 56px;
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, #0FA573, #096346);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(15,165,115,.3);
    z-index: 2;
}

/* ── Title section ── */
.dpd-cert__title {
    text-align: center;
    z-index: 1;
}
.dpd-cert__title h1 {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 300;
    color: #0f172a;
    letter-spacing: -.02em;
    margin: 0;
    line-height: 1.1;
}
.dpd-cert__divider {
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, #1A73B5, #0FA573);
    margin: 14px auto;
    border-radius: 2px;
}
.dpd-cert__hierbij {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ── Name ── */
.dpd-cert__naam {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: clamp(22px, 3.5vw, 34px);
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    z-index: 1;
    letter-spacing: -.01em;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 24px 10px;
}

/* ── Training text ── */
.dpd-cert__tekst {
    text-align: center;
    z-index: 1;
}
.dpd-cert__tekst p {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 14px;
    color: #475569;
    margin: 4px 0;
    line-height: 1.5;
}
.dpd-cert__tekst strong { color: #0f172a; font-weight: 600; }

.dpd-cert__training-naam {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: clamp(14px, 2vw, 21px);
    font-weight: 700;
    color: #1A73B5;
    margin: 8px 0 2px;
    letter-spacing: -.01em;
}

.dpd-cert__training-doelgroep {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: clamp(11px, 1.1vw, 13px);
    font-weight: 500;
    color: #1A73B5;
    margin: 0 0 6px;
    letter-spacing: 0;
}

/* ── Footer ── */
.dpd-cert__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    z-index: 1;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}
.dpd-cert__footer-left,
.dpd-cert__footer-right { flex: 0 0 auto; }
.dpd-cert__footer-center {
    flex: 1;
    text-align: center;
    padding: 0 28px;
}

.dpd-cert__handtekening-lijn {
    width: 150px;
    height: 1px;
    background: #cbd5e1;
    margin: 0 auto 8px;
}

.dpd-cert__label {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.dpd-cert__value {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-top: 2px;
}

/* ── KvK ── */
.dpd-cert__kvk {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 10px;
    color: #cbd5e1;
    text-align: center;
    z-index: 1;
    margin-top: 8px;
}

/* ── Action buttons ── */
.dpd-cert-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}

.dpd-cert-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--dpd-radius-md, 12px);
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 150ms cubic-bezier(.22,1,.36,1), box-shadow .2s ease, background .15s ease;
    text-decoration: none;
    border: none;
}
.dpd-cert-btn:active { transform: scale(.97); }

.dpd-cert-btn--print {
    background: var(--dpd-primary, #1A73B5);
    color: #fff;
    box-shadow: 0 1px 4px rgba(26,115,181,.2);
}
.dpd-cert-btn--print:hover {
    background: #155d94;
    box-shadow: 0 6px 20px rgba(26,115,181,.28);
    transform: translateY(-1px);
    color: #fff;
}

.dpd-cert-btn--download {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.dpd-cert-btn--download:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.dpd-cert-btn--share {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    position: relative;
}
.dpd-cert-btn--share:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* ── Share dropdown ── */
.dpd-cert-share {
    display: none;
    flex-direction: column;
    gap: 2px;
    max-width: 230px;
    margin: 10px auto 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--dpd-radius-md, 12px);
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    animation: dpdCertShareIn .2s ease;
}
.dpd-cert-share--open { display: flex; }

@keyframes dpdCertShareIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dpd-cert-share__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    transition: background .12s ease;
}
.dpd-cert-share__link:hover { background: #f8fafc; }
.dpd-cert-share__link--linkedin:hover { color: #0A66C2; }
.dpd-cert-share__link--email:hover    { color: #1A73B5; }

.dpd-cert-share__hint {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 11.5px;
    color: #94a3b8;
    margin: 0 0 4px;
    padding: 4px 14px 8px;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.5;
}

/* ── Error ── */
.dpd-cert-error {
    max-width: 480px;
    margin: 64px auto;
    text-align: center;
    padding: 40px;
    background: #fef2f2;
    border-radius: var(--dpd-radius-lg, 16px);
    border: 1px solid #fecaca;
}
.dpd-cert-error p { font-family: var(--dpd-font, 'DM Sans', sans-serif); font-size: 15px; color: #991b1b; margin: 0; }

/* ── Empty state ── */
.dpd-cert-empty {
    text-align: center;
    padding: 80px 20px;
}
.dpd-cert-empty__icon { font-size: 48px; margin-bottom: 16px; }
.dpd-cert-empty h2 {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}
.dpd-cert-empty p {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* ── Cert list (identieke styling als dashboard "Behaalde certificaten") ── */
.dpd-cert-lijst {
    max-width: 1100px;
    margin: 0 auto 64px;
    padding: 70px 24px 0;
}
@media (max-width: 600px) {
    .dpd-cert-lijst {
        padding-top: 64px;
    }
}
.dpd-cert-lijst__titel {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 24px;
    letter-spacing: -.02em;
}
.dpd-cert-lijst__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 900px) {
    .dpd-cert-lijst__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .dpd-cert-lijst__grid { grid-template-columns: 1fr; }
}

.dpd-cert-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 20px 18px;
    background: linear-gradient(160deg, rgba(15,165,115,.05) 0%, #fff 60%);
    border: 1px solid #e2e8f0;
    border-radius: var(--dpd-radius-lg, 16px);
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform 150ms cubic-bezier(.22,1,.36,1);
}
.dpd-cert-card:hover {
    border-color: #0FA573;
    box-shadow: 0 8px 24px rgba(15,165,115,.12);
    transform: translateY(-2px);
}

.dpd-cert-card__badge {
    width: 44px;
    height: 44px;
    background-color: #0FA573;
    border-radius: var(--dpd-radius-md, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15,165,115,.25);
    /* Verberg originele tekst/emoji content (zoals het graduation-cap emoji) */
    font-size: 0 !important;
    color: transparent !important;
    text-indent: -9999px;
    /* Vervang door checkmark-in-circle icoon (zelfde als dashboard) */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M22 11.08V12a10 10 0 11-5.93-9.14'/><path d='M22 4L12 14.01l-3-3'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}
/* Mocht er nog een svg/img/span in zitten: ook verbergen */
.dpd-cert-card__badge > *,
.dpd-cert-card__badge svg,
.dpd-cert-card__badge img,
.dpd-cert-card__badge span {
    display: none !important;
}

.dpd-cert-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.dpd-cert-card__info h3 {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -.01em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}
.dpd-cert-card__datum {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 12.5px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}
.dpd-cert-card__nummer {
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
    letter-spacing: .02em;
}

/* Bestaande arrow verbergen, we gebruiken een ::after "Bekijk" footer */
.dpd-cert-card__arrow { display: none !important; }

.dpd-cert-card::after {
    content: 'Bekijk →';
    display: block;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid rgba(15,165,115,.12);
    font-family: var(--dpd-font, 'DM Sans', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #0FA573;
    letter-spacing: .01em;
    transition: letter-spacing .15s cubic-bezier(.22,1,.36,1);
}
.dpd-cert-card:hover::after {
    letter-spacing: .06em;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .dpd-certificaat { padding: 40px 28px; aspect-ratio: auto; min-height: 520px; }
    .dpd-cert__title h1 { font-size: 28px; }
    .dpd-cert__naam { font-size: 24px; }
    .dpd-cert__training-naam { font-size: 16px; }
    .dpd-cert__footer { flex-direction: column; align-items: center; gap: 16px; }
    .dpd-cert__footer-left, .dpd-cert__footer-right { text-align: center; }
    .dpd-cert__seal { top: 20px; right: 20px; width: 60px; height: 60px; }
    .dpd-cert-actions { flex-direction: column; align-items: stretch; }
    .dpd-cert-btn { justify-content: center; }
}

/* ── Print ── */
@media print {
    @page { size: A4 landscape; margin: 0; }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Alle body-inhoud wegklappen */
    body * {
        visibility: hidden !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        line-height: 0 !important;
        font-size: 0 !important;
        border: none !important;
    }

    /* Certificaat: zichtbaar en vult de pagina */
    .dpd-certificaat,
    .dpd-certificaat * {
        visibility: visible !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        line-height: normal !important;
        font-size: inherit !important;
    }

    .dpd-certificaat {
        position: fixed !important;
        left: 0; top: 0;
        width: 100vw !important;
        height: 100vh !important;
        aspect-ratio: auto !important;
        border: 2px solid #1A73B5 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 48px 56px !important;
        margin: 0 !important;
        z-index: 999999;
        background: #fff !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: space-between !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Font-sizes herstellen voor certificaat-inhoud */
    .dpd-cert__title h1          { font-size: 42px !important; }
    .dpd-cert__hierbij           { font-size: 13px !important; }
    .dpd-cert__subtitle          { font-size: 11px !important; }
    .dpd-cert__naam              { font-size: 34px !important; border-bottom: 2px solid #e2e8f0 !important; padding: 0 24px 10px !important; }
    .dpd-cert__tekst p           { font-size: 14px !important; }
    .dpd-cert__training-naam     { font-size: 21px !important; margin: 8px 0 2px !important; }
    .dpd-cert__training-doelgroep{ font-size: 13px !important; font-weight: 500 !important; color: #1A73B5 !important; letter-spacing: 0 !important; margin: 0 0 6px !important; }
    .dpd-cert__label             { font-size: 10px !important; }
    .dpd-cert__value             { font-size: 12.5px !important; }
    .dpd-cert__kvk               { font-size: 10px !important; }

    /* Footer layout herstellen */
    .dpd-cert__footer {
        display: flex !important;
        width: 100% !important;
        align-items: flex-end !important;
        justify-content: space-between !important;
        padding-top: 18px !important;
        border-top: 1px solid #f1f5f9 !important;
    }
    .dpd-cert__footer-center { flex: 1 !important; text-align: center !important; padding: 0 28px !important; }
    .dpd-cert__handtekening-lijn { width: 150px !important; height: 1px !important; background: #cbd5e1 !important; margin: 0 auto 8px !important; }
    .dpd-cert__divider           { width: 70px !important; height: 3px !important; margin: 14px auto !important; }

    /* Logo */
    .dpd-cert__logo-img { max-width: 200px !important; height: auto !important; display: block !important; }

    /* Hoekaccenten */
    .dpd-cert__corner {
        position: absolute !important;
        width: 48px !important;
        height: 48px !important;
        border-color: #1A73B5 !important;
        border-style: solid !important;
        border-width: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .dpd-cert__corner--tl { border-top-width: 3px !important; border-left-width: 3px !important; }
    .dpd-cert__corner--tr { border-top-width: 3px !important; border-right-width: 3px !important; }
    .dpd-cert__corner--bl { border-bottom-width: 3px !important; border-left-width: 3px !important; }
    .dpd-cert__corner--br { border-bottom-width: 3px !important; border-right-width: 3px !important; }

    /* Achtergrondpatroon */
    .dpd-cert__bg-pattern {
        position: absolute !important;
        inset: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Knoppen definitief weg */
    .dpd-cert-back,
    .dpd-cert-actions,
    .dpd-cert-share,
    #wpadminbar {
        display: none !important;
    }
}
