/* Modern Chatbot Design System - Agriculture Theme */
:root {
    /* Rich Agricultural Color Palette - Field & Harvest Inspired */
    --chat-primary: #27a169; /* Vibrant crop green */
    --chat-primary-dark: #1e7a52;
    --chat-primary-light: #34c085;
    --chat-primary-glow: rgba(39, 161, 105, 0.45);
    
    /* Field & Crop Colors */
    --chat-field-green: #4a9b6a; /* Mature crop green */
    --chat-field-green-light: #6bb888;
    --chat-sprout-green: #7cb342; /* Young sprout */
    --chat-harvest-gold: #f5a623; /* Golden harvest */
    --chat-harvest-gold-light: #f7b84d;
    
    /* Agricultural Accent Colors */
    --chat-earth: #8b6914; /* Rich fertile soil */
    --chat-earth-light: #a6896b;
    --chat-sunshine: #ffb347; /* Warm sunshine */
    --chat-sunshine-light: #ffc870;
    --chat-sky: #5ba3d4; /* Clear agricultural sky */
    --chat-sky-light: #7bb8e0;
    --chat-wheat: #d4a574; /* Wheat field */
    
    --chat-secondary: #5ba3d4;
    --chat-accent: #ffb347;
    --chat-warning: #e67e22; /* Harvest warning */
    --chat-success: #27a169;
    
    /* Natural Neutral Colors - Field Inspired */
    --chat-bg: #f0f7f3; /* Soft field background */
    --chat-surface: #ffffff;
    --chat-surface-elevated: #f8fbf9;
    --chat-border: rgba(39, 161, 105, 0.18);
    --chat-border-strong: rgba(39, 161, 105, 0.35);
    
    --chat-text-primary: #1a3d2a; /* Deep field text */
    --chat-text-secondary: #3d5c4a;
    --chat-text-tertiary: #6b8577;
    --chat-text-inverse: #ffffff;
    
    /* Rich Agricultural Gradients - Field Patterns */
    --chat-gradient-primary: linear-gradient(135deg, #27a169 0%, #1e7a52 40%, #34c085 100%);
    --chat-gradient-secondary: linear-gradient(135deg, #34c085 0%, #27a169 100%);
    --chat-gradient-field: linear-gradient(135deg, #4a9b6a 0%, #27a169 50%, #1e7a52 100%);
    --chat-gradient-harvest: linear-gradient(135deg, #ffb347 0%, #f5a623 50%, #e67e22 100%);
    --chat-gradient-earth: linear-gradient(135deg, #8b6914 0%, #6b5435 100%);
    --chat-gradient-sunshine: linear-gradient(135deg, #ffb347 0%, #ffc870 100%);
    --chat-gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fbf9 40%, #f0f7f3 100%);
    --chat-gradient-glow: radial-gradient(circle, rgba(39, 161, 105, 0.25) 0%, transparent 70%);
    --chat-gradient-natural: linear-gradient(135deg, #f0f7f3 0%, #f8fbf9 50%, #ffffff 100%);
    --chat-gradient-field-pattern: repeating-linear-gradient(
        45deg,
        rgba(39, 161, 105, 0.02) 0px,
        rgba(39, 161, 105, 0.02) 2px,
        transparent 2px,
        transparent 8px
    );
    
    /* Enhanced Shadows with Natural Feel */
    --chat-shadow-sm: 0 2px 8px rgba(26, 46, 31, 0.06);
    --chat-shadow-md: 0 8px 24px rgba(26, 46, 31, 0.1);
    --chat-shadow-lg: 0 16px 48px rgba(26, 46, 31, 0.12);
    --chat-shadow-xl: 0 24px 64px rgba(26, 46, 31, 0.16);
    --chat-shadow-glow: 0 0 32px rgba(45, 134, 89, 0.35);
    --chat-shadow-natural: 0 4px 16px rgba(139, 111, 71, 0.15);
    
    /* Spacing */
    --chat-radius-sm: 8px;
    --chat-radius-md: 12px;
    --chat-radius-lg: 16px;
    --chat-radius-xl: 24px;
    --chat-radius-full: 9999px;
    
    /* Typography */
    --chat-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --chat-font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

/* Enhanced Animations */
@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(30px, -30px, 0) scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--chat-primary-glow), 0 0 40px rgba(0, 208, 132, 0.2);
    }
    50% {
        box-shadow: 0 0 30px var(--chat-primary-glow), 0 0 60px rgba(0, 208, 132, 0.3);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

@keyframes equalizer {
    0%, 100% {
        transform: scaleY(0.4);
    }
    50% {
        transform: scaleY(1);
    }
}

/* Base Styles */
* {
    box-sizing: border-box;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 0;
}

/* Main Chatbot Page */
.chatbot-page {
    position: relative;
    min-height: 100vh;
    padding: clamp(60px, 10vh, 120px) clamp(24px, 4vw, 48px) clamp(48px, 6vh, 80px);
    padding-top: clamp(100px, 14vh, 160px);
    background: 
        /* Agricultural field patterns - layered fields */
        radial-gradient(ellipse 1400px 700px at 15% 5%, rgba(39, 161, 105, 0.15) 0%, rgba(39, 161, 105, 0.05) 40%, transparent 70%),
        radial-gradient(ellipse 1200px 600px at 85% 15%, rgba(255, 179, 71, 0.12) 0%, rgba(255, 179, 71, 0.04) 40%, transparent 70%),
        radial-gradient(ellipse 1000px 500px at 50% 95%, rgba(74, 155, 106, 0.14) 0%, rgba(74, 155, 106, 0.05) 40%, transparent 70%),
        radial-gradient(ellipse 800px 400px at 30% 60%, rgba(124, 179, 66, 0.1) 0%, transparent 60%),
        /* Natural sky to field gradient */
        linear-gradient(180deg, #f5faf7 0%, #f0f7f3 30%, #eef5f1 60%, #ebf3ef 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    /* Subtle field texture overlay - crop rows */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(39, 161, 105, 0.015) 3px,
            rgba(39, 161, 105, 0.015) 6px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(39, 161, 105, 0.008) 100px,
            rgba(39, 161, 105, 0.008) 102px
        );
}

.chatbot-page::before,
.chatbot-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

.chatbot-page::before {
    width: 800px;
    height: 800px;
    top: -400px;
    left: -300px;
    background: radial-gradient(ellipse, rgba(39, 161, 105, 0.22) 0%, rgba(74, 155, 106, 0.12) 30%, rgba(39, 161, 105, 0.06) 50%, transparent 75%);
    animation: float 20s ease-in-out infinite;
    filter: blur(70px);
    opacity: 0.9;
}

.chatbot-page::after {
    width: 700px;
    height: 700px;
    bottom: -300px;
    right: -250px;
    background: radial-gradient(ellipse, rgba(255, 179, 71, 0.18) 0%, rgba(245, 166, 35, 0.1) 30%, rgba(255, 179, 71, 0.05) 50%, transparent 75%);
    animation: float 25s ease-in-out infinite reverse;
    filter: blur(70px);
    opacity: 0.85;
}

/* Chatbot Shell */
.chatbot-shell {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    background: var(--chat-surface);
    border-radius: var(--chat-radius-xl);
    box-shadow: 
        var(--chat-shadow-xl), 
        var(--chat-shadow-glow),
        0 0 0 1px rgba(39, 161, 105, 0.1);
    border: 1px solid var(--chat-border);
    overflow: hidden;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    margin: 0 auto;
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Rich agricultural texture - field-like */
    background-image: 
        var(--chat-gradient-field-pattern),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 249, 0.98) 50%, rgba(240, 247, 243, 0.99) 100%);
}

.chatbot-shell::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--chat-gradient-field);
    opacity: 0.6;
    z-index: 2;
}

.chatbot-shell:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 32px 80px rgba(26, 61, 42, 0.18), 
        0 0 60px rgba(39, 161, 105, 0.35),
        0 0 0 1px rgba(39, 161, 105, 0.15);
}

.chatbot-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--chat-gradient-surface);
    opacity: 0.5;
}

/* Main Chat Area */
.chatbot-main {
    position: relative;
    background: var(--chat-gradient-surface);
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    z-index: 1;
}

/* Topbar */
.chat-topbar {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 36px;
    border-radius: var(--chat-radius-xl);
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
    border: 1px solid var(--chat-border);
    box-shadow: 
        var(--chat-shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.chat-topbar:hover {
    box-shadow: 
        var(--chat-shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: var(--chat-border-strong);
}

.topbar-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.assistant-inline-card {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 20px 28px;
    border-radius: var(--chat-radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8faf7 100%);
    border: 1px solid var(--chat-border);
    box-shadow: var(--chat-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.assistant-inline-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--chat-gradient-glow);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.assistant-inline-card:hover::before {
    opacity: 1;
}

.assistant-inline-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--chat-shadow-md);
    border-color: var(--chat-border-strong);
}

.assistant-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--chat-radius-md);
    background: var(--chat-gradient-field);
    box-shadow: 
        0 4px 12px rgba(39, 161, 105, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(30, 122, 82, 0.2);
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.assistant-avatar::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: calc(var(--chat-radius-md) - 2px);
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    pointer-events: none;
}

.assistant-inline-card:hover .assistant-avatar {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 
        0 6px 18px rgba(39, 161, 105, 0.45),
        0 0 0 2px rgba(255, 255, 255, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(30, 122, 82, 0.25);
}

.assistant-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.status-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9ca3af;
    border: 2px solid var(--chat-surface);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.assistant-inline-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--chat-text-primary);
}

.assistant-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--chat-text-primary);
}

.assistant-subtitle {
    font-size: 0.875rem;
    color: var(--chat-text-secondary);
    font-weight: 500;
}

.assistant-tag-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: var(--chat-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(39, 161, 105, 0.15) 0%, rgba(39, 161, 105, 0.1) 100%);
    border: 1px solid rgba(39, 161, 105, 0.3);
    color: var(--chat-primary-dark);
    transition: all 0.2s ease;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 1px 2px rgba(39, 161, 105, 0.1);
}

.status-pill.online {
    background: linear-gradient(135deg, rgba(39, 161, 105, 0.22) 0%, rgba(74, 155, 106, 0.15) 100%);
    border-color: rgba(39, 161, 105, 0.4);
    color: #1e7a52;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 2px 4px rgba(39, 161, 105, 0.15);
}

.status-pill.success {
    background: linear-gradient(135deg, rgba(39, 161, 105, 0.22) 0%, rgba(74, 155, 106, 0.15) 100%);
    border-color: rgba(39, 161, 105, 0.4);
    color: #1e7a52;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 2px 4px rgba(39, 161, 105, 0.15);
}

.status-pill.warn {
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.22) 0%, rgba(245, 166, 35, 0.15) 100%);
    border-color: rgba(255, 179, 71, 0.4);
    color: #d4881e;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 2px 4px rgba(255, 179, 71, 0.15);
}

/* Topbar Actions */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1002;
}

.topbar-icon-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--chat-radius-md);
    border: 1px solid var(--chat-border);
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: var(--chat-text-primary);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 2px rgba(26, 46, 31, 0.05);
}

.icon-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--chat-gradient-field);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.icon-btn:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--chat-primary);
    box-shadow: 
        var(--chat-shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbf9 100%);
}

.icon-btn:hover::before {
    opacity: 0.12;
}

.icon-btn.active {
    background: var(--chat-gradient-field);
    color: var(--chat-text-inverse);
    border-color: rgba(39, 161, 105, 0.55);
    box-shadow: 
        0 0 20px rgba(39, 161, 105, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
}

.icon-btn.active::before {
    opacity: 0;
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--chat-radius-full);
    border: 1px solid var(--chat-border);
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
    color: var(--chat-text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(26, 46, 31, 0.06);
}

.pill-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--chat-gradient-field);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.pill-btn:hover {
    transform: translateY(-2px);
    border-color: var(--chat-primary);
    box-shadow: 
        0 4px 12px rgba(39, 161, 105, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
    color: var(--chat-text-inverse);
}

.pill-btn:hover::before {
    opacity: 1;
}

.pill-btn > * {
    position: relative;
    z-index: 1;
}

/* Dropdowns */
.switch-module-wrapper,
.language-menu-wrapper {
    position: relative;
    display: inline-flex;
    z-index: 10000;
}

.module-preview-dropdown,
.language-menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 280px;
    padding: 16px;
    border-radius: var(--chat-radius-lg);
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    box-shadow: var(--chat-shadow-xl);
    backdrop-filter: blur(20px);
    z-index: 9999;
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.module-preview-title,
.language-menu-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--chat-text-tertiary);
    margin-bottom: 12px;
}

.module-preview-list,
.language-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.module-preview-item,
.language-menu-item {
    width: 100%;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--chat-radius-md);
    border: 1px solid var(--chat-border);
    background: var(--chat-surface-elevated);
    transition: all 0.2s ease;
    text-align: left;
    color: var(--chat-text-primary);
}

.module-preview-item:hover,
.language-menu-item:hover {
    transform: translateX(-4px);
    border-color: var(--chat-primary);
    box-shadow: var(--chat-shadow-sm);
    background: var(--chat-surface);
}

.module-preview-item.active,
.language-menu-item.active {
    background: var(--chat-gradient-primary);
    color: var(--chat-text-inverse);
    border-color: var(--chat-primary);
    box-shadow: 0 0 20px rgba(0, 208, 132, 0.3);
}

.module-preview-icon,
.language-menu-flag {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.module-preview-meta,
.language-menu-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.module-preview-name,
.language-menu-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.module-preview-status,
.language-menu-name small {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Topbar Secondary */
.topbar-secondary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 680px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--chat-text-tertiary);
}

.topbar-copy h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--chat-text-primary);
    line-height: 1.2;
}

.topbar-copy p {
    margin: 0;
    font-size: 1rem;
    color: var(--chat-text-secondary);
    line-height: 1.6;
}

/* Chat Feed */
.chat-feed {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbf9 40%, #f0f7f3 80%, #eef5f1 100%);
    border-radius: var(--chat-radius-xl);
    border: 1px solid var(--chat-border);
    padding: 32px;
    flex: 1;
    min-height: 500px;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 
        inset 0 2px 8px rgba(26, 61, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    /* Subtle field texture */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(39, 161, 105, 0.008) 2px,
            rgba(39, 161, 105, 0.008) 4px
        );
}

.chat-feed::-webkit-scrollbar {
    width: 8px;
}

.chat-feed::-webkit-scrollbar-track {
    background: rgba(240, 247, 243, 0.6);
    border-radius: var(--chat-radius-full);
}

.chat-feed::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(39, 161, 105, 0.35) 0%, rgba(74, 155, 106, 0.25) 100%);
    border-radius: var(--chat-radius-full);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chat-feed::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(39, 161, 105, 0.55) 0%, rgba(74, 155, 106, 0.45) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Chat Messages */
.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.chat-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--chat-radius-md);
    background: var(--chat-gradient-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 208, 132, 0.3);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.chat-message:hover .chat-message-avatar {
    transform: scale(1.1) rotate(5deg);
}

.chat-bubble {
    max-width: clamp(240px, 75%, 680px);
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
    border-radius: var(--chat-radius-lg);
    padding: 16px 20px;
    box-shadow: 
        var(--chat-shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.chat-bubble:hover {
    box-shadow: 
        var(--chat-shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: var(--chat-border-strong);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffffff 0%, #f8faf7 100%);
}

.chat-message.user .chat-bubble {
    background: var(--chat-gradient-field);
    color: var(--chat-text-inverse);
    border-color: rgba(39, 161, 105, 0.45);
    box-shadow: 
        0 4px 16px rgba(39, 161, 105, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
}

.chat-message.user .chat-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    border-radius: var(--chat-radius-lg) var(--chat-radius-lg) 0 0;
}

.chat-message.user .chat-bubble:hover {
    box-shadow: 
        0 8px 24px rgba(39, 161, 105, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(30, 122, 82, 0.2);
    transform: translateY(-2px);
}

.chat-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--chat-text-primary);
}

.chat-message.user .chat-text {
    color: var(--chat-text-inverse);
}

.chat-text p {
    margin: 0 0 8px 0;
}

.chat-text p:last-child {
    margin-bottom: 0;
}

.chat-text strong {
    font-weight: 700;
    color: inherit;
}

.chat-meta {
    font-size: 0.75rem;
    color: var(--chat-text-tertiary);
    display: flex;
    justify-content: flex-start;
}

.chat-message.user .chat-meta {
    justify-content: flex-end;
    color: rgba(255, 255, 255, 0.8);
}

/* Quick Actions */
.message-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--chat-radius-full);
    border: 1px solid var(--chat-border);
    background: linear-gradient(135deg, #fafbf9 0%, #f5f7f4 100%);
    color: var(--chat-text-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 2px rgba(26, 46, 31, 0.05);
}

.chip:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--chat-primary);
    background: var(--chat-gradient-primary);
    color: var(--chat-text-inverse);
    box-shadow: 
        0 4px 12px rgba(45, 134, 89, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-quick-actions .chip {
    background: linear-gradient(135deg, rgba(39, 161, 105, 0.12) 0%, rgba(74, 155, 106, 0.08) 100%);
    border-color: rgba(39, 161, 105, 0.3);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 1px 2px rgba(39, 161, 105, 0.12);
    color: var(--chat-primary-dark);
}

.message-quick-actions .chip:hover {
    background: var(--chat-gradient-field);
    border-color: rgba(39, 161, 105, 0.5);
    color: var(--chat-text-inverse);
    box-shadow: 
        0 4px 12px rgba(39, 161, 105, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-field-green) 100%);
    animation: pulse 1.4s ease-in-out infinite;
    box-shadow: 
        0 0 8px rgba(39, 161, 105, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

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

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

/* File Processing */
.file-processing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--chat-text-secondary);
}

.processing-spinner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--chat-border);
    border-top-color: var(--chat-primary);
    animation: spin 0.8s linear infinite;
}

/* Inline Map Button */
.inline-map-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--chat-radius-md);
    border: 1px solid rgba(39, 161, 105, 0.45);
    background: var(--chat-gradient-field);
    color: var(--chat-text-inverse);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(39, 161, 105, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
    cursor: pointer;
}

.inline-map-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(39, 161, 105, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(30, 122, 82, 0.2);
    border-color: rgba(39, 161, 105, 0.65);
    background: linear-gradient(135deg, #34c085 0%, #27a169 40%, #1e7a52 100%);
}

/* Chat Footer */
.chat-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    border-radius: var(--chat-radius-lg);
    border: 1px solid var(--chat-border);
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
    box-shadow: 
        var(--chat-shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--chat-primary);
    box-shadow: 
        var(--chat-shadow-md), 
        0 0 0 3px rgba(45, 134, 89, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffffff 0%, #f8faf7 100%);
}

.chat-input {
    flex: 1;
    border: none;
    resize: none;
    font-size: 0.9375rem;
    padding: 8px 4px;
    max-height: 160px;
    line-height: 1.5;
    color: var(--chat-text-primary);
    background: transparent;
    font-family: var(--chat-font-family);
}

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

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

.send-btn {
    padding: 12px 24px;
    border-radius: var(--chat-radius-md);
    background: var(--chat-gradient-field);
    color: var(--chat-text-inverse);
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(39, 161, 105, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(39, 161, 105, 0.35);
}

.send-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0.6;
}

.send-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.send-btn:hover::before {
    transform: translateX(100%);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(39, 161, 105, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(30, 122, 82, 0.2);
    border-color: rgba(39, 161, 105, 0.55);
    background: linear-gradient(135deg, #34c085 0%, #27a169 40%, #1e7a52 100%);
}

.send-btn:active {
    transform: translateY(0);
}

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

/* Voice Status */
.voice-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
    color: var(--chat-text-secondary);
    padding: 10px 16px;
    border-radius: var(--chat-radius-md);
    border: 1px dashed rgba(39, 161, 105, 0.35);
    background: linear-gradient(135deg, rgba(39, 161, 105, 0.1) 0%, rgba(74, 155, 106, 0.06) 100%);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 1px 2px rgba(39, 161, 105, 0.08);
}

.voice-animation {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.voice-animation span {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-field-green) 50%, var(--chat-primary-light) 100%);
    animation: equalizer 0.9s infinite;
    box-shadow: 
        0 0 4px rgba(39, 161, 105, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.voice-animation span:nth-child(2) {
    animation-delay: 0.15s;
}

.voice-animation span:nth-child(3) {
    animation-delay: 0.3s;
}

/* Overlays */
.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 46, 31, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.overlay-card {
    width: min(640px, 100%);
    max-height: 90vh;
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
    border-radius: var(--chat-radius-xl);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 
        var(--chat-shadow-xl),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid var(--chat-border);
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    backdrop-filter: blur(20px);
}

.overlay-card--wide {
    width: min(800px, 100%);
}

.overlay-card--medium {
    width: min(560px, 100%);
}

.overlay-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.overlay-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--chat-text-primary);
}

.overlay-header p {
    margin: 8px 0 0 0;
    color: var(--chat-text-secondary);
    font-size: 0.9375rem;
}

.overlay-close {
    width: 40px;
    height: 40px;
    border-radius: var(--chat-radius-md);
    border: 1px solid var(--chat-border);
    background: var(--chat-surface-elevated);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--chat-text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.overlay-close:hover {
    background: var(--chat-surface);
    border-color: var(--chat-border-strong);
    color: var(--chat-text-primary);
    transform: rotate(90deg);
}

.overlay-body {
    display: grid;
    gap: 20px;
}

.module-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.module-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    border-radius: var(--chat-radius-lg);
    border: 1px solid var(--chat-border);
    background: linear-gradient(135deg, #fafbf9 0%, #f5f7f4 100%);
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(26, 46, 31, 0.06);
}

.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--chat-primary);
    box-shadow: 
        var(--chat-shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
}

.module-card.selected {
    background: var(--chat-gradient-field);
    color: var(--chat-text-inverse);
    border-color: rgba(39, 161, 105, 0.6);
    box-shadow: 
        0 0 30px rgba(39, 161, 105, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
}

.module-card .module-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.module-card .module-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: inherit;
}

.module-card .module-info p {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    opacity: 0.8;
    line-height: 1.5;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--chat-radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--chat-text-inverse);
}

.status-badge.development {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Map */
.map-wrapper {
    height: 400px;
    border-radius: var(--chat-radius-lg);
    border: 1px solid var(--chat-border);
    overflow: hidden;
    background: var(--chat-surface-elevated);
}

.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
    color: var(--chat-text-secondary);
}

.overlay-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--chat-border);
}

.coordinates-display {
    font-size: 0.875rem;
    color: var(--chat-text-secondary);
    padding: 12px 16px;
    border-radius: var(--chat-radius-md);
    border: 1px dashed rgba(39, 161, 105, 0.3);
    background: linear-gradient(135deg, #f8fbf9 0%, #f0f7f3 100%);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 1px 2px rgba(39, 161, 105, 0.08);
}

.overlay-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.primary-btn {
    padding: 12px 24px;
    border-radius: var(--chat-radius-md);
    background: var(--chat-gradient-field);
    color: var(--chat-text-inverse);
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(39, 161, 105, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(30, 122, 82, 0.15);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(39, 161, 105, 0.35);
}

.primary-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0.6;
}

.primary-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.primary-btn:hover::before {
    transform: translateX(100%);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(39, 161, 105, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(30, 122, 82, 0.2);
    border-color: rgba(39, 161, 105, 0.55);
    background: linear-gradient(135deg, #34c085 0%, #27a169 40%, #1e7a52 100%);
}

.primary-btn:active {
    transform: translateY(0);
}

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

.ghost-btn {
    padding: 12px 24px;
    border-radius: var(--chat-radius-md);
    border: 1px solid var(--chat-border);
    background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
    color: var(--chat-text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 2px rgba(26, 46, 31, 0.05);
}

.ghost-btn:hover {
    background: linear-gradient(135deg, #fafbf9 0%, #f5f7f4 100%);
    border-color: var(--chat-border-strong);
    transform: translateY(-2px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 4px rgba(26, 46, 31, 0.08);
}

/* Feedback Form */
.feedback-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-field label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--chat-text-primary);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▾";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--chat-text-tertiary);
    font-size: 0.875rem;
}

.feedback-field select,
.feedback-field textarea {
    width: 100%;
    border-radius: var(--chat-radius-md);
    border: 1px solid var(--chat-border);
    background: var(--chat-surface);
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: var(--chat-text-primary);
    font-family: var(--chat-font-family);
    transition: all 0.2s ease;
}

.feedback-field select:focus,
.feedback-field textarea:focus {
    outline: none;
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(0, 208, 132, 0.1);
}

.feedback-field textarea {
    min-height: 140px;
    resize: vertical;
}

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .chatbot-page {
        padding: 48px 20px;
    }

    .chatbot-main {
        padding: 32px;
    }

    .chat-topbar {
        padding: 28px;
    }
}

@media (max-width: 768px) {
    .chatbot-page {
        padding: 32px 16px 48px;
    }

    .chatbot-main {
        padding: 24px;
        gap: 24px;
    }

    .chat-topbar {
        padding: 24px;
    }

    .topbar-primary {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .chat-feed {
        padding: 24px;
        max-height: 60vh;
    }

    .topbar-copy h2 {
        font-size: 1.5rem;
    }

    .overlay-card {
        padding: 24px;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .chatbot-page {
        padding: 24px 12px 40px;
    }

    .chatbot-main {
        padding: 20px;
    }

    .chat-topbar {
        padding: 20px;
    }

    .chat-feed {
        padding: 20px;
        gap: 20px;
    }

    .chat-input-wrapper {
        flex-wrap: wrap;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .pill-btn {
        padding: 8px 16px;
        font-size: 0.8125rem;
    }
}
