/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Chat Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a74da 0%, #0056b3 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(10, 116, 218, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(10, 116, 218, 0.6);
}

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

.chatbot-toggle i {
    transition: transform 0.3s ease;
}

.chatbot-toggle.active i {
    transform: rotate(180deg);
}

/* Notification Dot */
.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    animation: pulse 2s infinite;
}

.notification-dot.show {
    opacity: 1;
}

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

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.active {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #0a74da 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2ed573;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.chatbot-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

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

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

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

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

/* Message Styles */
.message {
    display: flex;
    margin-bottom: 20px;
    animation: messageSlideIn 0.4s ease-out;
}

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

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

.bot-message .message-avatar {
    background: linear-gradient(135deg, #0a74da, #0056b3);
    color: white;
}

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

.user-message .message-avatar {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    margin-right: 0;
    margin-left: 10px;
}

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

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #0a74da, #0056b3);
    color: white;
}

.message-bubble p {
    margin: 0;
    line-height: 1.4;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* Welcome Message */
.welcome-message .message-bubble {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #90caf9;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 15px;
}

.quick-action-btn {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
}

.quick-action-btn:hover {
    background: #f8f9fa;
    border-color: #0a74da;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(10, 116, 218, 0.15);
}

.quick-action-btn i {
    color: #0a74da;
    font-size: 14px;
}

/* Input Area */
.chatbot-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 12px;
    color: #6c757d;
}

.typing-indicator.show {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #6c757d;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 8px 15px;
    border: 1px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.input-container:focus-within {
    border-color: #0a74da;
    box-shadow: 0 0 0 3px rgba(10, 116, 218, 0.1);
}

#chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    color: #333;
}

#chatbot-input::placeholder {
    color: #6c757d;
}

.chatbot-send {
    background: linear-gradient(135deg, #0a74da, #0056b3);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.chatbot-send:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: scale(1.05);
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 75px;
        right: 10px;
        left: 10px;
        border-radius: 15px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .quick-action-btn {
        font-size: 11px;
        padding: 8px 10px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .chatbot-messages {
        background: #2d2d2d;
    }
    
    .message-bubble {
        background: #333;
        color: white;
    }
    
    .quick-action-btn {
        background: #333;
        border-color: #555;
        color: white;
    }
    
    .quick-action-btn:hover {
        background: #444;
    }
    
    .chatbot-input-area {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .input-container {
        background: #333;
        border-color: #555;
    }
    
    #chatbot-input {
        color: white;
    }
    
    #chatbot-input::placeholder {
        color: #999;
    }
    
    .typing-indicator {
        background: #333;
        color: #999;
    }
    
    .typing-dots span {
        background: #999;
    }
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-send:focus,
.quick-action-btn:focus {
    outline: 2px solid #0a74da;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .chatbot-window {
        border: 2px solid #000;
    }
    
    .message-bubble {
        border: 1px solid #000;
    }
    
    .quick-action-btn {
        border: 2px solid #000;
    }
}
