/* Professional Chart Bot Styles */
.chart-bot-widget.professional {
    position: fixed;
    bottom: 20px;
    right: 80px;
    width: 380px;
    height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e1e5e9;
    backdrop-filter: blur(10px);
}

.chart-bot-widget.professional.minimized {
    height: 60px;
    width: 60px;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.9);
    right: 80px;
}

.chart-bot-widget.professional:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.chart-bot-widget.professional.minimized:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.chart-bot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.chart-bot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.chart-bot-header.minimized {
    padding: 0;
    justify-content: center;
    align-items: center;
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

.chart-bot-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.chart-bot-title.minimized {
    display: flex !important;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.chart-bot-title.minimized span {
    display: none;
}

.chart-bot-title.minimized .chart-bot-status {
    display: none;
}

.chart-bot-title.minimized .chart-bot-avatar {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-variant-emoji: emoji;
    -webkit-font-feature-settings: "liga" 1;
    font-feature-settings: "liga" 1;
    position: relative;
}


.chart-bot-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chart-bot-header.minimized .chart-bot-avatar {
    width: 44px;
    height: 44px;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.chart-bot-controls {
    display: none;
}

.chart-bot-controls.minimized {
    display: none;
}

.chart-bot-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-bot-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.chart-bot-btn:active {
    transform: scale(0.95);
}

.chart-bot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8f9fa;
}

.chart-bot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

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

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

.chart-bot-messages::-webkit-scrollbar-thumb {
    background: #c1c8cd;
    border-radius: 3px;
}

.chart-bot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8b2ba;
}

.chart-bot-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
}

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

.chart-bot-message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chart-bot-message.bot {
    background: white;
    color: #2d3748;
    align-self: flex-start;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-bot-message.system {
    background: #fff3cd;
    color: #856404;
    align-self: center;
    border: 1px solid #ffeaa7;
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 90%;
}

.chart-bot-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    font-weight: 500;
}

.chart-bot-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chart-bot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chart-bot-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
    max-height: 120px;
    min-height: 44px;
    font-family: inherit;
    background: #f8f9fa;
}

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

.chart-bot-input:disabled {
    background: #f1f3f4;
    color: #9aa0a6;
    cursor: not-allowed;
}

.chart-bot-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chart-bot-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chart-bot-send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.chart-bot-send-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chart-bot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    align-self: flex-start;
    max-width: 80px;
    animation: messageSlideIn 0.3s ease-out;
}

.chart-bot-typing-dot {
    width: 8px;
    height: 8px;
    background: #a0aec0;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chart-bot-welcome {
    text-align: center;
    color: #4a5568;
    font-size: 14px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.chart-bot-welcome h4 {
    margin: 0 0 12px 0;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

.chart-bot-welcome p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.chart-bot-welcome ul {
    margin: 12px 0;
    padding-left: 20px;
}

.chart-bot-welcome li {
    margin: 4px 0;
    line-height: 1.4;
}

.chart-bot-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
    padding: 12px 16px;
    border-radius: 12px;
    margin: 10px 20px;
    font-size: 13px;
    line-height: 1.4;
}

.chart-bot-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #48bb78;
    border: 2px solid white;
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.3);
    margin-left: 8px;
    flex-shrink: 0;
}

.chart-bot-status.offline {
    background: #f56565;
    box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.3);
}

.chart-bot-status.connecting {
    background: #ed8936;
    box-shadow: 0 0 0 2px rgba(237, 137, 54, 0.3);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .chart-bot-widget.professional {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
    }
    
    .chart-bot-widget.professional.minimized {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 80px;
        border-radius: 50%;
        border: 1px solid #e1e5e9;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chart-bot-widget.professional {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .chart-bot-body {
        background: #1a202c;
    }
    
    .chart-bot-message.bot {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .chart-bot-input-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .chart-bot-input {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .chart-bot-input:focus {
        background: #2d3748;
        border-color: #667eea;
    }
    
    .chart-bot-welcome {
        background: #4a5568;
        color: #a0aec0;
        border-color: #718096;
    }
    
    .chart-bot-welcome h4 {
        color: #e2e8f0;
    }
}

/* Loading states */
.chart-bot-widget.professional.loading {
    opacity: 0.8;
    pointer-events: none;
}

.chart-bot-widget.professional.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.chart-bot-widget.professional:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.chart-bot-btn:focus,
.chart-bot-send-btn:focus,
.chart-bot-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .chart-bot-widget.professional {
        border: 2px solid #000;
    }
    
    .chart-bot-message.bot {
        border: 2px solid #000;
    }
    
    .chart-bot-input {
        border: 2px solid #000;
    }
}
