/* AI Chatbot Styles - Modern & Sleek Design */

/* Floating Toggle Button - Modern & Fancy */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.5), 
                0 0 0 0 rgba(102, 126, 234, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chatbot-pulse 2s ease-in-out infinite;
    backdrop-filter: blur(10px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chatbot-toggle-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    opacity: 0.3;
    z-index: -1;
    animation: chatbot-rotate 3s linear infinite;
}

@keyframes chatbot-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.chatbot-toggle-btn:active {
    transform: scale(0.95);
}

@keyframes chatbot-pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6), 0 0 0 8px rgba(102, 126, 234, 0.1);
    }
}

/* Chat Window - Modern Glass Morphism */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset,
                0 8px 32px rgba(102, 126, 234, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chatbot-window-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chatbot-window-fullscreen {
    bottom: 0 !important;
    right: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* Fullscreen mode responsive adjustments */
@media (max-width: 768px) {
    .chatbot-window-fullscreen {
        height: 100vh !important;
        max-height: 100vh !important;
    }

    .chatbot-window-fullscreen .chatbot-messages {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .chatbot-window-fullscreen .chatbot-messages {
        padding: 16px 12px;
    }
}

/* Header - Enhanced Gradient */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    /* overflow: hidden; */
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: header-shine 3s ease-in-out infinite;
}

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

@keyframes header-shine {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

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

.chatbot-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-status {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.chatbot-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chatbot-icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
}

.chatbot-icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chatbot-icon-btn:hover::before {
    opacity: 1;
}

.chatbot-icon-btn.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    animation: voice-mode-pulse 2s ease-in-out infinite;
}

@keyframes voice-mode-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3); }
}

/* Settings Popover */
.chatbot-settings-container {
    position: relative;
}

.chatbot-settings-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    pointer-events: none;
}

.chatbot-settings-popover-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.chatbot-settings-item {
    margin-bottom: 16px;
}

.chatbot-settings-item:last-child {
    margin-bottom: 0;
}

.chatbot-settings-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.chatbot-lang-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-lang-select:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 1);
}

.chatbot-lang-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Toggle Switch - Enhanced Design */
.chatbot-toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
}

.chatbot-switch-input {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    width: 2.25em;
    height: 1.5em;
    background-clip: padding-box, border-box;
    background-image:
        linear-gradient(#94a3b8, #e2e8f0),
        linear-gradient(#cbd5e1, #ffffff);
    background-origin: border-box;
    border: 0.0625em solid transparent;
    border-radius: 0.75em;
    box-shadow:
        0 0 0.0625em hsla(223, 10%, 10%, 0.3) inset,
        0 0.375em 0.375em hsla(223, 10%, 10%, 0) inset,
        0 0 0 0.75em rgba(102, 126, 234, 0) inset;
    cursor: pointer;
    outline: 0.125em solid hsla(223, 10%, 10%, 0);
    transition:
        box-shadow 0.3s cubic-bezier(0.65, 0, 0.35, 1),
        outline 0.3s cubic-bezier(0.65, 0, 0.35, 1),
        background-image 0.3s cubic-bezier(0.65, 0, 0.35, 1);
    flex-shrink: 0;
}

.chatbot-switch-input::before,
.chatbot-switch-input::after {
    border-radius: 50%;
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.chatbot-switch-input::before {
    background-clip: padding-box, border-box;
    background-image:
        linear-gradient(#64748b, #64748b),
        linear-gradient(#f1f5f9, #94a3b8, #f1f5f9);
    background-origin: border-box;
    border: 0.125em solid transparent;
    box-shadow: 
        0 0 0 1px #475569,
        0.125em 0.125em 0.25em hsla(223, 10%, 10%, 0.3);
    margin: 0.0625em;
    width: 1em;
    height: 1em;
    transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.chatbot-switch-input::after {
    background-color: #94a3b8;
    box-shadow:
        0 0 0.125em 0.125em rgba(102, 126, 234, 0),
        0 0 0.0625em rgba(102, 126, 234, 0) inset,
        0 -1px 0 #334155,
        0 1px 0 #f1f5f9;
    margin: 0.5em;
    width: 0.375em;
    height: 0.375em;
    transition:
        background-color 0.3s cubic-bezier(0.65, 0, 0.35, 1),
        box-shadow 0.3s cubic-bezier(0.65, 0, 0.35, 1),
        transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.chatbot-switch-input:focus-visible {
    outline: 0.125em solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.chatbot-switch-input:checked {
    background-image:
        linear-gradient(#667eea, #764ba2),
        linear-gradient(#667eea, #764ba2);
    box-shadow:
        0 0 0.0625em hsla(223, 10%, 10%, 0.3) inset,
        0 0.375em 0.375em hsla(223, 10%, 10%, 0.15) inset,
        0 0 0 0.75em rgba(102, 126, 234, 0.3) inset;
}

.chatbot-switch-input:checked::before,
.chatbot-switch-input:checked::after {
    transform: translateX(0.8125em);
}

.chatbot-switch-input:checked::after {
    background-color: #e0e7ff;
    box-shadow:
        0 0 0.125em 0.125em rgba(102, 126, 234, 0.7),
        0 0 0.0625em rgba(102, 126, 234, 0.7) inset,
        0 -1px 0 #334155,
        0 1px 0 #f1f5f9;
}

.chatbot-switch-sr {
    overflow: hidden;
    position: absolute;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
}

.chatbot-toggle-label {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
    flex: 1;
    margin-left: 0;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.chatbot-window-fullscreen .chatbot-messages {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Welcome Message */
.chatbot-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.chatbot-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: chatbot-wave 2s ease-in-out infinite;
}

@keyframes chatbot-wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-20deg); }
    75% { transform: rotate(20deg); }
}

.chatbot-welcome h4 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 600;
}

.chatbot-welcome-text {
    margin: 12px auto 20px;
    font-size: 14px;
    color: #475569;
    max-width: 500px;
    line-height: 1.6;
}

.chatbot-welcome p {
    margin: 8px 0;
    font-size: 14px;
}

.chatbot-welcome ul {
    text-align: left;
    margin: 16px auto;
    max-width: 300px;
    list-style: none;
    padding: 0;
}

.chatbot-welcome li {
    padding: 8px 0;
    font-size: 14px;
    color: #475569;
}

.chatbot-welcome-subtitle {
    margin: 20px 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
}

/* Welcome Language Selector */
.chatbot-welcome-lang-selector {
    margin: 24px auto;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    max-width: 400px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.chatbot-welcome-lang-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
    text-align: center;
}

.chatbot-welcome-lang-select {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364758b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

.chatbot-welcome-lang-select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.chatbot-welcome-lang-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-welcome-lang-select option {
    padding: 8px;
    background: white;
    color: #1e293b;
}

/* Command Chips Wrapper - Scrollable Container */
.chatbot-command-chips-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 0 20px 0;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.chatbot-command-chips-wrapper::-webkit-scrollbar {
    height: 6px;
}

.chatbot-command-chips-wrapper::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.chatbot-command-chips-wrapper::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.chatbot-command-chips-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Command Chips Container - Flex Wrap */
.chatbot-command-chips {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 4px;
    width: 100%;
}


/* Command Chip Button */
.chatbot-command-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    min-height: 40px;
    position: relative;
    overflow: hidden;
}

.chatbot-command-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.chatbot-command-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.chatbot-command-chip:hover::before {
    left: 100%;
}

.chatbot-command-chip:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Responsive adjustments for command chips */
@media (max-width: 768px) {
    .chatbot-command-chips-wrapper {
        margin: 0 0 16px 0;
        padding: 10px 0;
    }
    
    .chatbot-command-chips {
        gap: 8px;
        padding: 0 4px;
    }
    
    .chatbot-command-chip {
        font-size: 12px;
        padding: 8px 14px;
        min-height: 36px;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .chatbot-command-chips-wrapper {
        margin: 0 0 12px 0;
        padding: 8px 0;
        mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 5%,
            black 95%,
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 5%,
            black 95%,
            transparent 100%
        );
    }
    
    .chatbot-command-chips {
        gap: 6px;
        padding: 0 4px;
    }
    
    .chatbot-command-chip {
        font-size: 11px;
        padding: 7px 12px;
        min-height: 34px;
        border-radius: 18px;
    }
}

/* Messages */
.chatbot-message {
    display: flex;
    gap: 12px;
    animation: chatbot-message-appear 0.3s ease-out;
}

@keyframes chatbot-message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message-user {
    flex-direction: row-reverse;
}

/* RTL Support for Messages */
.chatbot-message-rtl {
    direction: rtl;
}

.chatbot-message-rtl.chatbot-message-user {
    flex-direction: row; /* In RTL, user messages should be on the right */
}

.chatbot-message-rtl.chatbot-message-assistant {
    flex-direction: row-reverse; /* In RTL, assistant messages should be on the left */
}

.chatbot-message-rtl .chatbot-message-content {
    text-align: right;
    direction: rtl;
}

.chatbot-message-rtl .chatbot-message-content p,
.chatbot-message-rtl .chatbot-message-text {
    text-align: right;
    direction: rtl;
}

/* RTL Border Radius Adjustments */
.chatbot-message-rtl.chatbot-message-user .chatbot-message-content p {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
}

.chatbot-message-rtl.chatbot-message-assistant .chatbot-message-content p,
.chatbot-message-rtl.chatbot-message-assistant .chatbot-message-text {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

.chatbot-message-rtl .chatbot-typing {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

/* RTL List Adjustments */
.chatbot-message-rtl .chatbot-message-text ul {
    padding-right: 20px;
    padding-left: 0;
    direction: rtl;
}

.chatbot-message-rtl .chatbot-message-text ol {
    padding-right: 20px;
    padding-left: 0;
    direction: rtl;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chatbot-message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatbot-window-fullscreen .chatbot-message-content {
    max-width: 60%;
}

.chatbot-window-fullscreen .chatbot-message-text {
    font-size: 16px;
    line-height: 1.7;
    padding: 16px 20px;
}

.chatbot-window-fullscreen .chatbot-message-user .chatbot-message-content p {
    font-size: 16px;
    padding: 14px 20px;
}

.chatbot-message-user .chatbot-message-content {
    align-items: flex-end;
}

/* RTL Alignment Adjustments */
.chatbot-message-rtl.chatbot-message-user .chatbot-message-content {
    align-items: flex-start; /* In RTL, user messages align to the right (start in RTL) */
}

.chatbot-message-rtl.chatbot-message-assistant .chatbot-message-content {
    align-items: flex-end; /* In RTL, assistant messages align to the left (end in RTL) */
}

.chatbot-message-content p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message-user .chatbot-message-content p {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message-assistant .chatbot-message-content p {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chatbot-message-text {
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
}

.chatbot-message-text code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.chatbot-message-text pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.chatbot-message-text pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.chatbot-message-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.chatbot-message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.chatbot-message-text li {
    margin: 4px 0;
}

.chatbot-message-text strong {
    font-weight: 600;
    color: #0f172a;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: chatbot-typing-bounce 1.4s ease-in-out infinite;
}

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

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

@keyframes chatbot-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chart Container */
.chatbot-chart-container {
    direction: ltr !important;
    text-align: left !important;
    margin-top: 12px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Input Mode Indicator */
.chatbot-input-mode-indicator {
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chatbot-mode-text {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.chatbot-mode-voice {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
    border: 1px solid #fbcfe8;
    animation: voice-mode-pulse 2s ease-in-out infinite;
}

@keyframes voice-mode-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(190, 24, 93, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(190, 24, 93, 0);
    }
}

/* Message Type Indicators */
.chatbot-message-type-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.text-indicator {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
}

.voice-indicator {
    background: rgba(190, 24, 93, 0.1);
    color: #be185d;
    animation: voice-indicator-pulse 1.5s ease-in-out infinite;
}

@keyframes voice-indicator-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.chatbot-message-voice {
    border-left: 3px solid #ec4899;
}

.chatbot-message-text-input {
    border-left: 0px solid #6366f1;
}

/* Input Container */
.chatbot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chatbot-voice-btn:hover {
    background: #e2e8f0;
    transform: scale(1.1);
}

.chatbot-voice-btn-active {
    background: #fee2e2;
    color: #dc2626;
    animation: chatbot-voice-pulse 1s ease-in-out infinite;
}

@keyframes chatbot-voice-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
    }
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
}

.chatbot-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

/* Error Messages */
.chatbot-message-error .chatbot-message-content {
    border-left: 3px solid #ef4444;
    border-radius: 18px;
}

.chatbot-error-text {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.chatbot-error-text strong {
    color: #7f1d1d !important;
}

/* Voice Indicator */
.chatbot-voice-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    font-size: 12px;
    color: #667eea;
}

.chatbot-voice-loading {
    display: flex;
    gap: 4px;
}

.chatbot-voice-loading span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #667eea;
    animation: chatbot-voice-loading 1.4s ease-in-out infinite;
}

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

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

@keyframes chatbot-voice-loading {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Audio Controls */
.chatbot-audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #bae6fd;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.chatbot-audio-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-audio-label {
    font-size: 12px;
    font-weight: 600;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chatbot-audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chatbot-audio-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatbot-audio-play-btn:active {
    transform: scale(0.95);
}

.chatbot-audio-progress-container {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.chatbot-audio-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    transition: width 0.1s linear;
    width: 0%;
}

.chatbot-audio-time {
    font-size: 11px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        max-width: 500px;
        height: calc(100vh - 140px);
        bottom: 100px;
        right: 20px;
        left: auto;
    }

    .chatbot-toggle-btn {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

    .chatbot-message-content {
        max-width: 80%;
    }

    .chatbot-welcome {
        padding: 32px 16px;
    }

    .chatbot-welcome-icon {
        font-size: 40px;
    }

    .chatbot-welcome h4 {
        font-size: 20px;
    }

    .chatbot-welcome-text {
        font-size: 13px;
    }

    .chatbot-welcome-lang-selector {
        padding: 14px;
        margin: 20px auto;
    }
}

/* Responsive Design - Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 16px;
        left: auto;
        max-width: none;
        max-height: none;
        border-radius: 20px;
    }

    .chatbot-toggle-btn {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .chatbot-header {
        padding: 16px;
    }

    .chatbot-header-text h3 {
        font-size: 16px;
    }

    .chatbot-status {
        font-size: 11px;
    }

    .chatbot-avatar {
        width: 36px;
        height: 36px;
    }

    .chatbot-icon-btn {
        width: 32px;
        height: 32px;
    }

    .chatbot-messages {
        padding: 20px 16px;
        gap: 16px;
    }

    .chatbot-message-content {
        max-width: 85%;
    }

    .chatbot-message-avatar {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .chatbot-message-content p,
    .chatbot-message-text {
        font-size: 13px;
        padding: 10px 14px;
    }

    .chatbot-welcome {
        padding: 28px 16px;
    }

    .chatbot-welcome-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }

    .chatbot-welcome h4 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .chatbot-welcome-text {
        font-size: 12px;
        margin: 10px auto 16px;
    }

    .chatbot-welcome-subtitle {
        font-size: 14px;
        margin: 16px 0 12px 0;
    }

    .chatbot-welcome-lang-selector {
        padding: 12px;
        margin: 16px auto;
        max-width: 90%;
    }

    .chatbot-welcome-lang-label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .chatbot-welcome-lang-select {
        padding: 8px 14px;
        font-size: 13px;
        padding-right: 32px;
    }

    .chatbot-command-chips-wrapper {
        margin: 0 0 16px 0;
        padding: 10px 0;
    }

    .chatbot-command-chip {
        font-size: 12px;
        padding: 7px 14px;
    }

    .chatbot-input-container {
        padding: 12px;
        gap: 6px;
    }

    .chatbot-voice-btn,
    .chatbot-send-btn {
        width: 36px;
        height: 36px;
    }

    .chatbot-input {
        padding: 10px 14px;
        font-size: 13px;
    }

    .chatbot-settings-popover {
        min-width: 200px;
        right: -10px;
        padding: 12px;
    }

    .chatbot-settings-item {
        margin-bottom: 12px;
    }

    .chatbot-settings-item label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .chatbot-lang-select {
        padding: 6px 10px;
        font-size: 13px;
    }

    .chatbot-chart-container {
        padding: 12px;
        margin-top: 10px;
    }

    .chatbot-audio-controls {
        padding: 12px;
        margin-top: 10px;
    }

    .chatbot-audio-play-btn {
        width: 32px;
        height: 32px;
    }
}

/* Responsive Design - Mobile Portrait */
@media (max-width: 480px) {
    .chatbot-window {
        border-radius: 20px 20px 0 0;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px);
        max-width: 100vw;
        max-height: calc(100vh - 60px);
    }

    .chatbot-toggle-btn {
        bottom: 12px;
        right: 12px;
        width: 52px;
        height: 52px;
    }

    .chatbot-header {
        padding: 14px 16px;
        border-radius: 20px 20px 0 0;
    }

    .chatbot-header-text h3 {
        font-size: 15px;
    }

    .chatbot-status {
        font-size: 10px;
    }

    .chatbot-avatar {
        width: 32px;
        height: 32px;
    }

    .chatbot-icon-btn {
        width: 30px;
        height: 30px;
    }

    .chatbot-messages {
        padding: 16px 12px;
        gap: 14px;
    }

    .chatbot-message-content {
        max-width: 88%;
        gap: 6px;
    }

    .chatbot-message-avatar {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    .chatbot-message-content p,
    .chatbot-message-text {
        font-size: 12px;
        padding: 9px 12px;
        line-height: 1.5;
    }

    .chatbot-welcome {
        padding: 24px 12px;
    }

    .chatbot-welcome-icon {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .chatbot-welcome h4 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .chatbot-welcome-text {
        font-size: 11px;
        margin: 8px auto 12px;
        line-height: 1.5;
    }

    .chatbot-welcome-subtitle {
        font-size: 13px;
        margin: 12px 0 10px 0;
    }

    .chatbot-welcome-lang-selector {
        padding: 10px;
        margin: 12px auto;
        max-width: 95%;
    }

    .chatbot-welcome-lang-label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .chatbot-welcome-lang-select {
        padding: 8px 12px;
        font-size: 12px;
        padding-right: 28px;
    }

    .chatbot-command-chips-wrapper {
        margin: 0 0 12px 0;
        padding: 8px 0;
    }

    .chatbot-command-chips {
        gap: 6px;
        padding: 0 4px;
    }

    .chatbot-command-chip {
        font-size: 11px;
        padding: 6px 12px;
        border-radius: 18px;
    }

    .chatbot-input-container {
        padding: 10px 12px;
        gap: 6px;
    }

    .chatbot-voice-btn,
    .chatbot-send-btn {
        width: 34px;
        height: 34px;
    }

    .chatbot-input {
        padding: 9px 12px;
        font-size: 12px;
    }

    .chatbot-settings-popover {
        min-width: 180px;
        right: -20px;
        padding: 10px;
        font-size: 12px;
    }

    .chatbot-settings-item {
        margin-bottom: 10px;
    }

    .chatbot-settings-item label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .chatbot-lang-select {
        padding: 6px 10px;
        font-size: 12px;
    }

    .chatbot-chart-container {
        padding: 10px;
        margin-top: 8px;
        border-radius: 10px;
    }

    .chatbot-audio-controls {
        padding: 10px;
        margin-top: 8px;
        gap: 10px;
    }

    .chatbot-audio-play-btn {
        width: 30px;
        height: 30px;
    }

    .chatbot-audio-label {
        font-size: 11px;
    }

    .chatbot-audio-time {
        font-size: 10px;
        min-width: 35px;
    }

    .chatbot-input-mode-indicator {
        padding: 6px 12px;
    }

    .chatbot-mode-badge {
        padding: 5px 10px;
        font-size: 11px;
    }

    .chatbot-typing {
        padding: 10px 12px;
    }

    .chatbot-typing span {
        width: 6px;
        height: 6px;
    }
}

/* Responsive Design - Very Small Mobile */
@media (max-width: 360px) {
    .chatbot-header {
        padding: 12px 14px;
    }

    .chatbot-header-text h3 {
        font-size: 14px;
    }

    .chatbot-avatar {
        width: 28px;
        height: 28px;
    }

    .chatbot-icon-btn {
        width: 28px;
        height: 28px;
    }

    .chatbot-messages {
        padding: 14px 10px;
    }

    .chatbot-message-content {
        max-width: 90%;
    }

    .chatbot-message-content p,
    .chatbot-message-text {
        font-size: 11px;
        padding: 8px 10px;
    }

    .chatbot-welcome {
        padding: 20px 10px;
    }

    .chatbot-welcome-icon {
        font-size: 28px;
    }

    .chatbot-welcome h4 {
        font-size: 15px;
    }

    .chatbot-command-chip {
        font-size: 10px;
        padding: 5px 10px;
    }

    .chatbot-input {
        font-size: 11px;
        padding: 8px 10px;
    }

    .chatbot-voice-btn,
    .chatbot-send-btn {
        width: 32px;
        height: 32px;
    }
}

/* Responsive Design - Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chatbot-window {
        height: calc(100vh - 80px);
        bottom: 60px;
        border-radius: 20px;
    }

    .chatbot-toggle-btn {
        bottom: 12px;
        right: 12px;
    }

    .chatbot-messages {
        padding: 16px;
    }

    .chatbot-welcome {
        padding: 20px 16px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1e293b;
        color: #e2e8f0;
    }

    .chatbot-messages {
        background: #0f172a;
    }

    .chatbot-message-assistant .chatbot-message-content p,
    .chatbot-message-text {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .chatbot-input {
        background: #1e293b;
        border-color: #475569;
        color: #e2e8f0;
    }

    .chatbot-input:focus {
        background: #334155;
    }

    .chatbot-input-container {
        background: #1e293b;
        border-color: #475569;
    }

    .chatbot-voice-btn {
        background: #334155;
        color: #cbd5e1;
    }
}

