/* ============================================================
   Member Directory Pro — Public Stylesheet
   ============================================================ */

/* ── Reset / base ─────────────────────────────────────────── */
.mdp-wrapper *,
.mdp-wrapper *::before,
.mdp-wrapper *::after {
    box-sizing: border-box;
}

.mdp-wrapper {
    font-family: inherit;
    color: #333;
}

/* ── Filter form ──────────────────────────────────────────── */
.mdp-filter-form {
    background: #f8f9fa;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.mdp-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.mdp-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mdp-field-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mdp-field-group input,
.mdp-field-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.mdp-field-group input:focus,
.mdp-field-group select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.mdp-filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────── */
.mdp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
}

.mdp-btn-primary {
    background-color: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}
.mdp-btn-primary:hover {
    background-color: #1558c0;
    border-color: #1558c0;
    color: #fff;
}

.mdp-btn-secondary {
    background-color: #fff;
    border-color: #ccc;
    color: #555;
}
.mdp-btn-secondary:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
    color: #333;
}

/* ── Results info ─────────────────────────────────────────── */
.mdp-results-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    min-height: 20px;
}

/* ── Loading ──────────────────────────────────────────────── */
.mdp-loading {
    text-align: center;
    padding: 30px;
}
.mdp-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 4px solid #ddd;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: mdp-spin 0.7s linear infinite;
}
@keyframes mdp-spin { to { transform: rotate(360deg); } }

/* ── Table wrapper ────────────────────────────────────────── */
.mdp-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e6ea;
}

/* ── Table ────────────────────────────────────────────────── */
.mdp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}

.mdp-table thead th {
    background-color: #1a73e8;
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid #1558c0;
}

.mdp-table thead th.mdp-sortable {
    cursor: pointer;
    user-select: none;
}
.mdp-table thead th.mdp-sortable:hover {
    background-color: #1558c0;
}

.mdp-sort-icon {
    font-size: 11px;
    opacity: 0.6;
    margin-left: 4px;
}
th[data-active-sort="asc"]  .mdp-sort-icon::after { content: ' ▲'; opacity:1; }
th[data-active-sort="desc"] .mdp-sort-icon::after { content: ' ▼'; opacity:1; }

.mdp-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s;
}
.mdp-table tbody tr:last-child { border-bottom: none; }
.mdp-table tbody tr:hover td   { background-color: #f0f7ff; }
.mdp-table tbody tr:nth-child(even) td { background-color: #fafbfc; }
.mdp-table tbody tr:nth-child(even):hover td { background-color: #f0f7ff; }

.mdp-table td {
    padding: 11px 14px;
    vertical-align: middle;
    color: #444;
}

.mdp-loading-msg,
.mdp-no-results {
    text-align: center;
    padding: 40px !important;
    color: #888;
    font-style: italic;
}

/* ── Column widths ────────────────────────────────────────── */
.mdp-col-photo  { width: 60px; }
.mdp-col-number { width: 140px; }
.mdp-col-name   { min-width: 140px; }
.mdp-col-city   { min-width: 110px; }
.mdp-col-country{ min-width: 110px; }
.mdp-col-qual   { min-width: 200px; }
.mdp-col-master { width: 130px; }
.mdp-col-expiry { width: 140px; }
.mdp-col-link   { width: 120px; text-align: right; }

/* ── Member photo thumbnail ───────────────────────────────── */
.mdp-member-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e6ea;
}
.mdp-member-photo-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #dde3f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #1a73e8;
    border: 2px solid #c8d4f0;
}

/* ── Qual tags ────────────────────────────────────────────── */
.mdp-qual-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.mdp-qual-tag {
    display: inline-block;
    background: #e8f0fe;
    color: #1558c0;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

/* ── Master trainer badge ─────────────────────────────────── */
.mdp-master-badge {
    display: inline-block;
    background: #fce8e6;
    color: #c5221f;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

/* ── Profile link ─────────────────────────────────────────── */
.mdp-profile-link {
    display: inline-block;
    font-size: 13px;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 10px;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.mdp-profile-link:hover {
    background: #1a73e8;
    color: #fff;
    text-decoration: none;
}

/* ── Pagination ───────────────────────────────────────────── */
.mdp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
}

.mdp-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
}
.mdp-page-btn:hover       { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.mdp-page-btn.active      { background: #1a73e8; border-color: #1a73e8; color: #fff; cursor: default; }
.mdp-page-btn[disabled]   { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.mdp-page-ellipsis        { padding: 0 4px; color: #999; }

/* ── ─────────────────────────────────────────────────────────
   Single Member Profile Page
   ───────────────────────────────────────────────────────── */
.mdp-profile-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 16px;
}

.mdp-profile-card {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.mdp-profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #1a73e8 0%, #1252b3 100%);
    color: #fff;
}

.mdp-profile-photo img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.4);
    object-fit: cover;
}

.mdp-profile-photo--placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    border: 4px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.mdp-profile-name {
    margin: 0 0 4px;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}
.mdp-profile-number {
    margin: 0 0 10px;
    font-size: 14px;
    opacity: 0.8;
    color: #fff;
}

.mdp-status-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mdp-status-active   { background: #d4edda; color: #155724; }
.mdp-status-inactive { background: #fff3cd; color: #856404; }
.mdp-status-expired  { background: #f8d7da; color: #721c24; }

.mdp-profile-body {
    padding: 28px 32px;
}

.mdp-profile-section {
    margin-bottom: 28px;
}
.mdp-profile-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1a73e8;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f0fe;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mdp-detail-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px 16px;
    margin: 0;
}
.mdp-detail-list dt {
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-top: 2px;
}
.mdp-detail-list dd {
    margin: 0;
    color: #333;
    font-size: 14px;
    word-break: break-word;
}
.mdp-detail-list a {
    color: #1a73e8;
    text-decoration: none;
}
.mdp-detail-list a:hover { text-decoration: underline; }

.mdp-qual-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mdp-qual-list li {
    background: #e8f0fe;
    color: #1558c0;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
}

.mdp-bio {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

.mdp-profile-footer {
    padding: 20px 32px;
    border-top: 1px solid #e2e6ea;
    background: #f8f9fa;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 680px) {
    .mdp-filter-grid {
        grid-template-columns: 1fr;
    }
    .mdp-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .mdp-btn { justify-content: center; }

    .mdp-profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    .mdp-profile-body { padding: 20px; }
    .mdp-detail-list {
        grid-template-columns: 1fr;
        gap: 4px 0;
    }
    .mdp-detail-list dt { margin-top: 10px; }
    .mdp-profile-footer { padding: 16px 20px; }
}

/* ============================================================
   Certificate Lookup Widget
   ============================================================ */

.mdp-cert-lookup-wrapper { font-family: inherit; }

/* ── Search box ─────────────────────────────────────────── */
.mdp-cert-search-box {
    background: linear-gradient(135deg, #1a3a6e 0%, #1a73e8 100%);
    border-radius: 12px;
    padding: 44px 40px;
    text-align: center;
    color: #fff;
    box-shadow: 0 6px 32px rgba(26,58,110,0.22);
    margin-bottom: 32px;
}
.mdp-cert-search-title  { font-size: 26px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.mdp-cert-search-desc   { font-size: 15px; opacity: .85; margin-bottom: 28px; color: #fff; }
.mdp-cert-input-row     { display: flex; gap: 12px; max-width: 500px; margin: 0 auto; }
.mdp-cert-input-row input {
    flex: 1; padding: 13px 18px; border-radius: 7px; border: none;
    font-size: 15px; outline: none; box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.mdp-cert-input-row input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.4), 0 2px 10px rgba(0,0,0,0.15);
}
.mdp-cert-error {
    margin-top: 14px; background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35); border-radius: 7px;
    padding: 10px 16px; font-size: 14px; color: #ffe0e0;
}
.mdp-cert-loading { margin-top: 20px; }

/* ── Data card ──────────────────────────────────────────── */
.mdp-cert-data-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e6ea;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    margin-bottom: 20px;
}

/* Verified header strip */
.mdp-cert-card-header {
    background: linear-gradient(135deg, #1a3a6e 0%, #1a73e8 100%);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.mdp-cert-card-header-icon { font-size: 36px; flex-shrink: 0; }
.mdp-cert-card-header-text h3 {
    font-size: 20px; font-weight: 700; color: #fff; margin: 0 0 3px;
}
.mdp-cert-card-header-text p {
    font-size: 13px; color: rgba(255,255,255,0.8); margin: 0;
}

/* Colored meta tiles */
.mdp-cert-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0;
}
.mdp-cert-tile {
    padding: 20px 18px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.mdp-cert-tile:last-child { border-right: none; }
.mdp-cert-tile-icon  { font-size: 22px; margin-bottom: 8px; display: block; }
.mdp-cert-tile-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .14em;
    font-weight: 700; margin-bottom: 5px;
    color: #aaa;
}
.mdp-cert-tile-value { font-size: 15px; font-weight: 700; color: #222; }

/* Tile accent colors — left border */
.mdp-cert-tile--id      { border-left: 4px solid #1a73e8; }
.mdp-cert-tile--name    { border-left: 4px solid #8e44ad; }
.mdp-cert-tile--country { border-left: 4px solid #0ab5b5; }
.mdp-cert-tile--issue   { border-left: 4px solid #2ecc71; }
.mdp-cert-tile--expiry  { border-left: 4px solid #f39c12; }
.mdp-cert-tile--rating  { border-left: 4px solid #FFD700; }

/* Stars inside rating tile */
.mdp-cert-stars-wrap    { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mdp-cert-stars-filled  { color: #FFD700; font-size: 20px; letter-spacing: 2px; }
.mdp-cert-stars-empty   { color: #ddd;    font-size: 20px; letter-spacing: 2px; }
.mdp-cert-stars-num     { font-size: 12px; color: #aaa; font-weight: 600; }

/* ── Certificate image ──────────────────────────────────── */
.mdp-cert-image-wrap {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e6ea;
    overflow: hidden;
    box-shadow: 0 4px 28px rgba(0,0,0,0.10);
    margin-bottom: 20px;
}
.mdp-cert-image-wrap img { display: block; width: 100%; height: auto; }
.mdp-cert-no-image {
    padding: 60px 32px; text-align: center; color: #bbb;
    background: #fafafa; font-size: 15px;
}

/* ── Action buttons ─────────────────────────────────────── */
.mdp-cert-action-bar    { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.mdp-cert-dl-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 7px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    text-decoration: none; border: none; font-family: inherit;
    transition: opacity .18s, transform .12s;
}
.mdp-cert-dl-btn:hover  { opacity: .86; transform: translateY(-2px); text-decoration: none; }
.mdp-cert-dl-btn--primary   { background: #1a73e8; color: #fff; }
.mdp-cert-dl-btn--secondary { background: #1a3a6e; color: #fff; }
.mdp-cert-dl-btn--green     { background: #2ecc71; color: #fff; }

/* ── Gallery grid (member profile) ─────────────────────── */
.mdp-gallery { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.mdp-gallery-item {
    display: block; border-radius: 6px; overflow: hidden;
    aspect-ratio: 1/1; border: 1px solid #e2e6ea;
    transition: transform .2s, box-shadow .2s;
}
.mdp-gallery-item:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.mdp-gallery-item img   { width:100%; height:100%; object-fit:cover; display:block; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .mdp-cert-search-box    { padding: 28px 20px; }
    .mdp-cert-input-row     { flex-direction: column; }
    .mdp-cert-card-header   { padding: 18px; }
    .mdp-cert-tiles         { grid-template-columns: repeat(2,1fr); }
    .mdp-cert-action-bar    { flex-direction: column; }
    .mdp-cert-dl-btn        { justify-content: center; }
    .mdp-gallery            { grid-template-columns: repeat(2,1fr); }
}

/* ── Layout 2: Card Grid ─────────────────────────────────── */
.mdp-cert-layout2 { padding: 0; }
.mdp-cert-l2-header {
    display: flex; align-items: center; gap: 16px;
    padding: 22px 24px; border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.mdp-cert-l2-icon   { font-size: 36px; }
.mdp-cert-l2-name   { font-size: 20px; font-weight: 700; color: var(--mdp-text,#222); margin: 0 0 2px; }
.mdp-cert-l2-course { font-size: 14px; color: #888; margin: 0; }
.mdp-cert-l2-stars  { margin-left: auto; font-size: 22px; letter-spacing: 2px; }
.mdp-cert-l2-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0;
}
.mdp-cert-l2-cell {
    padding: 16px 20px; border-right: 1px solid #f5f5f5; border-bottom: 1px solid #f5f5f5;
}
.mdp-cert-l2-cell:nth-child(even) { border-right: none; }
.mdp-cert-l2-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #aaa; font-weight: 700; margin-bottom: 4px; }
.mdp-cert-l2-value { font-size: 15px; font-weight: 700; color: var(--mdp-text,#222); }

/* ── Layout 3: Sidebar ───────────────────────────────────── */
.mdp-cert-layout3-wrap {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 20px; align-items: start;
}
.mdp-cert-l3-left  { }
.mdp-cert-l3-img   { margin-bottom: 0 !important; }
.mdp-cert-l3-right { padding: 24px 22px; }
.mdp-cert-l3-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #d4edda; color: #155724; font-size: 12px; font-weight: 700;
    padding: 5px 14px; border-radius: 20px; margin-bottom: 16px;
    border: 1px solid #c3e6cb;
}
.mdp-cert-l3-name   { font-size: 22px; font-weight: 800; color: var(--mdp-text,#222); margin: 0 0 4px; }
.mdp-cert-l3-course { font-size: 15px; color: #777; margin: 0 0 16px; }
.mdp-cert-l3-dl     { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; }
.mdp-cert-l3-dl dt  { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #aaa; font-weight: 700; padding-top: 3px; }
.mdp-cert-l3-dl dd  { font-size: 14px; font-weight: 700; color: var(--mdp-text,#222); margin: 0; }

@media (max-width: 640px) {
    .mdp-cert-layout3-wrap { grid-template-columns: 1fr; }
    .mdp-cert-l2-grid      { grid-template-columns: 1fr; }
    .mdp-cert-l2-cell      { border-right: none; }
    .mdp-cert-l2-stars     { margin-left: 0; }
}
