/* Fonts are injected via wp_add_inline_style in certificate-manager.php */

/* ===== SEARCH FORM ===== */
.cm-search-con {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.cm-search-con form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 90%;
    max-width: 340px;
    margin: 1.5rem auto 0;
}

.cm-search-con input[type="text"] {
    padding: 10px 16px;
    border: 2px solid #6b2d8b;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.cm-search-con input[type="text"]:focus {
    border-color: #4a1a6b;
    box-shadow: 0 0 0 3px rgba(107,45,139,0.15);
}

.cm-search-con input[type="submit"] {
    padding: 10px 20px;
    background: linear-gradient(135deg, #6b2d8b, #4a1a6b);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cm-search-con input[type="submit"]:hover {
    opacity: 0.9;
}

/* ===== CERTIFICATE WRAPPER ===== */
.cm-certificate-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px 16px 48px;
    box-sizing: border-box;
}

/* ===== CERTIFICATE CARD ===== */
.cm-certificate-card {
    position: relative;
    width: 100%;
    max-width: 780px;
    background: #f8f4eb;
    /* outer gold border */
    outline: 1px solid #b8922a;
    outline-offset: -1px;
    /* double-border effect via box-shadow */
    box-shadow:
        inset 0 0 0 12px #f8f4eb,
        inset 0 0 0 14px #b8922a,
        0 8px 50px rgba(0,0,0,0.18);
    padding: 52px 64px 48px;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    box-sizing: border-box;
}

/* Decorative dotted/line border inside */
.cm-certificate-card::before {
    content: '';
    position: absolute;
    top: 22px; left: 22px; right: 22px; bottom: 22px;
    border: 1px solid rgba(184,146,42,0.5);
    pointer-events: none;
}

/* Corner ornaments - top-left */
.cm-cert-corner-tl,
.cm-cert-corner-tr,
.cm-cert-corner-bl,
.cm-cert-corner-br {
    position: absolute;
    width: 36px;
    height: 36px;
    border-color: #b8922a;
    border-style: solid;
}

.cm-cert-corner-tl {
    top: 14px; left: 14px;
    border-width: 2px 0 0 2px;
}
.cm-cert-corner-tr {
    top: 14px; right: 14px;
    border-width: 2px 2px 0 0;
}
.cm-cert-corner-bl {
    bottom: 14px; left: 14px;
    border-width: 0 0 2px 2px;
}
.cm-cert-corner-br {
    bottom: 14px; right: 14px;
    border-width: 0 2px 2px 0;
}

/* ===== LOGO (icon only, small) ===== */
.cm-cert-logo {
    margin-bottom: 6px;
}

.cm-cert-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ===== TITLE ===== */
.cm-cert-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 46px;
    font-weight: 700;
    letter-spacing: 10px;
    color: #1a1a3a;
    margin: 8px 0 0;
    line-height: 1;
    text-transform: uppercase;
}

.cm-cert-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 11px;
    letter-spacing: 5px;
    color: #555;
    text-transform: uppercase;
    margin: 6px 0 0;
}

.cm-cert-subtitle::before,
.cm-cert-subtitle::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background: #b8922a;
}

/* ===== DIVIDER ===== */
.cm-cert-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
}

.cm-cert-divider::before,
.cm-cert-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #b8922a, transparent);
}

.cm-cert-divider span {
    font-size: 11px;
    color: #b8922a;
}

/* ===== INTRO TEXT ===== */
.cm-cert-intro {
    font-style: italic;
    font-size: 17px;
    color: #555;
    margin: 0 0 2px;
    font-family: Georgia, serif;
}

/* ===== NAME ===== */
.cm-cert-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 46px;
    font-weight: 700;
    color: #1a1a3a;
    margin: 4px 0 14px;
    line-height: 1.15;
}

/* ===== COURSE ===== */
.cm-cert-course-intro {
    font-style: italic;
    font-size: 16px;
    color: #555;
    margin: 0 0 3px;
    font-family: Georgia, serif;
}

.cm-cert-course {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 30px;
    font-style: italic;
    font-weight: 400;
    color: #2a2a5a;
    margin: 0 0 4px;
}

.cm-cert-instructor {
    font-size: 14px;
    font-style: italic;
    color: #666;
    margin: 2px 0 0;
    font-family: Georgia, serif;
}

/* ===== INFO ROW ===== */
.cm-cert-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 18px 0 14px;
    text-align: left;
    gap: 10px;
    flex-wrap: wrap;
}

.cm-cert-info-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cm-cert-info-left span {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
    font-family: Georgia, serif;
}

.cm-cert-info-left .label {
    font-weight: 700;
}

.cm-cert-register {
    font-size: 13px;
    color: #5a1a8a;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: right;
}

/* ===== BOTTOM: SIGNATURE + SEAL ===== */
.cm-cert-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 10px;
    gap: 10px;
}

.cm-cert-signature-block {
    text-align: left;
}

.cm-cert-signature-block .sig-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a3a;
    margin-bottom: 6px;
    font-family: Georgia, serif;
}

.cm-cert-signed-by-logo {
    height: 34px;
    width: auto;
    display: block;
    margin-bottom: 3px;
}

.cm-cert-org-name {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    font-family: Georgia, serif;
}

.cm-cert-seal {
    flex-shrink: 0;
}

.cm-cert-seal img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    display: block;
}

/* ===== FOOTER ===== */
.cm-cert-footer {
    font-size: 10px;
    color: #999;
    line-height: 1.8;
    margin-top: 16px;
    border-top: 1px solid rgba(184,146,42,0.25);
    padding-top: 10px;
    font-style: italic;
    font-family: Georgia, serif;
}

.cm-cert-not-found {
    text-align: center;
    color: #888;
    font-size: 15px;
    padding: 10px;
    margin: 10px auto;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 680px) {
    .cm-certificate-card {
        padding: 40px 24px 36px;
        box-shadow:
            inset 0 0 0 8px #f8f4eb,
            inset 0 0 0 10px #b8922a,
            0 4px 20px rgba(0,0,0,0.15);
    }

    .cm-cert-title { font-size: 30px; letter-spacing: 5px; }
    .cm-cert-name  { font-size: 32px; }
    .cm-cert-course { font-size: 22px; }

    .cm-cert-info-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cm-cert-info-left { text-align: center; }
    .cm-cert-register  { text-align: center; }

    .cm-cert-bottom {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .cm-cert-signature-block { text-align: center; }
}
