/**
 * AI Chat Widget Styles
 * A floating chat widget for customer support functionality
 */

/* ========== CSS Variables ========== */
/* 使用主题的品牌色系统，继承自 main.css */
:root {
    --ai-chat-primary: var(--color-primary, hsl(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%)));
    --ai-chat-primary-hover: var(--color-primary-hover, hsl(var(--theme-h, 220), var(--theme-s, 85%), 42%));
    --ai-chat-primary-light: var(--color-primary-light, hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.1));
    --ai-chat-bg: #ffffff;
    --ai-chat-bg-secondary: #f9fafb;
    --ai-chat-text: #111827;
    --ai-chat-text-muted: #6b7280;
    --ai-chat-border: #e5e7eb;
    --ai-chat-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    --ai-chat-radius: 16px;
    --ai-chat-btn-size: 60px;
    --ai-chat-z-index: 9999;
}

[data-theme="dark"] {
    --ai-chat-primary: var(--color-primary, hsl(var(--theme-h, 220), var(--theme-s, 85%), 62%));
    --ai-chat-primary-hover: var(--color-primary-hover, hsl(var(--theme-h, 220), var(--theme-s, 85%), 54%));
    --ai-chat-primary-light: var(--color-primary-light, hsla(var(--theme-h, 220), var(--theme-s, 85%), 60%, 0.15));
    --ai-chat-bg: #1f2937;
    --ai-chat-bg-secondary: #111827;
    --ai-chat-text: #f9fafb;
    --ai-chat-text-muted: #9ca3af;
    --ai-chat-border: #374151;
    --ai-chat-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.4);
}

/* ========== Widget Container ========== */
.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--ai-chat-z-index);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Transition for smooth position changes when not dragging */
    transition: bottom 0.1s ease, right 0.1s ease, top 0.1s ease, left 0.1s ease;
}

.ai-chat-widget.dragging {
    transition: none;
}

/* ========== Toggle Button ========== */
.ai-chat-toggle {
    width: var(--ai-chat-btn-size);
    height: var(--ai-chat-btn-size);
    border-radius: 50%;
    /* 使用品牌色渐变 */
    background: linear-gradient(
        135deg,
        var(--ai-chat-primary) 0%,
        hsl(var(--theme-h, 220), calc(var(--theme-s, 85%) * 0.9), calc(var(--theme-l, 50%) - 8%)) 100%
    );
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 使用品牌色阴影 */
    box-shadow:
        0 4px 20px hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.4),
        0 0 0 0 hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: chat-btn-pulse 3s infinite;
}

@keyframes chat-btn-pulse {
    0%, 100% {
        box-shadow:
            0 4px 20px hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.4),
            0 0 0 0 hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.3);
    }
    50% {
        box-shadow:
            0 4px 20px hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.5),
            0 0 0 8px hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0);
    }
}

.ai-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow:
        0 6px 25px hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.5),
        0 0 0 4px hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.15);
    animation: none;
}

.ai-chat-toggle svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

/* ========== Drag Handle ========== */
.ai-chat-drag-handle {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.ai-chat-drag-handle svg {
    width: 12px;
    height: 12px;
    color: #ffffff;
}

.ai-chat-toggle:hover .ai-chat-drag-handle,
.ai-chat-drag-handle:hover {
    opacity: 1;
    transform: scale(1);
}

.ai-chat-drag-handle:active {
    cursor: grabbing;
    background: rgba(0, 0, 0, 0.8);
}

/* Dragging state */
.ai-chat-widget.dragging .ai-chat-drag-handle {
    opacity: 1;
    transform: scale(1);
    cursor: grabbing;
}

.ai-chat-widget.dragging .ai-chat-toggle {
    animation: none;
}

.ai-chat-toggle .ai-chat-icon-close {
    display: none;
}

.ai-chat-widget.open .ai-chat-toggle .ai-chat-icon-open {
    display: none;
}

.ai-chat-widget.open .ai-chat-toggle .ai-chat-icon-close {
    display: block;
}

/* 打开状态时停止脉冲动画 */
.ai-chat-widget.open .ai-chat-toggle {
    animation: none;
}

/* ========== Chat Window ========== */
.ai-chat-window {
    position: absolute;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 560px;
    max-height: calc(100vh - 140px);
    background: var(--ai-chat-bg);
    border-radius: var(--ai-chat-radius);
    box-shadow: var(--ai-chat-shadow);
    border: 1px solid var(--ai-chat-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* Position window based on widget position */
.ai-chat-widget[data-position="bottom-right"] .ai-chat-window,
.ai-chat-widget:not([data-position]) .ai-chat-window {
    bottom: calc(var(--ai-chat-btn-size) + 16px);
    right: 0;
}

.ai-chat-widget[data-position="bottom-left"] .ai-chat-window {
    bottom: calc(var(--ai-chat-btn-size) + 16px);
    left: 0;
}

.ai-chat-widget[data-position="top-right"] .ai-chat-window {
    top: calc(var(--ai-chat-btn-size) + 16px);
    right: 0;
}

.ai-chat-widget[data-position="top-left"] .ai-chat-window {
    top: calc(var(--ai-chat-btn-size) + 16px);
    left: 0;
}

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

/* ========== Resize Handle ========== */
.ai-chat-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    z-index: 10;
    border-radius: var(--ai-chat-radius) 0 0 0;
}

.ai-chat-resize-handle::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 8px;
    height: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.6);
    border-top: 2px solid rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: opacity 0.2s;
}

.ai-chat-resize-handle:hover::before,
.ai-chat-resize-handle:active::before {
    opacity: 1;
}

/* Show resize indicator on window hover */
.ai-chat-window:hover .ai-chat-resize-handle::before {
    opacity: 0.5;
}

.ai-chat-resize-handle:hover::before {
    opacity: 1 !important;
}

/* ========== Header ========== */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    /* 使用品牌色渐变 */
    background: linear-gradient(
        135deg,
        var(--ai-chat-primary) 0%,
        hsl(var(--theme-h, 220), calc(var(--theme-s, 85%) * 0.9), calc(var(--theme-l, 50%) - 8%)) 100%
    );
    color: #ffffff;
}

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

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-avatar svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

.ai-chat-header-text {
    display: flex;
    flex-direction: column;
}

.ai-chat-title {
    font-size: 16px;
    font-weight: 600;
}

.ai-chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chat-status .status-online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.ai-chat-status .status-typing {
    animation: typingPulse 1.5s ease-in-out infinite;
}

.ai-chat-status .status-typing::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    animation: typingDot 1s ease-in-out infinite;
}

@keyframes typingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes typingDot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

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

.ai-chat-clear,
.ai-chat-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-clear:hover,
.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ai-chat-clear svg,
.ai-chat-close svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.ai-chat-clear:active,
.ai-chat-close:active {
    transform: scale(0.95);
}

/* ========== Messages Container ========== */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

/* ========== Message Bubbles ========== */
.ai-chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.ai-chat-message.ai,
.ai-chat-message.human {
    align-self: flex-start;
}

.ai-chat-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-chat-message.user .ai-chat-message-content {
    background: var(--ai-chat-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ai-chat-message.ai .ai-chat-message-content,
.ai-chat-message.human .ai-chat-message-content {
    background: var(--ai-chat-bg-secondary);
    color: var(--ai-chat-text);
    border-bottom-left-radius: 4px;
}

.ai-chat-message-time {
    font-size: 11px;
    color: var(--ai-chat-text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chat-message.user .ai-chat-message-time {
    justify-content: flex-end;
}

/* Message read status indicator - Telegram style */
.ai-chat-message-status {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}

.ai-chat-message-status svg {
    width: 16px;
    height: 11px;
}

/* Sent - single check (gray) */
.ai-chat-message-status.sent svg {
    color: rgba(255, 255, 255, 0.5);
}

/* Read - double check (blue/brand color) */
.ai-chat-message-status.read svg {
    color: #34b7f1;
}

/* Read status animation */
.ai-chat-message-status.read svg {
    animation: checkAppear 0.2s ease-out;
}

@keyframes checkAppear {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* ========== Sources ========== */
.ai-chat-sources {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--ai-chat-bg);
    border: 1px solid var(--ai-chat-border);
    border-radius: 8px;
    font-size: 12px;
}

.ai-chat-sources-title {
    color: var(--ai-chat-text-muted);
    margin-bottom: 4px;
}

.ai-chat-source-link {
    color: var(--ai-chat-primary);
    text-decoration: none;
    display: block;
    padding: 2px 0;
}

.ai-chat-source-link:hover {
    text-decoration: underline;
}

/* ========== Typing Indicator ========== */
.ai-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 20px 12px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--ai-chat-text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* ========== Input Area ========== */
.ai-chat-input-area {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--ai-chat-border);
    background: var(--ai-chat-bg);
}

.ai-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--ai-chat-bg-secondary);
    border: 1px solid var(--ai-chat-border);
    border-radius: 12px;
    padding: 8px 12px;
    transition: border-color 0.2s;
}

.ai-chat-form:focus-within {
    border-color: var(--ai-chat-primary);
}

.ai-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--ai-chat-text);
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    padding: 4px 0;
}

.ai-chat-input::placeholder {
    color: var(--ai-chat-text-muted);
}

.ai-chat-input:focus {
    outline: none;
}

.ai-chat-send {
    width: 36px;
    height: 36px;
    background: var(--ai-chat-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

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

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

.ai-chat-send svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.ai-chat-powered {
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--ai-chat-text-muted);
}

/* ========== Welcome Message ========== */
.ai-chat-welcome {
    text-align: center;
    padding: 20px;
}

.ai-chat-welcome-icon {
    width: 64px;
    height: 64px;
    /* 使用品牌色渐变 */
    background: linear-gradient(
        135deg,
        var(--ai-chat-primary) 0%,
        hsl(var(--theme-h, 220), calc(var(--theme-s, 85%) * 0.9), calc(var(--theme-l, 50%) - 8%)) 100%
    );
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.ai-chat-welcome-icon svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.ai-chat-welcome-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-chat-text);
    margin-bottom: 8px;
}

.ai-chat-welcome-text {
    font-size: 14px;
    color: var(--ai-chat-text-muted);
    line-height: 1.5;
}

/* ========== Mobile Responsive ========== */
@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 16px !important;
        right: 16px !important;
        top: auto !important;
        left: auto !important;
    }

    .ai-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        /* Reset position for mobile */
        bottom: calc(var(--ai-chat-btn-size) + 12px) !important;
        right: 0 !important;
        top: auto !important;
        left: auto !important;
    }

    .ai-chat-toggle {
        width: 52px;
        height: 52px;
    }

    .ai-chat-toggle svg {
        width: 24px;
        height: 24px;
    }

    /* Hide drag handle on mobile */
    .ai-chat-drag-handle {
        display: none !important;
    }
}

/* ========== Markdown Support ========== */
.ai-chat-message-content p {
    margin: 0 0 8px;
}

.ai-chat-message-content p:last-child {
    margin-bottom: 0;
}

.ai-chat-message-content ul,
.ai-chat-message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-chat-message-content li {
    margin: 4px 0;
}

.ai-chat-message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, monospace;
}

.ai-chat-message.user .ai-chat-message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.ai-chat-message-content pre {
    background: rgba(0, 0, 0, 0.1);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.ai-chat-message-content pre code {
    background: transparent;
    padding: 0;
}

/* ========== Compaction Notice ========== */
.ai-chat-compaction-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    font-size: 12px;
    color: var(--ai-chat-text-muted);
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-compaction-notice svg {
    flex-shrink: 0;
    color: var(--ai-chat-primary);
    opacity: 0.8;
}

.ai-chat-compaction-notice span {
    flex: 1;
}

.ai-chat-compaction-notice .compaction-time {
    flex: none;
    font-size: 11px;
    opacity: 0.7;
}

[data-theme="dark"] .ai-chat-compaction-notice {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(129, 140, 248, 0.25);
}

/* ========== Escalation Prompt ========== */
.ai-chat-escalation-prompt {
    padding: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(251, 191, 36, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    margin: 8px 16px;
    animation: fadeIn 0.3s ease;
}

.escalation-prompt-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.escalation-prompt-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.escalation-prompt-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.escalation-prompt-text {
    text-align: center;
}

.escalation-prompt-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ai-chat-text);
    margin: 0 0 6px 0;
}

.escalation-prompt-desc {
    font-size: 13px;
    color: var(--ai-chat-text-muted);
    margin: 0;
    line-height: 1.5;
}

.escalation-prompt-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 4px;
}

.escalation-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.escalation-btn-primary {
    /* 使用品牌色渐变 */
    background: linear-gradient(
        135deg,
        var(--ai-chat-primary) 0%,
        hsl(var(--theme-h, 220), calc(var(--theme-s, 85%) * 0.9), calc(var(--theme-l, 50%) - 8%)) 100%
    );
    color: white;
}

.escalation-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px hsla(var(--theme-h, 220), var(--theme-s, 85%), var(--theme-l, 50%), 0.3);
}

.escalation-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.escalation-btn-secondary {
    background: var(--ai-chat-message-ai);
    color: var(--ai-chat-text);
    border: 1px solid var(--ai-chat-border);
}

.escalation-btn-secondary:hover {
    background: var(--ai-chat-bg-hover);
}

/* ========== Contact Form ========== */
.ai-chat-contact-form {
    padding: 16px;
    background: var(--ai-chat-bg);
    border: 1px solid var(--ai-chat-border);
    border-radius: 12px;
    margin: 8px 16px;
    animation: fadeIn 0.3s ease;
}

.contact-form-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-form-header {
    text-align: center;
}

.contact-form-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ai-chat-text);
    margin: 0 0 6px 0;
}

.contact-form-desc {
    font-size: 13px;
    color: var(--ai-chat-text-muted);
    margin: 0;
}

.contact-form-hint {
    font-size: 12px;
    color: var(--ai-chat-text-muted);
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
    border-left: 3px solid var(--ai-chat-primary);
    margin-top: 4px;
}

.contact-form-hint span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.contact-form-hint span::before {
    content: "💡";
    font-size: 11px;
}

[data-theme="dark"] .contact-form-hint {
    background: rgba(59, 130, 246, 0.12);
}

.contact-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-form-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ai-chat-text);
}

.contact-form-field label .required {
    color: #ef4444;
}

.contact-form-field input {
    padding: 10px 12px;
    border: 1px solid var(--ai-chat-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--ai-chat-text);
    background: var(--ai-chat-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form-field input:focus {
    outline: none;
    border-color: var(--ai-chat-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.contact-form-field input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.contact-form-field input::placeholder {
    color: var(--ai-chat-text-muted);
    opacity: 0.7;
}

.contact-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

/* Dark mode adjustments */
[data-theme="dark"] .ai-chat-escalation-prompt {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.12));
    border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .ai-chat-contact-form {
    background: var(--ai-chat-bg);
}

[data-theme="dark"] .contact-form-field input {
    background: rgba(255, 255, 255, 0.05);
}
