/* ══════════════════════════════════════════════════════════════════════
   EVCheck - BPAN Decoder Stylesheet (decoder.css)
   ══════════════════════════════════════════════════════════════════════ */

.evc-wrap {
    max-width: 680px;
    margin: 0 auto;
    font-family: var(--ev-font-sans);
    color: var(--ev-gray-700);
}

/* ── Main Input Card ────────────────────────────────────────────────── */
.evc-card {
    background: var(--ev-white);
    border: 1px solid var(--ev-border);
    border-radius: var(--ev-radius-xl);
    padding: 32px 28px;
    box-shadow: var(--ev-shadow-md);
}

/* ── QR Button ──────────────────────────────────────────────────────── */
.evc-qr-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--ev-green);
    color: #ffffff;
    border: none;
    border-radius: var(--ev-radius-md);
    padding: 16px 24px;
    font-family: var(--ev-font-sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ev-transition);
    margin-bottom: 24px;
    letter-spacing: 0.01em;
}

.evc-qr-btn:hover {
    background: var(--ev-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 150, 0.35);
}

.evc-qr-btn:active {
    transform: scale(0.99);
}

.evc-qr-btn:focus-visible {
    outline: 3px solid var(--ev-green);
    outline-offset: 2px;
}

/* ── Label ──────────────────────────────────────────────────────────── */
.evc-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ev-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

/* ── Input Box & Clear Button ───────────────────────────────────────── */
.evc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.evc-input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 2px solid var(--ev-border);
    border-radius: var(--ev-radius-md);
    font-family: var(--ev-font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--ev-dark);
    letter-spacing: 2px;
    text-transform: uppercase;
    background: #FAFBFA;
    outline: none;
    caret-color: var(--ev-green);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
}

.evc-input::placeholder {
    color: #C9D0CE;
    font-size: 13px;
    letter-spacing: 1px;
    font-weight: 400;
}

.evc-input:focus {
    border-color: var(--ev-green);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
    background: #ffffff;
}

.evc-input.is-valid {
    border-color: var(--ev-green);
    background: var(--ev-green-light);
}

.evc-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #E0E6E4 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ev-gray-500, #6B7280) !important;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.evc-clear-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
}

.evc-clear-btn:hover {
    background: #CBD5E1;
    color: var(--ev-dark);
}

/* ── Meta Row (Counter & Paste) ─────────────────────────────────────── */
.evc-input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.evc-counter {
    font-size: 12px;
    color: var(--ev-gray-500);
    font-family: var(--ev-font-mono);
    transition: color 0.2s;
}

.evc-counter.is-complete {
    color: var(--ev-green-dark);
    font-weight: 700;
}

.evc-paste-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #FFFFFF !important;
    border: 1px solid var(--ev-border, #E0E6E4) !important;
    border-radius: var(--ev-radius-sm, 6px);
    padding: 5px 12px;
    font-family: var(--ev-font-sans, inherit);
    font-size: 12px;
    font-weight: 600;
    color: var(--ev-gray-600, #4B5563) !important;
    cursor: pointer;
    transition: var(--ev-transition);
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.evc-paste-btn:hover {
    border-color: var(--ev-green, #00C896) !important;
    color: var(--ev-green-dark, #047857) !important;
    background: #F3FAF7 !important;
}

.evc-input-hint {
    font-size: 12px;
    color: var(--ev-gray-400);
    margin: 0 0 16px;
    line-height: 1.5;
}

/* ── Examples ───────────────────────────────────────────────────────── */
.evc-examples {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--ev-border);
}

.evc-examples-label {
    font-size: 12px;
    color: var(--ev-gray-500);
    font-weight: 500;
}

.evc-ex-btn {
    font-family: var(--ev-font-mono, monospace);
    font-size: 11px;
    font-weight: 600;
    color: var(--ev-green-dark, #047857) !important;
    background: var(--ev-green-light, #E6FAF5) !important;
    border: 1px solid rgba(0, 200, 150, 0.3) !important;
    padding: 5px 12px;
    border-radius: var(--ev-radius-sm, 6px);
    cursor: pointer;
    transition: var(--ev-transition);
    letter-spacing: 0.5px;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.evc-ex-btn:hover {
    background: #C2F0E4 !important;
    border-color: var(--ev-green, #00C896) !important;
    color: var(--ev-green-dark, #047857) !important;
}

/* ── Saved BPAN Container ─────────────────────────────────────────── */
.evc-saved-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: var(--ev-radius-sm, 6px);
    border: 1px dashed #cbd5e1;
}

.evc-saved-label {
    font-size: 11px;
    color: var(--ev-gray-500);
    font-weight: 500;
}

.evc-saved-pill {
    font-family: var(--ev-font-mono, monospace);
    font-size: 11px;
    font-weight: 600;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.evc-saved-pill:hover {
    background: #bfdbfe;
    border-color: #93c5fd;
}

/* ── Decode Action Button ───────────────────────────────────────────── */
.evc-decode-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--ev-dark, #111827) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: var(--ev-radius-md, 10px);
    font-family: var(--ev-font-sans, inherit);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ev-transition);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-appearance: none;
    appearance: none;
}

.evc-decode-btn:disabled {
    background: var(--ev-gray-300, #D1D5DB) !important;
    color: var(--ev-gray-400, #6B7280) !important;
    cursor: not-allowed;
    transform: none !important;
}

.evc-decode-btn:not(:disabled):hover {
    background: var(--ev-dark-surface, #1F2937) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.25) !important;
}

.evc-decode-btn:not(:disabled):active {
    transform: scale(0.99);
}

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

.evc-spinner {
    animation: evc-spin 0.8s linear infinite;
}

/* ══════════════════════════════════════════════════════════════════════
   QR CODE SCANNER OVERLAY
   ══════════════════════════════════════════════════════════════════════ */
.evc-qr-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.evc-qr-overlay.open {
    display: flex;
}

.evc-qr-box {
    background: #ffffff;
    border-radius: var(--ev-radius-lg);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: var(--ev-shadow-xl);
}

.evc-qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ev-border);
}

.evc-qr-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ev-dark);
}

.evc-qr-close {
    background: var(--ev-gray-100);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--ev-gray-600);
    position: relative;
}

.evc-qr-close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
}

.evc-qr-viewport {
    width: 100%;
    min-height: 280px;
    background: #000000;
}

.evc-qr-hint {
    font-size: 12px;
    color: var(--ev-gray-500);
    text-align: center;
    padding: 12px 20px;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   RESULTS PANEL STYLES
   ══════════════════════════════════════════════════════════════════════ */
@keyframes evc-slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.evc-results {
    margin-top: 20px;
    animation: evc-slide-in 0.28s ease;
}

/* ── 1. Traffic-Light Overall Status Banner ── */
.evc-banner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px 24px;
    border-radius: var(--ev-radius-lg);
    color: #ffffff;
    margin-bottom: 16px;
    box-shadow: var(--ev-shadow-sm);
}

.evc-banner-icon {
    font-size: 26px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.evc-banner-headline {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.evc-banner-sub {
    font-size: 14px;
    opacity: 0.92;
    line-height: 1.55;
}

/* ── 2. Three Key Facts Cards ── */
.evc-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.evc-fact {
    background: var(--ev-white);
    border: 1px solid var(--ev-border);
    border-radius: var(--ev-radius-md);
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--ev-shadow-xs);
}

.evc-fact.warn {
    border-color: var(--ev-warn-border);
    background: var(--ev-warn-bg);
}

.evc-fact.bad {
    border-color: var(--ev-danger-border);
    background: var(--ev-danger-bg);
}

.evc-fact.good {
    border-color: var(--ev-safe-border);
    background: var(--ev-safe-bg);
}

.evc-fact-emoji {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 6px;
}

.evc-fact-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ev-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.evc-fact-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--ev-dark);
    margin-bottom: 4px;
}

.evc-fact-sub {
    font-size: 12px;
    color: var(--ev-gray-500);
    line-height: 1.4;
}

/* ── 3. Action Items ── */
.evc-actions-box {
    background: var(--ev-white);
    border: 1px solid var(--ev-border);
    border-radius: var(--ev-radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--ev-shadow-xs);
}

.evc-actions-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--ev-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.evc-action-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--ev-gray-100);
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ev-gray-700);
}

.evc-action-item:last-child {
    border-bottom: none;
}

.evc-action-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── 4. Collapsible Technical Breakdown Table ── */
.evc-details-card {
    background: var(--ev-white);
    border: 1px solid var(--ev-border);
    border-radius: var(--ev-radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--ev-shadow-xs);
}

.evc-details-toggle {
    width: 100%;
    background: var(--ev-gray-50, #F9FAFB) !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 16px 20px;
    text-align: left;
    font-family: var(--ev-font-sans, inherit);
    font-size: 13px;
    font-weight: 700;
    color: var(--ev-gray-700, #374151) !important;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--ev-transition);
    -webkit-appearance: none;
    appearance: none;
}

.evc-details-toggle:hover {
    background: var(--ev-gray-100, #F3F4F6) !important;
    color: var(--ev-dark, #111827) !important;
}

.evc-tech-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.evc-tech-table tr {
    border-bottom: 1px solid var(--ev-gray-100);
}

.evc-tech-table tr:last-child {
    border-bottom: none;
}

.evc-tech-table td {
    padding: 12px 18px;
    vertical-align: middle;
}

.td-tech-pos {
    width: 15%;
    font-family: var(--ev-font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--ev-gray-400);
}

.td-tech-param {
    width: 35%;
    font-weight: 600;
    color: var(--ev-dark);
}

.td-tech-val {
    width: 50%;
    color: var(--ev-gray-600);
}

.td-tech-val code {
    font-family: var(--ev-font-mono);
    font-weight: 700;
    color: var(--ev-green-dark);
    background: var(--ev-green-light);
    padding: 2px 6px;
    border-radius: var(--ev-radius-sm);
}

@media (max-width: 640px) {
    .evc-card {
        padding: 24px 18px;
    }

    .evc-facts {
        grid-template-columns: 1fr;
    }

    .evc-banner {
        flex-direction: column;
        gap: 10px;
    }
}
