/*
 * LumiCode — Code Scanner Page Styles v1.4.3
 * Loaded only on the scanner admin page.
 * Scoped within #lc-wrap.
 */

/* ── Info cards ──────────────────────────────────────────── */
.lc-info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

@media (max-width: 720px) {
    .lc-info-row { grid-template-columns: 1fr; }
}

.lc-info-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.lc-info-card strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 3px;
}

.lc-info-card span {
    font-size: 11.5px;
    color: rgba(148,163,184,0.42);
    line-height: 1.45;
}

.lc-info-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lc-info-icon--purple { background: rgba(167,139,250,0.12); color: #a78bfa; }
.lc-info-icon--blue   { background: rgba(96,165,250,0.12);  color: #60a5fa; }
.lc-info-icon--green  { background: rgba(52,211,153,0.12);  color: #34d399; }

/* ── Toolbar ─────────────────────────────────────────────── */
.lc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lc-scan-status {
    font-size: 13px;
    color: rgba(148,163,184,0.5);
}
.lc-scan-status.is-ok   { color: #34d399; }
.lc-scan-status.is-err  { color: #f87171; }
.lc-scan-status.is-wait { color: #fbbf24; }

/* ── Scan progress modal ─────────────────────────────────── */
#lc-scan-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;               /* always flex, hidden via opacity+pointer-events */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
#lc-scan-modal.is-open { opacity: 1; pointer-events: all; }

.lc-scan-modal-box {
    background: #141720;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 36px 40px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.65);
}

.lc-scan-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(167,139,250,0.15);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: lc-spin 0.8s linear infinite;
    margin: 0 auto 18px;
}

@keyframes lc-spin { to { transform: rotate(360deg); } }

.lc-scan-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lc-scan-modal-sub {
    font-size: 12px;
    color: rgba(148,163,184,0.45);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Summary bar ─────────────────────────────────────────── */
.lc-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 9px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.lc-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.lc-chip {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}
.lc-chip-pending  { background: rgba(251,191,36,0.10);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.22); }
.lc-chip-applied  { background: rgba(52,211,153,0.10);  color: #34d399; border: 1px solid rgba(52,211,153,0.22); }
.lc-chip-dismissed{ background: rgba(148,163,184,0.07); color: rgba(148,163,184,0.4); border: 1px solid rgba(255,255,255,0.07); }

/* ═══════════════════════════════════════════════════════════
   RESULTS PLACEHOLDER
   Ghost rows that mirror the real result row layout, with a
   centred overlay showing "Ready to scan" text.
   ═══════════════════════════════════════════════════════════ */
.lc-results-placeholder {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    min-height: 220px;  /* ensure overlay is visible before scan */
}

/* Ghost rows — mimic real .lc-row structure */
.lc-placeholder-row-ghost {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px;
    margin-bottom: 8px;
    overflow: hidden;
    pointer-events: none;
    /* Filter blur so they clearly look like placeholders */
    filter: blur(0.5px);
}

.lc-placeholder-row-ghost-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    gap: 10px;
}

.lc-placeholder-row-ghost-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* Shimmer bar — base element */
.lc-placeholder-ghost-bar {
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 100%
    );
    background-size: 300% 100%;
    animation: lc-shimmer 2s ease-in-out infinite;
    height: 12px;
}

.lc-placeholder-ghost-title   { width: 200px; height: 13px; }
.lc-placeholder-ghost-actions { width: 220px; height: 28px; border-radius: 6px; }
.lc-placeholder-ghost-line    { width: 88%; height: 11px; }

@keyframes lc-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Centred overlay on top of ghost rows */
.lc-placeholder-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(13,15,24,0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 24px;
    text-align: center;
    border-radius: 10px;
    border: 1px dashed rgba(167,139,250,0.22);
}

.lc-placeholder-overlay-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(167,139,250,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(167,139,250,0.65);
    margin-bottom: 14px;
    flex-shrink: 0;
}

.lc-placeholder-overlay-title {
    font-size: 15px;
    font-weight: 700;
    color: rgba(226,232,240,0.75);
    margin: 0 0 8px;
}

.lc-placeholder-overlay-sub {
    font-size: 12.5px;
    color: rgba(148,163,184,0.48);
    line-height: 1.6;
    max-width: 340px;
    margin: 0;
}

.lc-placeholder-overlay-sub strong {
    color: rgba(167,139,250,0.8);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   RESULT ROWS
   ═══════════════════════════════════════════════════════════ */
.lc-row {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 9px;
    margin-bottom: 9px;
    overflow: hidden;
    transition: border-color 0.2s, opacity 0.25s;
}

.lc-row.is-applied   { border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.025); }
.lc-row.is-dismissed { opacity: 0.28; border-style: dashed; }

.lc-row-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 10px;
    flex-wrap: wrap;
}

.lc-row-hd-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.lc-row-title {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    text-decoration: none;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.12s;
}
.lc-row-title:hover { color: #a78bfa; }

.lc-row-view {
    font-size: 11px;
    color: rgba(148,163,184,0.38);
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.12s;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 2px 8px;
    border-radius: 5px;
}
.lc-row-view:hover { color: #a78bfa; border-color: rgba(167,139,250,0.3); }

.lc-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.lc-lang-label {
    font-size: 11px;
    color: rgba(148,163,184,0.38);
}

.lc-lang-sel {
    padding: 5px 24px 5px 9px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='rgba(148,163,184,0.38)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
}
.lc-lang-sel option { background: #1a1d2e; color: #e2e8f0; }

.lc-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    background: rgba(167,139,250,0.12);
    border: 1px solid rgba(167,139,250,0.28);
    border-radius: 6px;
    color: #a78bfa;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.lc-apply-btn:hover    { background: rgba(167,139,250,0.24); }
.lc-apply-btn:disabled { opacity: 0.35; cursor: default; }

.lc-dismiss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 6px;
    color: rgba(148,163,184,0.38);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    line-height: 1;
}
.lc-dismiss-btn:hover { background: rgba(248,113,113,0.09); color: #f87171; border-color: rgba(248,113,113,0.25); }

/* ── Full-code snippet preview ───────────────────────────── */
.lc-row-snippet {
    padding: 10px 14px;
    background: rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lc-snippet-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148,163,184,0.28);
    margin-bottom: 6px;
}

/* Full code — scrollable, no truncation */
.lc-snippet-pre {
    font-family: ui-monospace, 'JetBrains Mono', monospace !important;
    font-size: 11.5px !important;
    color: rgba(148,163,184,0.65) !important;
    white-space: pre !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 200px !important;
    line-height: 1.6 !important;
    background: rgba(0,0,0,0.22) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    box-shadow: none !important;
    /* Override WP admin global <pre> styles */
    word-wrap: normal !important;
    word-break: normal !important;
    tab-size: 4 !important;
    display: block !important;
}

.lc-snippet-pre::-webkit-scrollbar       { height: 4px; width: 4px; }
.lc-snippet-pre::-webkit-scrollbar-track { background: transparent; }
.lc-snippet-pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 2px; }

/* ── Row status ──────────────────────────────────────────── */
.lc-row-status {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    display: none;
}
.lc-row-status.is-visible { display: block; }
.lc-row-status.is-ok      { color: #34d399; }
.lc-row-status.is-err     { color: #f87171; }
.lc-row-status.is-wait    { color: #fbbf24; }
.lc-row-status.is-mute    { color: rgba(148,163,184,0.4); }
