/* BP Certificate Manager - Frontend (Mobile First) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

.bpcert-verify-wrap {
    font-family: 'Inter', sans-serif;
    padding: 16px;
    width: 100%;
}

/* ===== Verify Card ===== */
.bpcert-verify-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.10);
    overflow: hidden;
}

.bpcert-verify-header {
    background: linear-gradient(135deg, #1a3c5e 0%, #2980b9 100%);
    color: #fff;
    padding: 28px 20px 22px;
    text-align: center;
}
.bpcert-verify-icon { font-size: 40px; margin-bottom: 8px; }
.bpcert-verify-header h2 { font-size: 20px; font-weight: 700; margin: 0 0 5px; }
.bpcert-verify-header p  { opacity: .85; font-size: 13px; margin: 0; }

.bpcert-verify-form { padding: 20px 16px; }

/* Input + Button — stacked on mobile */
.bpcert-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bpcert-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px; /* 16px prevents iOS zoom */
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
}
.bpcert-input-group input:focus { border-color: #2980b9; }
.bpcert-input-group button {
    width: 100%;
    background: linear-gradient(135deg, #1a3c5e, #2980b9);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .5px;
    transition: opacity .2s;
    -webkit-appearance: none;
}
.bpcert-input-group button:active { opacity: .85; }

/* ===== Loading ===== */
.bpcert-loading {
    text-align: center;
    padding: 30px 16px;
    color: #888;
    font-size: 14px;
}
.bpcert-spinner {
    width: 34px; height: 34px;
    border: 3px solid #e0e0e0;
    border-top-color: #2980b9;
    border-radius: 50%;
    animation: bpcert-spin .7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes bpcert-spin { to { transform: rotate(360deg); } }

/* ===== Result Card ===== */
.bpcert-result-card {
    width: 100%;
    max-width: 700px;
    margin: 16px auto 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.10);
    overflow: hidden;
}
.bpcert-result-page { max-width: 700px; margin: 0 auto; padding: 16px; }

.bpcert-result-header {
    padding: 28px 20px;
    text-align: center;
    color: #fff;
}
.bpcert-result-header.valid    { background: linear-gradient(135deg,#27ae60,#2ecc71); }
.bpcert-result-header.revoked  { background: linear-gradient(135deg,#c0392b,#e74c3c); }
.bpcert-result-header.not-found{ background: linear-gradient(135deg,#7f8c8d,#95a5a6); }
.bpcert-result-icon  { font-size: 46px; margin-bottom: 8px; }
.bpcert-result-header h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.bpcert-result-header p  { opacity: .9; margin: 0; font-size: 13px; }

/* ===== Student Photo + Info ===== */
.bpcert-info-row {
    display: flex;
    flex-direction: column;   /* mobile: stacked */
    align-items: center;
    gap: 16px;
    padding: 20px 16px 8px;
}

.bpcert-student-photo-wrap { text-align: center; flex-shrink: 0; }
.bpcert-student-photo {
    width: 100px;
    height: 128px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #c9a84c;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    display: block;
    margin: 0 auto;
}
.bpcert-photo-name {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    text-align: center;
    max-width: 120px;
    word-break: break-word;
    margin-left: auto;
    margin-right: auto;
}

/* Info table */
.bpcert-result-body { width: 100%; padding: 0; }
.bpcert-result-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    gap: 8px;
}
.bpcert-result-row:last-child { border-bottom: none; }
.bpcert-result-row span  { color: #888; flex-shrink: 0; min-width: 100px; }
.bpcert-result-row strong{ color: #1a3c5e; font-weight: 600; text-align: right; word-break: break-word; }

.bpcert-status-badge.valid   { color: #27ae60; }
.bpcert-status-badge.revoked { color: #e74c3c; }

/* Verified note */
.bpcert-verified-note {
    margin: 4px 16px 20px;
    background: #f0fff4;
    border: 1px solid #a9d6b5;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: #2d6a4f;
    line-height: 1.6;
}
.bpcert-verified-note p { margin: 0 0 4px; }
.bpcert-verified-note p:last-child { margin: 0; }

/* ===== Certificate Image ===== */
.bpcert-cert-image-section {
    padding: 16px;
    border-top: 1px solid #f0f0f0;
}
.bpcert-cert-image-section h3 {
    font-size: 15px;
    color: #1a3c5e;
    margin: 0 0 12px;
    font-weight: 700;
}
.bpcert-cert-img-wrap { text-align: center; }
.bpcert-cert-full-img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    transition: transform .3s ease;
    cursor: zoom-in;
}
.bpcert-cert-full-img.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
    position: relative;
    z-index: 100;
}

.bpcert-cert-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.bpcert-btn-zoom, .bpcert-btn-download, .bpcert-btn-back {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: opacity .2s;
    -webkit-appearance: none;
}
.bpcert-btn-zoom     { background: #f0f4f8; color: #1a3c5e; border: 1px solid #c5d3e0; }
.bpcert-btn-download { background: linear-gradient(135deg,#1a3c5e,#2980b9); color: #fff; }
.bpcert-btn-back     { background: #f5f5f5; color: #555; border: 1px solid #ddd; }
.bpcert-btn-zoom:hover, .bpcert-btn-download:hover, .bpcert-btn-back:hover { opacity: .85; }

/* PDF iframe */
.bpcert-pdf-preview iframe {
    width: 100%;
    min-height: 320px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* ===== Tablet & Desktop ===== */
@media (min-width: 540px) {
    .bpcert-verify-wrap  { padding: 30px 20px; }
    .bpcert-verify-form  { padding: 28px; }
    .bpcert-verify-header{ padding: 36px 30px 28px; }
    .bpcert-verify-icon  { font-size: 48px; }
    .bpcert-verify-header h2 { font-size: 24px; }

    .bpcert-input-group {
        flex-direction: row; /* side by side */
    }
    .bpcert-input-group input  { font-size: 15px; }
    .bpcert-input-group button { width: auto; padding: 14px 28px; white-space: nowrap; }

    .bpcert-info-row {
        flex-direction: row;  /* side by side */
        align-items: flex-start;
        padding: 24px 28px 8px;
        gap: 22px;
    }
    .bpcert-result-body { padding: 0; }
    .bpcert-result-row span { min-width: 120px; }

    .bpcert-verified-note { margin: 4px 28px 22px; }
    .bpcert-cert-image-section { padding: 22px 28px 26px; }

    .bpcert-cert-actions {
        flex-direction: row;
        justify-content: center;
    }
    .bpcert-btn-zoom, .bpcert-btn-download, .bpcert-btn-back {
        width: auto;
        padding: 11px 24px;
    }

    .bpcert-pdf-preview iframe { min-height: 480px; }
}

@media (min-width: 768px) {
    .bpcert-result-header { padding: 36px 30px; }
    .bpcert-result-icon { font-size: 52px; }
    .bpcert-result-header h2 { font-size: 24px; }
}
