/* ═══════════════════════════════════════════════════════════════════════════════
   TmpMailer AI Engine — Browser-Based Styles
   Zero server cost, zero GPU required. Runs ONNX models via WebAssembly.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Classification Badges ──────────────────────────────────────────────── */

.ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.ai-badge-security {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.ai-badge-transactional {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.ai-badge-promotional {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.ai-badge-social {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.ai-badge-other {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* ─── OTP Banner ────────────────────────────────────────────────────────── */

.ai-otp-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    margin: 8px 0;
}

.ai-otp-label {
    font-size: 12px;
    font-weight: 600;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-otp-code {
    font-size: 20px;
    font-weight: 700;
    color: #15803d;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    background: white;
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid #86efac;
}

.ai-otp-copy {
    margin-left: auto;
    padding: 4px 12px;
    background: #15803d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-otp-copy:hover {
    background: #166534;
}

/* ─── Summary Bar ───────────────────────────────────────────────────────── */

.ai-summary-bar {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
}

.ai-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6d28d9;
}

.ai-summary-header button {
    background: none;
    border: none;
    color: #8b5cf6;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
}

.ai-summary-header button:hover {
    background: #ddd6fe;
}

.ai-summary-text {
    font-size: 14px;
    line-height: 1.5;
    color: #4c1d95;
}

/* ─── Summary Button ────────────────────────────────────────────────────── */

.ai-summary-btn {
    padding: 4px 12px;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-summary-btn:hover:not(:disabled) {
    background: #ede9fe;
    border-color: #8b5cf6;
}

.ai-summary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Model Loading Progress ────────────────────────────────────────────── */

.ai-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 4px 0;
}

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 2px;
    transition: width 0.3s ease;
}


/* ─── Reply Suggestions ────────────────────────────────────────────────── */

.ai-reply-suggestions {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 8px 0;
}

.ai-reply-header {
    font-size: 12px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-reply-chip {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 13px;
    color: #14532d;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.ai-reply-chip:hover {
    background: #166534;
    color: white;
    border-color: #14532d;
}

.ai-reply-chip.ai-reply-copied {
    background: #166534;
    color: white;
}

.ai-reply-btn {
    background: #ecfdf5;
    color: #065f46;
    border-color: #86efac;
}

.ai-reply-btn:hover:not(:disabled) {
    background: #d1fae5;
    border-color: #166534;
}

/* ─── Spam Warning ─────────────────────────────────────────────────────── */

.ai-spam-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #991b1b;
    line-height: 1.4;
}

.ai-spam-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.ai-spam-text {
    flex: 1;
    font-weight: 500;
}

.ai-spam-dismiss {
    background: none;
    border: none;
    color: #991b1b;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
}

.ai-spam-dismiss:hover {
    background: #fecaca;
}

/* ─── WebLLM Status Indicator ──────────────────────────────────────────── */

.ai-webllm-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #c4b5fd;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #6d28d9;
}

.ai-webllm-status .ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: ai-status-pulse 2s infinite;
}

@keyframes ai-status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── AI Actions Row ───────────────────────────────────────────────────── */

.ai-actions-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
    padding: 0 7px;
}
