/* =================================================================
   VerifyCert Professional Stylesheet
   ================================================================= */

/* --- 1. CORE VARIABLES & RESET --- */
:root {
    --primary: #1565C0;
    --primary-dark: #000035;
    --accent-red: #ce0a0a;
    --success: #166534;
    --bg-light: #F8F9FA;
    --text-dark: #1f2937;
    --text-light: #64748b;
    --radius: 12px;
}

body {
    background-color: #F4F6F8;
    color: var(--text-dark);
}

.verifycert-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 900px;
    margin: 40px auto;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius);
    background-color: #ffffff;
    border: 1px solid #EAECEE;
    overflow: hidden;
    box-sizing: border-box;
}

/* --- 2. HEADER SECTION --- */
.verifycert-brand-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: center; /* Centered for better look */
    gap: 15px;
    border-bottom: 1px solid #1976D2;
}

.verifycert-main-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    color: #fff;
}

.verifycert-logo {
    max-height: 80px;
    width: auto;
}

/* --- 3. PARTICIPANT INFO --- */
.verifycert-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background-color: #fff;
    border-bottom: 1px solid #EAECEE;
}

.verifycert-avatar img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

.verifycert-details {
    flex: 1;
}

.verifycert-name-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.verifycert-details h2, .participant-name {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
}

/* Reference IDs */
.reference-ids {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.id-item {
    display: flex;
    flex-direction: column;
}

.reference-id-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
}

.reference-id-value {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 16px;
    color: var(--primary);
    background-color: #E3F2FD;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
    display: inline-block;
}

/* KYC & Verified Badges */
.kyc-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #dcfce7;
    color: var(--success);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #bbf7d0;
}

/* --- 4. NEW CPD DASHBOARD (Grid Layout) --- */
.cpd-dashboard {
    background: linear-gradient(to bottom, #f0fdf4, #ffffff);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    margin: 30px;
    padding: 25px;
}

.cpd-stats-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 25px;
}

.cpd-stat-card { text-align: center; }
.cpd-stat-divider { width: 1px; height: 50px; background: #86efac; margin: 0 auto; }

.cpd-value { font-size: 36px; font-weight: 800; line-height: 1; margin: 5px 0; }
.highlight-green { color: var(--success); }
.highlight-blue { color: #0369a1; }
.cpd-label { font-size: 12px; font-weight: 700; text-transform: uppercase; opacity: 0.8; }
.cpd-sub { font-size: 13px; color: var(--text-light); }

/* Progress Bar */
.cpd-progress-section { margin-top: 20px; }
.progress-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #064e3b; }
.progress-bar-track { width: 100%; height: 10px; background: #bbf7d0; border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: #16a34a; transition: width 0.5s ease; }
.progress-footer { font-size: 12px; color: var(--success); margin-top: 5px; opacity: 0.9; }

/* --- 5. CREDENTIALS TABLE --- */
/* --- 5. CREDENTIALS TABLE --- */
.credentials-header {
    padding: 30px 40px 10px 40px;
    text-align: center; /* Centers the Heading */
}

.credentials-title {
    color: var(--text-dark);
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    display: inline-block;
}

.verifycert-table-wrapper {
    width: 100%;
    padding: 0 40px 30px 40px;
    box-sizing: border-box;
    overflow-x: auto; /* Adds scrollbar if table is too wide */
    -webkit-overflow-scrolling: touch;
}

.verifycert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    margin: 0 auto; /* Centers the table itself */
}

.verifycert-table th, .verifycert-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #EAECEE;
    text-align: left;
    vertical-align: middle;
    /* CHANGED: Allow text to wrap so it doesn't push off screen */
    white-space: normal; 
    word-wrap: break-word;
}

.verifycert-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 13px;
    text-transform: uppercase;
    border-bottom-width: 2px;
    /* Optional: prevent headers from breaking awkwardly */
    white-space: nowrap; 
}

/* Status Badges */
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 0.85em; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.status-valid, .status-cell-valid .status-badge { background-color: #dcfce7; color: #166534; }
.status-expired, .status-cell-expired .status-badge { background-color: #fee2e2; color: #991b1b; }
.status-expiring-soon, .status-cell-expiring-soon .status-badge { background-color: #fef9c3; color: #854d0e; }
.expired-row { opacity: 0.6; background-color: #fafafa; }

/* --- 6. FOOTER & FINGERPRINT --- */
.verifycert-footer {
    background-color: #F8FAFC;
    padding: 30px 40px;
    text-align: center;
    border-top: 1px solid #EAECEE;
}

.digital-fingerprint {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.fingerprint-code {
    display: block;
    background: #e2e8f0;
    padding: 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    word-break: break-all; /* Critical for mobile */
    color: #334155;
    margin: 8px 0;
}

/* --- 7. BUTTONS & ACTIONS --- */
.btn-linkedin {
    display: inline-flex;
    align-items: center;
    background-color: #0077b5;
    color: #ffffff !important;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #0077b5;
}
.btn-linkedin:hover { opacity: 0.9; }

.btn-verify-another {
    display: inline-block;
    background-color: var(--accent-red);
    color: #ffffff !important;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}
.btn-verify-another:hover { background-color: #b90909; }

.verifycert-actions { margin-top: 30px; text-align: center; margin-bottom: 30px; }

/* --- 8. SEARCH CARD --- */
.qhse-search-card { 
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); padding: 40px; 
    text-align: center; max-width: 600px; margin: 40px auto; 
}
.qhse-search-input { 
    width: 100%; padding: 12px 15px; border: 2px solid #e5e7eb; 
    border-radius: 6px; font-size: 16px; box-sizing: border-box; 
}
.qhse-search-btn { 
    width: 100%; padding: 12px 24px; background: var(--accent-red); 
    color: #fff; border: none; border-radius: 6px; 
    font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 10px; 
}

/* --- 9. GAMIFICATION BADGES --- */
.qhse-visual-badge {
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.qhse-visual-badge:hover { transform: translateY(-2px); }

/* =================================================================
   MOBILE RESPONSIVE STYLES (App-Like Feel)
   ================================================================= */
@media screen and (max-width: 768px) {
    /* Container Reset */
    .verifycert-container {
        margin: 15px;
        width: auto;
        border-radius: 8px;
    }

    /* Header Adjustments */
    .verifycert-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 15px;
    }
    
    .verifycert-avatar img { width: 110px; height: 110px; }
    .verifycert-name-header { justify-content: center; }
    .verifycert-details h2 { font-size: 26px; }
    .reference-ids { justify-content: center; }

    /* Stacked Stats Grid */
    .cpd-dashboard { margin: 0 15px 20px 15px; padding: 20px; }
    .cpd-stats-grid { 
        display: flex; 
        flex-direction: column; 
        gap: 20px; 
    }
    .cpd-stat-divider { width: 80%; height: 1px; margin: 0 auto; }

    /* --- THE MOBILE CARD VIEW FOR TABLES --- */
    .verifycert-table-wrapper { padding: 0 15px 20px 15px; }
    
    .verifycert-table thead { display: none; } /* Hide Headers */
    
    .verifycert-table tr {
        display: block;
        background: #fff;
        border: 1px solid #EAECEE;
        border-radius: 8px;
        margin-bottom: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.03);
        padding: 15px;
    }
    
    .verifycert-table td {
        display: block;
        text-align: right;
        padding: 8px 0;
        padding-left: 50%; /* Make space for label */
        position: relative;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .verifycert-table td:last-child { border-bottom: none; }
    
    /* Create labels dynamically from data-label attribute */
    .verifycert-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        text-align: left;
        font-weight: 700;
        color: #64748b;
        font-size: 12px;
        text-transform: uppercase;
        top: 10px;
    }
    
    /* Highlight the Activity Name (First Cell) */
    .verifycert-table td[data-label="Activity"] {
        text-align: left;
        padding-left: 0;
        font-size: 16px;
        color: var(--primary);
        font-weight: 700;
        border-bottom: 2px dashed #eee;
        margin-bottom: 8px;
    }
    .verifycert-table td[data-label="Activity"]::before { display: none; }

    /* Search Card Mobile */
    .qhse-search-card { padding: 20px; width: auto; margin: 20px 10px; }
}