/*
   HDL2Chips — Course Certificate Styles
   Premium certificate design with print support
*/

/* ── Page Layout ── */
.cert-page {
    min-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px 20px;
    background: var(--bg-main);
}

/* ── Actions Bar ── */
.cert-actions-bar {
    width: 100%;
    max-width: 700px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.cert-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.cert-back-btn:hover { color: var(--primary); }

.cert-action-btns {
    display: flex;
    gap: 10px;
}

.cert-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    font-family: inherit;
}

.cert-btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.cert-btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cert-btn-primary {
    background: var(--primary);
    color: #fff;
}

.cert-btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.cert-btn-linkedin {
    background: #0077b5;
    color: #fff;
}

.cert-btn-linkedin:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ── Certificate Wrapper ── */
.cert-wrapper {
    width: 100%;
    max-width: 700px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-wrapper.cert-loaded {
    opacity: 1;
}

/* ── Certificate Card ── */
.cert-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.06),
        0 8px 32px rgba(0,0,0,0.12),
        0 32px 64px rgba(0,0,0,0.08);
    color: #1e293b;
}

/* Dark mode — keep cert white (it's a document) */
.dark-mode .cert-card {
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 8px 32px rgba(0,0,0,0.4),
        0 32px 64px rgba(0,0,0,0.3);
}

/* ── Top Decorative Bar ── */
.cert-top-bar {
    height: 6px;
    background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 40%, #06b6d4 70%, #10b981 100%);
}

/* ── Header ── */
.cert-header {
    text-align: center;
    padding: 12px 24px 8px;
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

.cert-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
}

.cert-logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.cert-brand {
    font-size: 0.85rem;
    font-weight: 800;
    color: #1d4ed8;
    letter-spacing: -0.2px;
}

.cert-of-completion {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #64748b;
}

/* ── Divider ── */
.cert-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 40px;
    margin-bottom: 4px;
}

.cert-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

.cert-divider-diamond {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* ── Body ── */
.cert-body {
    text-align: center;
    padding: 8px 32px 8px;
}

.cert-presented-to {
    font-size: 0.7rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 2px;
}

.cert-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.2;
}

.cert-has-completed {
    font-size: 0.7rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 4px;
}

.cert-course-name {
    font-size: 1rem;
    font-weight: 800;
    color: #1d4ed8;
    letter-spacing: -0.2px;
    margin-bottom: 3px;
}

.cert-course-sub {
    font-size: 0.78rem;
    color: #64748b;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Stats Row ── */
.cert-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 8px 32px;
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 0;
}

.cert-stat {
    flex: 1;
    text-align: center;
}

.cert-stat-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1d4ed8;
}

.cert-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-top: 2px;
}

.cert-stat-sep {
    width: 1px;
    height: 40px;
    background: #e2e8f0;
    flex-shrink: 0;
}

/* ── Footer ── */
.cert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 32px 16px;
    gap: 12px;
}

.cert-sig-block {
    text-align: center;
    min-width: 160px;
}

.cert-sig-line {
    height: 1px;
    background: #cbd5e1;
    margin-bottom: 8px;
}

.cert-sig-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
}

.cert-sig-title {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 2px;
}

/* ── Seal ── */
.cert-seal {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15), 0 4px 10px rgba(59,130,246,0.3);
    flex-shrink: 0;
}

.cert-seal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #fff;
}

.cert-seal-inner i {
    font-size: 0.8rem;
}

.cert-seal-inner span {
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

/* ── Bottom Bar ── */
.cert-bottom-bar {
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 30%, #3b82f6 60%, #1d4ed8 100%);
}

/* ── Print Styles ── */
@media print {
    .cert-actions-bar { display: none !important; }
    .cert-page { padding: 0 !important; background: white !important; }
    #navbar-placeholder,
    #announcement-placeholder,
    #footer-placeholder { display: none !important; }

    .cert-wrapper {
        max-width: 100%;
        box-shadow: none;
    }

    .cert-card {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }

    body { background: white !important; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .cert-body { padding: 20px 24px 16px; }
    .cert-name { font-size: 1.6rem; }
    .cert-course-name { font-size: 1.1rem; }
    .cert-footer { flex-direction: column; align-items: center; }
    .cert-header { padding: 24px 24px 16px; }
    .cert-stats { margin: 16px 20px; }
}

/* ── Premium Border & Signature Additions ── */
.cert-card {
    padding: 16px;
    background: #ffffff;
}

.cert-inner-border {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    background: #ffffff;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.01);
}

.cert-signature-container {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.cert-signature-svg {
    width: 100px;
    height: 35px;
    fill: none;
    stroke: #0f172a; /* Sophisticated deep slate dark ink stroke */
    stroke-width: 1.6; /* Thinner, realistic pen stroke width */
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(1px 1px 0.5px rgba(0,0,0,0.03));
}

/* ── Locked Certificate Text Message Styles ── */
.cert-locked-message {
    max-width: 600px;
    margin: 100px auto;
    padding: 24px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    animation: fadeIn 0.4s ease-out;
}

.cert-locked-title {
    color: #f8fafc;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.cert-locked-desc {
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.cert-progress-detail {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.cert-progress-detail span {
    color: #3b82f6;
    font-weight: 700;
}

.cert-roadmap-link {
    display: inline-block;
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

.cert-roadmap-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Light mode adjustments */
.light-mode .cert-locked-title {
    color: #0f172a;
}

.light-mode .cert-locked-desc {
    color: #334155;
}

.light-mode .cert-progress-detail {
    color: #64748b;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
