/* ============================================================
   Verify Document — Scoped CSS
   All rules prefixed with #vd-root to prevent bleed from
   Elementor / theme styles.
   ============================================================ */

/* ── Reset & base inside scope ───────────────────────────── */
#vd-root,
#vd-root * {
    box-sizing: border-box;
}
#vd-root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
    -webkit-font-smoothing: antialiased;
}
#vd-root h1, #vd-root h2, #vd-root h3, #vd-root h4,
#vd-root p, #vd-root ul, #vd-root ol { margin: 0; padding: 0; }
#vd-root a { text-decoration: none; }
#vd-root button { cursor: pointer; font-family: inherit; }
#vd-root input, #vd-root button, #vd-root select, #vd-root textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ── Widget card ─────────────────────────────────────────── */
#vd-root .vd-widget-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 28px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    max-width: 560px;
    width: 100%;
}
#vd-root .vd-widget-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
#vd-root .vd-widget-icon { width: 28px; height: 28px; flex-shrink: 0; }
#vd-root .vd-widget-head > span {
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    flex: 1;
}
#vd-root .vd-widget-ext {
    color: #9ca3af;
    display: flex;
    align-items: center;
    transition: color .15s;
}
#vd-root .vd-widget-ext:hover { color: #1a56db; }
#vd-root .vd-widget-ext svg { width: 15px; height: 15px; }
#vd-root .vd-widget-sub { font-size: 13px; color: #6b7280; margin-bottom: 16px; }
#vd-root .vd-widget-search { display: flex; gap: 8px; align-items: flex-start; }

/* ── Search input + autocomplete ─────────────────────────── */
#vd-root .vd-search-wrap { position: relative; flex: 1; }

#vd-root .vd-search-input {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .2s;
    margin: 0 !important;
}
#vd-root .vd-search-input:focus {
    border-color: #111827 !important;
    box-shadow: 0 0 0 3px rgba(17,24,39,.08) !important;
}
#vd-root .vd-search-input::placeholder { color: #9ca3af !important; }

/* Autocomplete dropdown */
#vd-root .vd-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
    z-index: 99999;
    display: none;
    max-height: 340px;
    overflow-y: auto;
}
#vd-root .vd-autocomplete.open { display: block; }
#vd-root .vd-autocomplete::-webkit-scrollbar { width: 5px; }
#vd-root .vd-autocomplete::-webkit-scrollbar-track { background: #f3f4f6; }
#vd-root .vd-autocomplete::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 4px; }

#vd-root .vd-ac-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
}
#vd-root .vd-ac-item:last-child { border-bottom: none; }
#vd-root .vd-ac-item:hover { background: #f8fafc; }

#vd-root .vd-ac-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
#vd-root .vd-ac-icon .dashicons { font-size: 18px !important; width: 18px !important; height: 18px !important; }
#vd-root .vd-ac-body { flex: 1; min-width: 0; }
#vd-root .vd-ac-name { font-size: 13px; font-weight: 600; color: #111827; }
#vd-root .vd-ac-sub  { font-size: 11px; color: #6b7280; margin-top: 1px; }
#vd-root .vd-ac-cert { font-size: 11px; color: #1a56db; font-weight: 500; margin-top: 1px; }

/* ── Status pill ─────────────────────────────────────────── */
#vd-root .vd-status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.5;
}
#vd-root .vd-pill-valid     { background: #dcfce7; color: #15803d; }
#vd-root .vd-pill-expired   { background: #fee2e2; color: #dc2626; }
#vd-root .vd-pill-suspended { background: #fef9c3; color: #a16207; }
#vd-root .vd-pill-revoked   { background: #f3f4f6; color: #374151; }

/* ── Verify button ───────────────────────────────────────── */
#vd-root .vd-verify-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 11px 22px;
    background: #2f498f !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    transition: background .15s;
    outline: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
#vd-root .vd-verify-btn:hover {
    background: #1d4ed8 !important;
}
#vd-root .vd-verify-btn:hover { background: #1f2937 !important; }
#vd-root .vd-verify-btn svg { width: 15px; height: 15px; }

.vd-form-only-bar { display: flex; justify-content: space-between; }
.vd-search-wrap.vd-form-only-search { margin-right: 5px; }

/* ── Full-page layout ────────────────────────────────────── */
#vd-root .vd-full { padding: 32px 0 48px; }

#vd-root .vd-full-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
#vd-root .vd-full-badge-icon { width: 36px; height: 36px; flex-shrink: 0; }
#vd-root .vd-full-title {
    font-size: clamp(24px, 4vw, 32px) !important;
    font-weight: 800 !important;
    color: #111827 !important;
    line-height: 1.15 !important;
}
#vd-root .vd-full-sub { font-size: 14px; color: #6b7280; margin-bottom: 24px; }

#vd-root .vd-full-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
#vd-root .vd-full-search { flex: 1; max-width: 480px; }

/* ── Results header ──────────────────────────────────────── */
#vd-root .vd-results-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
    flex-wrap: wrap;
}
#vd-root .vd-results-meta {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}
#vd-root .vd-results-meta strong { color: #111827; }

#vd-root .vd-view-toggle { display: flex; gap: 4px; }
#vd-root .vd-vtbtn {
    width: 34px; height: 34px;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #6b7280 !important;
    display: flex; align-items: center; justify-content: center;
    padding: 0 !important;
    transition: all .15s;
}
#vd-root .vd-vtbtn.active,
#vd-root .vd-vtbtn:hover {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #ffffff !important;
}
#vd-root .vd-vtbtn svg { width: 14px; height: 14px; }

/* ── Cards grid ──────────────────────────────────────────── */
#vd-root .vd-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 900px) { #vd-root .vd-cards { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 580px) { #vd-root .vd-cards { grid-template-columns: 1fr; } }

/* List view */
#vd-root .vd-cards.vd-list-view { grid-template-columns: 1fr; }
#vd-root .vd-cards.vd-list-view .vd-card { flex-direction: row; flex-wrap: wrap; }
#vd-root .vd-cards.vd-list-view .vd-card-foot { margin-left: auto; }

/* ── Single card ─────────────────────────────────────────── */
#vd-root .vd-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: box-shadow .2s, transform .18s;
}
#vd-root .vd-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

#vd-root .vd-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
#vd-root .vd-card-type-wrap { display: flex; align-items: center; gap: 8px; }
#vd-root .vd-card-type-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
#vd-root .vd-card-type-icon .dashicons { font-size: 18px !important; width: 18px !important; height: 18px !important; }
#vd-root .vd-card-type-name { font-size: 13px; font-weight: 700; color: #111827; line-height: 1.3; }
#vd-root .vd-card-type-sub  { font-size: 11px; color: #6b7280; }

#vd-root .vd-card-body { flex: 1; }
#vd-root .vd-card-ship {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    line-height: 1.4;
}
#vd-root .vd-card-row {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 3px;
}
#vd-root .vd-card-row span { color: #374151; font-weight: 500; }

#vd-root .vd-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

/* ── Small buttons (card footer) ─────────────────────────── */
#vd-root .vd-btn-sm {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 5px 12px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: opacity .15s;
    line-height: 1.4;
    white-space: nowrap;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
#vd-root .vd-btn-sm:hover { opacity: .82; }
#vd-root .vd-btn-sm svg { width: 12px; height: 12px; flex-shrink: 0; }
#vd-root .vd-btn-dl   { background: #eff6ff !important; color: #1a56db !important; }
#vd-root .vd-btn-view { background: #f0fdf4 !important; color: #15803d !important; }

/* ── Pagination ──────────────────────────────────────────── */
#vd-root .vd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 28px;
}
#vd-root .vd-page-btn {
    min-width: 36px; height: 36px;
    padding: 0 10px !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all .15s;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
}
#vd-root .vd-page-btn:hover:not(:disabled) { border-color: #1a56db !important; color: #1a56db !important; }
#vd-root .vd-page-btn.active { background: #111827 !important; border-color: #111827 !important; color: #ffffff !important; }
#vd-root .vd-page-btn:disabled { opacity: .4; cursor: default; }
#vd-root .vd-page-btn svg { width: 12px; height: 12px; }

/* ── Loading spinner ─────────────────────────────────────── */
#vd-root .vd-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 56px 24px;
    grid-column: 1 / -1;
}
#vd-root .vd-loading span {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #1a56db;
    display: inline-block;
    animation: vdBounce .9s ease-in-out infinite;
}
#vd-root .vd-loading span:nth-child(2) { animation-delay: .15s; }
#vd-root .vd-loading span:nth-child(3) { animation-delay: .30s; }
@keyframes vdBounce {
    0%,80%,100% { transform: scale(.55); opacity: .35; }
    40%         { transform: scale(1.0);  opacity: 1;   }
}

/* ── Empty / no results ──────────────────────────────────── */
#vd-root #vd-empty {
    text-align: center;
    padding: 64px 24px;
    background: #f8fafc;
    border-radius: 12px;
    margin-top: 8px;
}
/* Compact empty state inside widget card */
#vd-root .vd-widget-card #vd-empty {
    padding: 28px 16px;
    border-radius: 10px;
    margin-top: 16px;
}
/* Dimmer icon when showing "keep typing" hint */
#vd-root #vd-empty.vd-hint-only .vd-empty-icon { opacity: .25; font-size: 32px; }
#vd-root #vd-empty.vd-hint-only p { color: #9ca3af; font-weight: 500; }
#vd-root .vd-empty-icon {
    font-size: 44px;
    margin-bottom: 12px;
    line-height: 1;
    opacity: .5;
}
#vd-root #vd-empty p {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px !important;
}
#vd-root #vd-empty small { font-size: 13px; color: #9ca3af; }

/* ── Back button ─────────────────────────────────────────── */
#vd-root .vd-back-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: none !important;
    border: none !important;
    font-size: 13px !important;
    color: #6b7280 !important;
    padding: 0 !important;
    margin-bottom: 20px;
    font-weight: 500;
    transition: color .15s;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
#vd-root .vd-back-btn:hover { color: #111827 !important; }
#vd-root .vd-back-btn svg { width: 14px; height: 14px; }

/* ── Detail: top bar ─────────────────────────────────────── */
#vd-root .vd-detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
#vd-root .vd-detail-h2 {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin-bottom: 4px !important;
    line-height: 1.2 !important;
}
#vd-root .vd-detail-sub { font-size: 13px; color: #6b7280; }

#vd-root .vd-btn-pdf {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 20px !important;
    background: #1a56db !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    transition: background .15s;
    text-decoration: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
#vd-root .vd-btn-pdf:hover { background: #1648c0 !important; }
#vd-root .vd-btn-pdf svg { width: 15px; height: 15px; }

/* ── Detail: blue banner ─────────────────────────────────── */
#vd-root .vd-detail-banner {
    border-radius: 10px 10px 0 0;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#vd-root .vd-banner-left { display: flex; align-items: center; gap: 12px; }
#vd-root .vd-banner-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.18);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
#vd-root .vd-banner-icon .dashicons { font-size: 22px !important; width: 22px !important; height: 22px !important; color: #ffffff !important; }
#vd-root .vd-banner-cert { font-size: 20px; font-weight: 800; color: #ffffff; line-height: 1.2; }
#vd-root .vd-banner-ship { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 2px; }
#vd-root .vd-banner-badge {
    padding: 4px 14px;
    border: 1.5px solid rgba(255,255,255,.55);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

/* ── Detail: info panel ──────────────────────────────────── */
#vd-root .vd-detail-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    margin-bottom: 16px;
}
#vd-root .vd-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 680px) {
    #vd-root .vd-detail-cols { grid-template-columns: 1fr; }
}
#vd-root .vd-detail-col { padding: 20px 24px; }
#vd-root .vd-detail-col:first-child { border-right: 1px solid #f3f4f6; }
@media (max-width: 680px) {
    #vd-root .vd-detail-col:first-child { border-right: none; border-bottom: 1px solid #f3f4f6; }
}

#vd-root .vd-detail-col-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #6b7280;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}
#vd-root .vd-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 9px;
    font-size: 13px;
    line-height: 1.4;
}
#vd-root .vd-dr-icon { flex-shrink: 0; margin-top: 1px; }
#vd-root .vd-dr-icon .dashicons { font-size: 13px !important; width: 13px !important; height: 13px !important; color: #9ca3af !important; }
#vd-root .vd-dr-label { color: #6b7280; min-width: 120px; flex-shrink: 0; }
#vd-root .vd-dr-value { font-weight: 600; color: #111827; word-break: break-word; }
#vd-root .vd-remarks-text { font-size: 13px; color: #374151; margin-top: 4px; }

#vd-root .vd-detail-dates {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 12px 24px;
    border-top: 1px solid #f3f4f6;
    font-size: 12px;
    color: #9ca3af;
}
#vd-root .vd-detail-dates strong { color: #374151; }

/* ── Verified / invalid banners ──────────────────────────── */
#vd-root .vd-verified-banner,
#vd-root .vd-invalid-banner {
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 16px;
}
#vd-root .vd-verified-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
#vd-root .vd-invalid-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
}
#vd-root .vd-verified-banner svg,
#vd-root .vd-invalid-banner svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
#vd-root .vd-verified-banner strong { font-size: 14px; font-weight: 700; color: #15803d; display: block; margin-bottom: 4px; }
#vd-root .vd-verified-banner p     { font-size: 13px; color: #16a34a; }
#vd-root .vd-invalid-banner strong { font-size: 14px; font-weight: 700; color: #dc2626; display: block; margin-bottom: 4px; }
#vd-root .vd-invalid-banner p      { font-size: 13px; color: #ef4444; }

/* ── Empty state inside detail ───────────────────────────── */
#vd-root .vd-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}
#vd-root .vd-empty-state p { font-size: 15px; font-weight: 600; margin-bottom: 6px !important; color: #374151; }
#vd-root .vd-empty-state small { font-size: 13px; color: #9ca3af; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    #vd-root .vd-widget-card { padding: 18px; }
    #vd-root .vd-widget-search { flex-direction: column; }
    #vd-root .vd-verify-btn { width: 100% !important; justify-content: center; }
    #vd-root .vd-full-bar { flex-direction: column; }
    #vd-root .vd-full-search { max-width: 100%; width: 100%; }
    #vd-root .vd-detail-top { flex-direction: column; }
    #vd-root .vd-btn-pdf { width: 100% !important; justify-content: center; }
}

/* ── Form-only mode ──────────────────────────────────────── */
#vd-root .vd-form-only {
    width: 100%;
}
#vd-root .vd-form-only-bar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
#vd-root .vd-form-only-search {
    flex: 1 !important;
}
#vd-root .vd-form-only .vd-search-input {
    padding: 11px 16px !important;
    border-radius: 10px !important;
}
@media (max-width: 640px) {
    #vd-root .vd-form-only-bar { flex-direction: column !important; }
    #vd-root .vd-form-only .vd-verify-btn { width: 100% !important; justify-content: center !important; }
}
