/**
 * WP AI Agent Pro - Scoped Shadow DOM Widget Styles
 * Built with state-of-the-art aesthetics, micro-interactions, dark/light modes, and RTL support.
 */

:host {
    --ai-primary: #2563eb;
    --ai-primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --ai-primary-hover: #1d4ed8;
    --ai-primary-light: #eff6ff;
    --ai-accent: #10b981;
    --ai-warning: #f59e0b;
    --ai-danger: #ef4444;
    --ai-bg: #ffffff;
    --ai-surface: #f8fafc;
    --ai-surface-hover: #f1f5f9;
    --ai-border: #e2e8f0;
    --ai-text-main: #0f172a;
    --ai-text-muted: #64748b;
    --ai-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Cairo", "Noto Sans Arabic", sans-serif;
    --ai-radius-lg: 20px;
    --ai-radius-md: 14px;
    --ai-radius-sm: 8px;
    --ai-shadow-window: 0 20px 40px -10px rgba(15, 23, 42, 0.18), 0 0 1px 1px rgba(15, 23, 42, 0.05);
    --ai-shadow-card: 0 4px 12px -2px rgba(15, 23, 42, 0.08);

    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: var(--ai-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ai-text-main);
    box-sizing: border-box;
}

:host([data-theme="dark"]) {
    --ai-bg: #0f172a;
    --ai-surface: #1e293b;
    --ai-surface-hover: #334155;
    --ai-border: #334155;
    --ai-text-main: #f8fafc;
    --ai-text-muted: #94a3b8;
    --ai-primary-light: rgba(37, 99, 235, 0.15);
    --ai-shadow-window: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

:host([mode="playground"]), :host([embedded]) {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 1 !important;
    bottom: auto !important;
    right: auto !important;
}

:host([mode="playground"]) .ai-launcher,
:host([embedded]) .ai-launcher {
    display: none !important;
}

:host([mode="playground"]) .ai-chat-window,
:host([embedded]) .ai-chat-window {
    position: static !important;
    width: 100% !important;
    height: 600px !important;
    max-height: 600px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Launcher Floating Button */
.ai-launcher {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: var(--ai-primary-gradient);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    outline: none;
}

.ai-launcher:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 14px 28px -5px rgba(37, 99, 235, 0.5);
}

.ai-launcher:active {
    transform: scale(0.96);
}

.ai-launcher svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.ai-launcher.active svg.chat-icon {
    display: none;
}

.ai-launcher.active svg.close-icon {
    display: block;
}

.ai-launcher svg.close-icon {
    display: none;
}

/* Online status pulse dot */
.ai-pulse-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ai-accent);
    border: 2px solid var(--ai-bg);
}

.ai-pulse-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ai-accent);
    opacity: 0.75;
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Chat Window Frame */
.ai-chat-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 400px;
    height: 620px;
    max-height: calc(100vh - 110px);
    background: var(--ai-bg);
    border-radius: var(--ai-radius-lg);
    border: 1px solid var(--ai-border);
    box-shadow: var(--ai-shadow-window);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.ai-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.ai-header {
    padding: 16px 20px;
    background: var(--ai-surface);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ai-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ai-primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.ai-header-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--ai-text-main);
    display: flex;
    flex-direction: column;
}

.ai-header-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--ai-accent);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-header-subtitle::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-accent);
}

.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--ai-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-btn-icon:hover {
    background: var(--ai-surface-hover);
    color: var(--ai-text-main);
}

/* Messages Scroll Area */
.ai-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.ai-messages-container::-webkit-scrollbar {
    width: 5px;
}

.ai-messages-container::-webkit-scrollbar-thumb {
    background: var(--ai-border);
    border-radius: 10px;
}

/* Message Rows & Bubbles */
.ai-message {
    display: flex;
    flex-direction: column;
    max-width: 86%;
    animation: ai-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ai-slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-message.user {
    align-self: flex-end;
}

.ai-message.assistant {
    align-self: flex-start;
}

.ai-bubble {
    padding: 12px 16px;
    border-radius: var(--ai-radius-md);
    position: relative;
    word-break: break-word;
}

.ai-message.user .ai-bubble {
    background: var(--ai-primary-gradient);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.ai-message.assistant .ai-bubble {
    background: var(--ai-surface);
    color: var(--ai-text-main);
    border: 1px solid var(--ai-border);
    border-bottom-left-radius: 4px;
}

/* RTL Support */
.ai-rtl {
    direction: rtl;
    text-align: right;
}

.ai-rtl .ai-message.user {
    align-self: flex-start;
}

.ai-rtl .ai-message.assistant {
    align-self: flex-end;
}

.ai-rtl .ai-message.user .ai-bubble {
    border-bottom-right-radius: var(--ai-radius-md);
    border-bottom-left-radius: 4px;
}

.ai-rtl .ai-message.assistant .ai-bubble {
    border-bottom-left-radius: var(--ai-radius-md);
    border-bottom-right-radius: 4px;
}

/* Markdown styling inside bubbles */
.ai-bubble p { margin: 0 0 8px 0; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble strong { font-weight: 600; }
.ai-bubble code {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}
.ai-message.user .ai-bubble code {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}
.ai-bubble pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin: 8px 0;
}

/* Typing / Streaming Cursor */
.ai-cursor {
    display: inline-block;
    width: 6px;
    height: 15px;
    background: var(--ai-primary);
    margin-left: 2px;
    animation: ai-blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes ai-blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Interactive Cards */
.ai-card-deck {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.ai-card-deck.ai-carousel {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding: 4px 4px 10px 4px;
    -webkit-overflow-scrolling: touch;
}

.ai-card-deck.ai-carousel::-webkit-scrollbar {
    height: 6px;
}

.ai-card-deck.ai-carousel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
}

.ai-card-deck.ai-carousel::-webkit-scrollbar-thumb {
    background: var(--ai-border);
    border-radius: 4px;
}

/* Carousel Wrapper with Floating Navigation Buttons */
.ai-carousel-wrap {
    position: relative;
    width: 100%;
}

.ai-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 22px;
    line-height: 1;
    color: #1e293b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}

.ai-carousel-nav.prev {
    left: -6px;
}

.ai-carousel-nav.next {
    right: -6px;
}

.ai-carousel-nav:hover {
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
    color: var(--ai-primary);
}

:host([data-theme="dark"]) .ai-carousel-nav {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

:host([data-theme="dark"]) .ai-carousel-nav:hover {
    background: #1e293b;
    color: #60a5fa;
}

/* Category Archive Ending Card */
.ai-archive-card {
    min-width: 180px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.12) 100%) !important;
    border: 1px dashed rgba(37, 99, 235, 0.4) !important;
    border-radius: var(--ai-radius-md);
    padding: 16px 12px;
}

.ai-archive-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ai-primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.ai-archive-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ai-text-main);
    margin-bottom: 6px;
    line-height: 1.3;
}

.ai-archive-desc {
    font-size: 11px;
    color: var(--ai-text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.ai-btn-view-all {
    display: inline-block;
    background: var(--ai-primary-gradient);
    color: #ffffff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.ai-btn-view-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
    color: #ffffff;
}

/* Variant Pill Pulse Animation */
.ai-pill-pulse {
    animation: aiPulseRing 1.2s infinite;
}

@keyframes aiPulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
        border-color: var(--ai-primary);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* Product Card */
.ai-product-card {
    background: var(--ai-bg);
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius-md);
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: var(--ai-shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-card-deck.ai-carousel .ai-product-card {
    min-width: 200px;
    max-width: 220px;
    flex-shrink: 0;
    scroll-snap-align: start;
    flex-direction: column;
    padding: 10px;
}

.ai-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -4px rgba(15, 23, 42, 0.12);
}

.ai-prod-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--ai-radius-sm);
    object-fit: cover;
    background: var(--ai-surface);
}

.ai-card-deck.ai-carousel .ai-prod-thumb {
    width: 100%;
    height: 120px;
    border-radius: var(--ai-radius-sm);
    object-fit: cover;
}

.ai-prod-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--ai-surface);
}

.ai-prod-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ai-prod-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--ai-text-main);
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-prod-title:hover {
    color: var(--ai-primary);
}

.ai-prod-pricing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 6px;
}

.ai-prod-price {
    font-weight: 700;
    color: var(--ai-primary);
    font-size: 14px;
}

.ai-stock-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.ai-stock-badge.in-stock {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.ai-stock-badge.out-stock {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.ai-prod-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.ai-btn-cart {
    flex: 1;
    background: var(--ai-primary);
    color: #ffffff;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    white-space: nowrap;
}

.ai-btn-cart:hover {
    background: var(--ai-primary-hover);
}

.ai-btn-buy {
    flex: 1;
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    transition: background 0.2s;
    white-space: nowrap;
}

.ai-btn-buy:hover {
    background: #059669;
    color: #ffffff;
}

/* Interactive Size / Variation Pills */
.ai-size-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0 8px 0;
}

.ai-size-pill {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--ai-border);
    background: var(--ai-surface);
    color: var(--ai-text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    line-height: 1.2;
}

.ai-size-pill:hover:not(:disabled) {
    border-color: var(--ai-primary);
    background: var(--ai-primary-light);
    color: var(--ai-primary);
}

.ai-size-pill.active {
    background: var(--ai-primary);
    border-color: var(--ai-primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.ai-size-pill.out-of-stock,
.ai-size-pill:disabled {
    opacity: 0.45;
    text-decoration: line-through;
    cursor: not-allowed;
    background: transparent;
    border-color: var(--ai-border);
}

/* Dynamic Quantity Stepper */
.ai-qty-stepper {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ai-surface);
    border: 1px solid var(--ai-primary);
    border-radius: 6px;
    height: 28px;
    padding: 2px 4px;
    box-sizing: border-box;
}

.ai-qty-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: var(--ai-primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
    padding: 0;
    outline: none;
}

.ai-qty-btn:hover {
    background: var(--ai-primary-hover);
    transform: scale(1.05);
}

.ai-qty-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--ai-text-main);
    padding: 0 6px;
    user-select: none;
}

/* Responsive Modern Tables & Badges */
.ai-table-wrapper {
    overflow-x: auto;
    max-inline-size: 100%;
    margin: 10px 0;
    border-radius: var(--ai-radius-sm);
    border: 1px solid var(--ai-border);
    background: var(--ai-surface);
    container-type: inline-size;
}

.ai-chat-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    text-align: left;
}

:host([dir="rtl"]) .ai-chat-table,
.ai-rtl .ai-chat-table {
    text-align: right;
}

.ai-chat-table thead {
    background: rgba(37, 99, 235, 0.08);
    position: sticky;
    top: 0;
    z-index: 1;
}

.ai-chat-table th {
    padding: 8px 10px;
    font-weight: 600;
    color: var(--ai-text-main);
    border-bottom: 1px solid var(--ai-border);
    white-space: nowrap;
}

.ai-chat-table td {
    padding: 8px 10px;
    color: var(--ai-text-main);
    border-bottom: 1px solid var(--ai-border);
    vertical-align: middle;
}

.ai-chat-table tr:last-child td {
    border-bottom: none;
}

.ai-chat-table tr:hover {
    background: var(--ai-surface-hover);
}

.ai-badge-stopdesk {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

.ai-badge-domicile {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

/* Order Status Card */
.ai-order-card {
    background: var(--ai-bg);
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius-md);
    padding: 14px;
    box-shadow: var(--ai-shadow-card);
}

.ai-timeline {
    display: flex;
    justify-content: space-between;
    margin: 14px 0 6px 0;
    position: relative;
}

.ai-timeline::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--ai-border);
    z-index: 1;
}

.ai-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--ai-text-muted);
}

.ai-step-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ai-bg);
    border: 2px solid var(--ai-border);
    margin-bottom: 4px;
}

.ai-step.active .ai-step-circle {
    border-color: var(--ai-accent);
    background: var(--ai-accent);
}

.ai-step.active {
    color: var(--ai-text-main);
    font-weight: 600;
}

/* Lead & Escalation Card */
.ai-lead-card {
    background: var(--ai-primary-light);
    border: 1px solid var(--ai-primary);
    border-radius: var(--ai-radius-md);
    padding: 14px;
    margin-top: 10px;
}

.ai-lead-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--ai-border);
    border-radius: 6px;
    margin: 8px 0;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background: var(--ai-bg);
    color: var(--ai-text-main);
}

.ai-lead-input:focus {
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Suggested Chips */
.ai-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ai-chip {
    background: var(--ai-surface);
    border: 1px solid var(--ai-border);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    color: var(--ai-text-main);
    transition: all 0.2s;
}

.ai-chip:hover {
    background: var(--ai-primary);
    color: #ffffff;
    border-color: var(--ai-primary);
}

/* Footer & Input Bar */
.ai-footer {
    padding: 14px 16px;
    background: var(--ai-bg);
    border-top: 1px solid var(--ai-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.ai-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ai-border);
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    background: var(--ai-surface);
    color: var(--ai-text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-input:focus {
    border-color: var(--ai-primary);
    background: var(--ai-bg);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ai-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ai-primary-gradient);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    outline: none;
}

.ai-send-btn:hover {
    transform: scale(1.05);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Screen Layout */
@media (max-width: 640px) {
    :host {
        bottom: 16px;
        right: 16px;
    }
    .ai-chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
}
