/* AI Chat Widget Styles */
.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Floating Toggle Button */
.ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077b6 0%, #005696 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 119, 182, 0.4);
}

.ai-chat-toggle:active {
    transform: scale(0.95);
}

/* Notification Badge */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Chat Window */
.ai-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #0077b6 0%, #005696 100%);
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.chat-minimize {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: opacity 0.2s;
}

.chat-minimize:hover {
    opacity: 0.8;
}

/* Chat Body */
.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

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

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

.assistant-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #e9ecef;
    color: #495057;
    margin-left: 10px;
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, #0077b6 0%, #005696 100%);
    color: white;
    margin-right: 10px;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    word-wrap: break-word;
}

.user-message .message-content {
    background: #0077b6;
    color: white;
}

.assistant-message .message-content {
    background: white;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-content p {
    margin: 0 0 10px 0;
}

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

.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 5px 0;
}

/* Data Highlights */
.data-highlight {
    color: #0077b6;
    font-weight: 600;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 15px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    margin: 0 3px;
    animation: typing 1.4s infinite;
}

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

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

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

/* Quick Actions */
.chat-quick-actions {
    padding: 10px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.quick-action-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quick-action-btn:hover {
    background: #f8f9fa;
    border-color: #0077b6;
    color: #0077b6;
}

.quick-action-btn i {
    font-size: 12px;
}

/* Chat Footer */
.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
}

.chat-input-group {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #0077b6;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0077b6;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: #005696;
    transform: scale(1.05);
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
        right: 20px;
        left: 20px;
    }
    
    .ai-chat-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}