/* ==========================================================================
   WPLMS Certificate Regenerator — Frontend [my_certificates] Shortcode
   ========================================================================== */

/* ---- Container ---- */
.wplms-my-certificates {
    max-width: 900px;
    margin: 0 auto 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wplms-cert-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #1d2327;
}

/* ---- Notice ---- */
.wplms-cert-notice {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.wplms-cert-notice--info {
    background: #f0f6fc;
    border: 1px solid #c3d9ed;
    color: #1d4677;
}

/* ---- Table Wrapper ---- */
.wplms-cert-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dde0e4;
    border-radius: 8px;
    background: #fff;
}

/* ---- Table ---- */
.wplms-cert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.925rem;
}
.wplms-cert-table thead {
    background: #f6f7f7;
}
.wplms-cert-table th {
    text-align: left;
    font-weight: 600;
    padding: 12px 16px;
    color: #50575e;
    border-bottom: 2px solid #dde0e4;
    white-space: nowrap;
}
.wplms-cert-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #2c3338;
}
.wplms-cert-table tbody tr:last-child td {
    border-bottom: none;
}
.wplms-cert-table tbody tr:hover {
    background: #f9fafb;
}
.wplms-cert-table code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #50575e;
}

/* ---- Download Button ---- */
.wplms-cert-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}
.wplms-cert-download-btn:hover,
.wplms-cert-download-btn:focus {
    background: #135e96;
    color: #fff !important;
}

/* ---- Pending Badge ---- */
.wplms-cert-pending {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #fcf0e3;
    color: #996800;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: help;
}

/* ---- Loading State ---- */
.wplms-cert-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    color: #50575e;
    font-size: 0.95rem;
}
.wplms-cert-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #dde0e4;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wplms-spin 0.6s linear infinite;
}
@keyframes wplms-spin {
    to { transform: rotate(360deg); }
}

/* ---- Responsive: Card Layout on Mobile ---- */
@media screen and (max-width: 640px) {
    .wplms-cert-table thead {
        display: none;
    }
    .wplms-cert-table,
    .wplms-cert-table tbody,
    .wplms-cert-table tr,
    .wplms-cert-table td {
        display: block;
        width: 100%;
    }
    .wplms-cert-table tr {
        padding: 12px 16px;
        border-bottom: 1px solid #eee;
    }
    .wplms-cert-table tr:last-child {
        border-bottom: none;
    }
    .wplms-cert-table td {
        padding: 4px 0;
        border-bottom: none;
        text-align: left;
    }
    .wplms-cert-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        font-size: 0.8rem;
        color: #50575e;
        margin-bottom: 2px;
    }
    .wplms-cert-table td:last-child {
        margin-top: 6px;
    }
}
