/* Premium Certificate Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700;800;900&family=Caveat:wght@700&family=Cinzel:wght@600;700;800&family=Inter:wght@400;600;800&display=swap');

/* Certificate A4 Container Style */
#certificatePaper {
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
    width: 800px;
    height: 1130px;
    background: #fdfbf7;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Premium Gold Frame & Corners */
.cert-outer-border {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 3px double #d4af37;
    pointer-events: none;
    z-index: 10;
}

.cert-inner-border {
    position: absolute;
    top: 28px;
    left: 28px;
    right: 28px;
    bottom: 28px;
    border: 1px solid #c59b27;
    pointer-events: none;
    z-index: 10;
}

.cert-gold-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border-color: #d4af37;
    border-style: solid;
    z-index: 11;
}
.cert-gold-corner-tl { top: 25px; left: 25px; border-width: 4px 0 0 4px; }
.cert-gold-corner-tr { top: 25px; right: 25px; border-width: 4px 4px 0 0; }
.cert-gold-corner-bl { bottom: 25px; left: 25px; border-width: 0 0 4px 4px; }
.cert-gold-corner-br { bottom: 25px; right: 25px; border-width: 0 4px 4px 0; }

/* Watermark NGO Logo */
.cert-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    height: 450px;
    opacity: 0.04;
    background-image: url('images/Logo-removebg-preview (1).png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
}

/* Dynamic background pattern */
.cert-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-image: radial-gradient(circle at 1px 1px, #d4af37 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* Top Left Cert ID & Top Right Reg */
.cert-top-meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 50px 60px 10px 60px;
    position: relative;
    z-index: 5;
    font-size: 13px;
    font-weight: bold;
    color: #4a3e1a;
}

/* Header Heading Area */
.cert-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 50px;
    position: relative;
    z-index: 5;
    margin-top: 5px;
}

.cert-logo {
    width: 80px;
    height: 80px;
    object-contain: true;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.cert-subtitle {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #0c6b4f;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.cert-org-details {
    font-size: 11px;
    font-weight: 700;
    color: #d4af37;
    margin-top: 2px;
    text-transform: uppercase;
}

.cert-title-container {
    margin: 25px 0 15px 0;
    position: relative;
    display: inline-block;
}

.cert-title {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 38px;
    font-weight: 900;
    color: #8c6212;
    background: linear-gradient(135deg, #a67c1e 0%, #d4af37 50%, #aa7c11 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
    letter-spacing: 2px;
}

.cert-title-underline {
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37 20%, #8c6212 50%, #d4af37 80%, transparent);
    width: 200px;
    margin: 4px auto 0 auto;
}

/* Certificate Body Text Area */
.cert-body {
    position: relative;
    z-index: 5;
    padding: 0 65px;
    text-align: center;
    line-height: 2.1;
    font-size: 14px;
    color: #2e281a;
    font-weight: 500;
}

.cert-bold-text {
    font-weight: 800;
    color: #0c6b4f;
    border-bottom: 1px dashed #d4af37;
    padding: 0 5px;
    font-size: 15px;
}

/* Marks Table Styles */
.cert-table-container {
    position: relative;
    z-index: 5;
    padding: 0 65px;
    margin-top: 15px;
}

.cert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: center;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #d4af37;
}

.cert-table th {
    background: #0c6b4f;
    color: #ffffff;
    font-weight: 800;
    padding: 6px;
    border: 1px solid #d4af37;
}

.cert-table td {
    padding: 5px;
    border: 1px solid #e5d7ba;
    color: #3e331f;
    font-weight: 700;
}

.cert-table tr:nth-child(even) {
    background-color: #fbf9f4;
}

/* QR Code & Seals Section */
.cert-footer-container {
    position: absolute;
    bottom: 50px;
    left: 65px;
    right: 65px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 5;
}

.cert-footer-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #443c2c;
    text-align: left;
}

.cert-footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.cert-seal-area {
    width: 80px;
    height: 80px;
    border: 2px dashed #d4af37;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: #a47b1e;
    text-transform: uppercase;
    text-align: center;
    padding: 5px;
    background: rgba(255, 255, 255, 0.6);
}

.cert-footer-right {
    display: flex;
    gap: 30px;
    text-align: center;
}

.cert-signature-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 110px;
}

.cert-signature-line {
    width: 100%;
    height: 1px;
    background-color: #aa8c4a;
    margin-bottom: 5px;
}

.cert-signature-title {
    font-size: 11px;
    font-weight: bold;
    color: #443c2c;
}

.cert-qrcode {
    width: 70px;
    height: 70px;
    background: #ffffff;
    border: 1px solid #d4af37;
    padding: 3px;
}

/* Scaling CSS for previewing on smaller screens */
.card-scale-parent {
    overflow: hidden;
    display: flex;
    justify-content: center;
}
