/* 
   ✨ AssistMe AI - Elite AI Assistant
   Design System: Glassmorphism 4.0, Neural Gradients, Next-Gen UI
*/

:root {
    /* Premium Palette - Neural Glassmorphism 4.0 */
    --ai-bg-light: rgba(255, 255, 255, 0.85);
    --ai-bg-dark: rgba(18, 18, 20, 0.92);
    --ai-accent: #0071e3;
    --ai-accent-gradient: linear-gradient(135deg, #0071e3, #2997ff, #0a84ff);
    --ai-neural-glow: linear-gradient(270deg, #0071e3, #5ac8fa, #34c759, #af52de, #ff2d55, #0071e3);
    --ai-text-light: #1d1d1f;
    --ai-text-dark: #f5f5f7;
    --ai-border-light: rgba(0, 0, 0, 0.08);
    --ai-border-dark: rgba(255, 255, 255, 0.15);

    /* Typography - Using Inter for modern, readable text */
    --ai-font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --ai-font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;

    /* Font Sizes - EXACTLY Matching Mobile's Clean Typography */
    --ai-fs-title: 1.25rem;
    /* 20px - header */
    --ai-fs-body-lg: 1rem;
    /* 16px - main message text (same as mobile) */
    --ai-fs-body: 0.9375rem;
    /* 15px - secondary text */
    --ai-fs-small: 0.875rem;
    /* 14px - meta info */
    --ai-fs-chip: 0.8125rem;
    /* 13px - chips/badges */


    --ai-shadow-premium: 0 30px 60px -12px rgba(0, 0, 0, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
    /* Neural Network Gradient - Signature Style */
    --ai-gradient: linear-gradient(135deg, #0071e3 0%, #005bb5 50%, #003d7a 100%);
    --ai-glow: linear-gradient(135deg, #007AFF 0%, #00C7FF 25%, #34C759 50%, #FFCC00 75%, #FF3B30 100%);
    --ai-primary: #007aff;

    /* Enhanced Theme Colors */
    --ai-success: #34c759;
    --ai-warning: #ff9500;
    --ai-error: #ff3b30;
    --ai-info: #5ac8fa;
}

/* ═══════════════════════════════════════════════════════════
   WIDGET CONTAINER - PREMIUM GLASSMORPHISM
   ═══════════════════════════════════════════════════════════ */
#chatbot-widget {
    position: fixed;
    bottom: 120px;
    right: 24px;
    width: 420px;
    height: 700px;
    max-height: calc(100vh - 160px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    background: var(--ai-bg-light);
    backdrop-filter: blur(50px) saturate(220%);
    -webkit-backdrop-filter: blur(50px) saturate(220%);
    border-radius: 32px;
    border: 1.5px solid var(--ai-border-light);
    box-shadow: var(--ai-shadow-premium),
        0 0 0 1px rgb(255 255 255 / 40%) inset;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.92) translateY(30px) rotate(-2deg);
    pointer-events: none;
    transition: all 0.65s cubic-bezier(0.19, 1, 0.22, 1);
    font-family: var(--ai-font);
    transform-origin: bottom right;
}

html.dark #chatbot-widget {
    background: var(--ai-bg-dark);
    border-color: var(--ai-border-dark);
    box-shadow: 0 30px 60px rgb(0 0 0 / 60%),
        0 8px 32px rgb(0 0 0 / 40%),
        0 0 0 1px rgb(255 255 255 / 8%) inset;
}

#chatbot-widget.visible {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0);
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════
   HEADER - GEMINI INTELLIGENCE GLOW (ENHANCED)
   ═══════════════════════════════════════════════════════════ */
.chatbot-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgb(0 0 0 / 6%);
    background: linear-gradient(to bottom, rgb(255 255 255 / 60%), transparent),
        linear-gradient(135deg, rgba(0, 113, 227, 0.03), rgba(41, 151, 255, 0.03));
    backdrop-filter: blur(20px);
}

html.dark .chatbot-header {
    border-bottom: 1px solid rgb(255 255 255 / 8%);
    background: linear-gradient(to bottom, rgb(0 0 0 / 30%), transparent),
        linear-gradient(135deg, rgba(10, 132, 255, 0.08), rgba(41, 151, 255, 0.05));
}

.chatbot-title {
    font-size: 22px;
    font-weight: 700;
    background: var(--ai-glow);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 0 12px rgb(46 136 249 / 25%));
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        filter: drop-shadow(0 0 12px rgb(46 136 249 / 25%));
    }

    50% {
        filter: drop-shadow(0 0 18px rgb(46 136 249 / 35%));
    }
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-settings-btn,
.chatbot-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgb(0 0 0 / 5%);
    border: none;
    color: var(--ai-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

html.dark .chatbot-settings-btn,
html.dark .chatbot-close-btn {
    background: rgb(255 255 255 / 10%);
    color: #fff;
}

.chatbot-settings-btn:hover {
    background: rgba(0, 113, 227, 0.15);
    color: #0071e3;
    transform: scale(1.05);
}

html.dark .chatbot-settings-btn:hover {
    background: rgba(41, 151, 255, 0.2);
    color: #2997ff;
}

.chatbot-close-btn:hover {
    background: rgb(0 0 0 / 10%);
    transform: rotate(90deg);
}

html.dark .chatbot-close-btn:hover {
    background: rgb(255 255 255 / 20%);
}

/* ═══════════════════════════════════════════════════════════
   TYPING INDICATOR
   ═══════════════════════════════════════════════════════════ */
.typing-indicator {
    padding: 16px 20px;
    background: rgb(255 255 255 / 70%);
    border-radius: 22px;
    display: inline-flex;
    gap: 6px;
    align-self: flex-start;
    border: 1px solid rgb(255 255 255 / 50%);
    margin-bottom: 8px;
    box-shadow: 0 2px 10px rgb(0 0 0 / 3%);
    backdrop-filter: blur(10px);
}

html.dark .typing-indicator {
    background: rgb(40 40 45 / 70%);
    border: 1px solid rgb(255 255 255 / 10%);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgb(0 0 0 / 40%);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

html.dark .typing-dot {
    background: rgb(255 255 255 / 40%);
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════
   SUGGESTION CHIPS - PREMIUM
   ═══════════════════════════════════════════════════════════ */
.suggested-prompts-container {
    padding: 0 24px 16px;
    animation: fadeIn 0.5s ease-out;
}

.suggested-prompts-label {
    font-size: 13px;
    color: rgb(0 0 0 / 50%);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

html.dark .suggested-prompts-label {
    color: rgb(255 255 255 / 50%);
}

.suggested-prompts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggested-prompt-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(0, 113, 227, 0.15);
    padding: 12px 18px;
    border-radius: 22px;
    font-size: 14px;
    color: var(--ai-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    font-family: var(--ai-font);
    font-weight: 500;
}

html.dark .suggested-prompt-btn {
    background: rgba(40, 40, 45, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: var(--ai-text-dark);
}

.suggested-prompt-btn:hover {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.08), rgba(41, 151, 255, 0.08));
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.15);
    border-color: rgba(0, 113, 227, 0.3);
}

html.dark .suggested-prompt-btn:hover {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.15), rgba(41, 151, 255, 0.12));
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.25);
    border-color: rgba(10, 132, 255, 0.35);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════
   MESSAGES AREA - ENHANCED WITH CUSTOM SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar Styling */
#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    transition: background 0.3s;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

html.dark #chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

html.dark #chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ═══════════════════════════════════════════════════════════
   BUBBLES - iMESSAGE STYLE
   ═══════════════════════════════════════════════════════════ */
.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: msgPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes msgPop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Assistant */
.assistant-message {
    align-self: flex-start;
}

/* Welcome Message Specifics */
.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.welcome-chip {
    padding: 4px 10px;
    background: var(--ai-accent-gradient);
    color: white;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 8px;
    letter-spacing: 0.05em;
}

.welcome-status {
    font-size: 11px;
    color: #34c759;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.welcome-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #34c759;
    border-radius: 50%;
    box-shadow: 0 0 8px #34c759;
}

.welcome-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--ai-accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 16px;
    line-height: 1.4;
}

.welcome-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.welcome-action-chip {
    padding: 10px 16px;
    background: rgba(0, 113, 227, 0.08);
    border: 1.5px solid rgba(0, 113, 227, 0.2);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #0071e3;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: neuralReveal 0.6s cubic-bezier(0.19, 1, 0.22, 1) backwards;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.welcome-action-chip:nth-child(1) {
    animation-delay: 0.8s;
}

.welcome-action-chip:nth-child(2) {
    animation-delay: 0.95s;
}

.welcome-action-chip:nth-child(3) {
    animation-delay: 1.1s;
}

.welcome-action-chip:nth-child(4) {
    animation-delay: 1.25s;
}

.welcome-action-chip:nth-child(5) {
    animation-delay: 1.4s;
}

/* Welcome Capabilities Grid */
.welcome-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.capability-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 113, 227, 0.06);
    border: 1px solid rgba(0, 113, 227, 0.12);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.5s ease-out backwards;
}

.capability-tag:nth-child(1) {
    animation-delay: 0.4s;
}

.capability-tag:nth-child(2) {
    animation-delay: 0.5s;
}

.capability-tag:nth-child(3) {
    animation-delay: 0.6s;
}

.capability-tag:nth-child(4) {
    animation-delay: 0.7s;
}

html.dark .capability-tag {
    background: rgba(41, 151, 255, 0.08);
    border-color: rgba(41, 151, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.welcome-action-chip:hover {
    background: linear-gradient(135deg, #0071e3 0%, #0051d5 100%);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.3), 0 2px 4px rgba(0, 113, 227, 0.2);
    border-color: transparent;
}

.welcome-action-chip:active {
    transform: translateY(-1px) scale(0.98);
}

html.dark .welcome-action-chip {
    background: rgba(41, 151, 255, 0.12);
    border-color: rgba(41, 151, 255, 0.25);
    color: #2997ff;
}

html.dark .welcome-action-chip:hover {
    background: linear-gradient(135deg, #0a84ff 0%, #0066cc 100%);
    color: white;
    border-color: transparent;
}

@keyframes neuralReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.assistant-message .message-content {
    background: rgba(255, 255, 255, 0.98);
    color: #1d1d1f;
    padding: 16px 18px;
    border-radius: 20px 20px 20px 6px;
    font-size: var(--ai-fs-body-lg);
    line-height: 1.6;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.assistant-message .message-content:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Neural Streaming Glow */
.assistant-message.streaming .message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ai-neural-glow);
    background-size: 600% 600%;
    animation: neuralFlow 3s linear infinite;
    opacity: 0.8;
}

@keyframes neuralFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

html.dark .assistant-message .message-content {
    background: rgba(44, 44, 46, 0.9);
    color: #f5f5f7;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);
}

html.dark .assistant-message .message-content:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* User */
.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 6px 18px;
    font-size: var(--ai-fs-body-lg);
    line-height: 1.6;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25), 0 4px 12px rgba(0, 122, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-message .message-content:hover {
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.45), 0 12px 32px rgba(0, 122, 255, 0.3);
    transform: translateY(-1px);
}

html.dark .user-message .message-content {
    background: linear-gradient(135deg, #0a84ff 0%, #0066cc 100%);
    box-shadow: 0 2px 12px rgba(10, 132, 255, 0.4), 0 8px 24px rgba(10, 132, 255, 0.25);
}

html.dark .user-message .message-content:hover {
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.5), 0 12px 32px rgba(10, 132, 255, 0.35);
}

/* ═══════════════════════════════════════════════════════════
   RENDERED MARKDOWN CONTENT - BEAUTIFUL TYPOGRAPHY
   ═══════════════════════════════════════════════════════════ */

/* Paragraphs */
.message-content p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

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

/* Headers */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    margin: 12px 0 6px 0;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child {
    margin-top: 0;
}

.message-content h2 {
    font-size: 1.1em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 4px;
}

html.dark .message-content h2 {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.message-content h3 {
    font-size: 1em;
}

.message-content h4 {
    font-size: 1em;
    color: rgba(0, 0, 0, 0.7);
}

html.dark .message-content h4 {
    color: rgba(255, 255, 255, 0.7);
}

/* Bold and italic */
.message-content strong,
.message-content b {
    font-weight: 700;
    color: inherit;
}

.message-content em,
.message-content i {
    font-style: italic;
}

/* Links */
.message-content a {
    color: #0071e3;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 113, 227, 0.3);
    transition: all 0.2s ease;
}

.message-content a:hover {
    color: #0051d5;
    border-bottom-color: #0051d5;
}

html.dark .message-content a {
    color: #2997ff;
    border-bottom-color: rgba(41, 151, 255, 0.3);
}

html.dark .message-content a:hover {
    color: #5ac8fa;
    border-bottom-color: #5ac8fa;
}

/* Lists */
.message-content ul,
.message-content ol {
    margin: 10px 0;
    padding-left: 22px;
}

.message-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.message-content li:last-child {
    margin-bottom: 0;
}

.message-content ul li {
    list-style-type: disc;
}

.message-content ol li {
    list-style-type: decimal;
}

/* Inline code */
.message-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9em;
    color: #c41a16;
}

html.dark .message-content code {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

/* Code blocks */
.message-content pre {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0;
    overflow-x: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

html.dark .message-content pre {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.message-content pre code {
    background: none;
    padding: 0;
    font-size: 13px;
    line-height: 1.5;
    color: inherit;
}

/* Blockquotes */
.message-content blockquote {
    margin: 12px 0;
    padding: 10px 16px;
    border-left: 4px solid rgba(0, 113, 227, 0.4);
    background: rgba(0, 113, 227, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: rgba(0, 0, 0, 0.75);
}

html.dark .message-content blockquote {
    border-left-color: rgba(41, 151, 255, 0.5);
    background: rgba(41, 151, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

/* Horizontal rules */
.message-content hr {
    border: none;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 16px 0;
}

html.dark .message-content hr {
    background: rgba(255, 255, 255, 0.15);
}

/* Tables */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.message-content th,
.message-content td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.message-content th {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.03);
}

html.dark .message-content th,
html.dark .message-content td {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html.dark .message-content th {
    background: rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════
   METADATA CHIPS - THEME AWARE
   ═══════════════════════════════════════════════════════════ */
.message-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: rgb(0 0 0 / 5%);
    color: #3c3c43;
    border: 1px solid rgb(0 0 0 / 8%);
    transition: all 0.2s;
}

html.dark .meta-chip {
    background: rgb(255 255 255 / 8%);
    color: #ebebf5;
    border: 1px solid rgb(255 255 255 / 12%);
}

.meta-chip-model {
    background: rgb(0 122 255 / 10%);
    color: #007aff;
    border-color: rgb(0 122 255 / 20%);
}

html.dark .meta-chip-model {
    background: rgb(10 132 255 / 15%);
    color: #0a84ff;
    border-color: rgb(10 132 255 / 25%);
}

.meta-chip-source {
    background: rgb(52 199 89 / 10%);
    color: #34c759;
    border-color: rgb(52 199 89 / 20%);
}

html.dark .meta-chip-source {
    background: rgb(48 209 88 / 15%);
    color: #30d158;
    border-color: rgb(48 209 88 / 25%);
}

.meta-chip-runtime,
.meta-chip-speed {
    background: rgb(255 149 0 / 10%);
    color: #ff9500;
    border-color: rgb(255 149 0 / 20%);
}

html.dark .meta-chip-runtime,
html.dark .meta-chip-speed {
    background: rgb(255 159 10 / 15%);
    color: #ff9f0a;
    border-color: rgb(255 159 10 / 25%);
}

.meta-chip-cost {
    background: rgb(255 45 85 / 10%);
    color: #ff2d55;
    border-color: rgb(255 45 85 / 20%);
}

html.dark .meta-chip-cost {
    background: rgb(255 55 95 / 15%);
    color: #ff375f;
    border-color: rgb(255 55 95 / 25%);
}

.meta-chip-confidence {
    background: rgb(90 200 250 / 10%);
    color: #5ac8fa;
    border-color: rgb(90 200 250 / 20%);
}

html.dark .meta-chip-confidence {
    background: rgb(100 210 255 / 15%);
    color: #64d2ff;
    border-color: rgb(100 210 255 / 25%);
}

/* ═══════════════════════════════════════════════════════════
   ACTION BUTTONS - THEME AWARE
   ═══════════════════════════════════════════════════════════ */
.message-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.msg-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgb(0 0 0 / 5%);
    color: #3c3c43;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

html.dark .msg-action-btn {
    background: rgb(255 255 255 / 8%);
    color: #ebebf5;
}

.msg-action-btn:hover {
    background: rgb(0 122 255 / 15%);
    color: #007aff;
    transform: scale(1.1);
}

html.dark .msg-action-btn:hover {
    background: rgb(10 132 255 / 20%);
    color: #0a84ff;
}

.msg-action-btn.success {
    background: rgb(52 199 89 / 15%);
    color: #34c759;
}

html.dark .msg-action-btn.success {
    background: rgb(48 209 88 / 20%);
    color: #30d158;
}

.msg-action-btn.speaking {
    background: rgb(255 149 0 / 15%);
    color: #ff9500;
    animation: pulse 1s infinite;
}

html.dark .msg-action-btn.speaking {
    background: rgb(255 159 10 / 20%);
    color: #ff9f0a;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════
   INPUT AREA - NEXT-GEN INTELLIGENCE DESIGN
   ═══════════════════════════════════════════════════════════ */

/* Container */
.chatbot-input-container {
    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    background: transparent;
    flex-shrink: 0;
    border-top: none;
}

/* Main Pill Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #FFF;
    border-radius: 42px;
    box-shadow: 0 4px 32px rgb(0 0 0 / 10%),
        0 2px 8px rgb(0 0 0 / 6%),
        0 0 0 1px rgb(0 0 0 / 4%) inset;
    border: 1.5px solid transparent;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html.dark .input-wrapper {
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 32px rgb(0 0 0 / 40%),
        0 2px 8px rgb(0 0 0 / 30%);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.input-wrapper:focus-within {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 40px rgb(0 122 255 / 20%),
        0 4px 16px rgb(0 122 255 / 15%),
        0 0 0 2px rgb(0 122 255 / 20%);
    border-color: rgba(0, 122, 255, 0.4);
}

html.dark .input-wrapper:focus-within {
    box-shadow: 0 8px 40px rgb(10 132 255 / 25%),
        0 4px 16px rgb(10 132 255 / 20%),
        0 0 0 2px rgb(10 132 255 / 25%);
    border-color: rgba(10, 132, 255, 0.5);
}

/* Voice Button (Left) - Enhanced Green Circle */
.chatbot-voice-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
    color: white;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.chatbot-voice-btn:hover {
    background: linear-gradient(135deg, #30D158 0%, #32D760 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

.chatbot-voice-btn:active {
    transform: scale(0.96);
}

/* Textarea (Center) - Enhanced */
#chatbot-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 8px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: #1D1D1F;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
}

html.dark #chatbot-input {
    color: #F5F5F7;
}

#chatbot-input::placeholder {
    color: #86868B;
    opacity: 0.8;
}

/* Send Button (Right) - Enhanced Blue Circle */
.chatbot-send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.chatbot-send-btn:hover {
    background: linear-gradient(135deg, #0051D5 0%, #0066FF 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.chatbot-send-btn:active {
    transform: scale(0.96);
}

/* Scrollbar Hiding */
#chatbot-input::-webkit-scrollbar {
    display: none;
}


/* ═══════════════════════════════════════════════════════════
   TOGGLE BUTTON - PREMIUM GLOWING ORB
   ═══════════════════════════════════════════════════════════ */
#chatbot-toggle {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 180deg at 50% 50%, #2E88F9 0deg, #F93B30 72deg, #F9D030 144deg, #30D158 216deg, #2E88F9 360deg);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 0 0 0 rgba(46, 136, 249, 0.4);
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9998;
    animation: orbSpin 12s linear infinite, orbPulse 3s ease-in-out infinite;
}

@keyframes orbSpin {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

@keyframes orbPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
            0 4px 16px rgba(0, 0, 0, 0.15),
            0 0 0 0 rgba(46, 136, 249, 0.4);
    }

    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25),
            0 4px 16px rgba(0, 0, 0, 0.2),
            0 0 0 12px rgba(46, 136, 249, 0);
    }
}

#chatbot-toggle:hover {
    transform: scale(1.15) rotate(8deg);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3),
        0 6px 24px rgba(0, 0, 0, 0.2),
        0 0 0 0 rgba(46, 136, 249, 0.6);
}

#chatbot-toggle:active {
    transform: scale(1.05) rotate(4deg);
}

#chatbot-toggle i {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

/* ═══════════════════════════════════════════════════════════
   ENHANCEMENTS - WELCOME MESSAGE & VOICE INPUT
   ═══════════════════════════════════════════════════════════ */

/* Welcome Message Styling */
.welcome-message .message-content {
    text-align: center;
    padding: 24px 20px !important;
}

.welcome-icon {
    font-size: 32px;
    margin-bottom: 12px;
    animation: welcomePulse 2s ease-in-out infinite;
}

@keyframes welcomePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.welcome-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html.dark .welcome-title {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 14px;
    color: #86868b;
    line-height: 1.4;
}

html.dark .welcome-subtitle {
    color: #a1a1a6;
}

/* Voice Button Active/Listening State */
.chatbot-voice-btn.listening {
    background: #FF3B30 !important;
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(255, 59, 48, 0);
    }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE STYLES MOVED TO src/assets/css/chatbot-mobile.css
   ═══════════════════════════════════════════════════════════ */

/* Tablet & Desktop Adjustments */
@media (min-width: 769px) {
    #chatbot-widget {
        width: 420px !important;
        height: 640px !important;
        /* Taller window to utilize available space */
        max-height: calc(100vh - 240px) !important;
        bottom: 168px !important;
        right: 24px !important;
        left: auto !important;
        top: auto !important;
        border-radius: 24px !important;
        box-shadow: 0 12px 50px rgba(0, 0, 0, 0.15) !important;
    }
}