/* Chatbot Styles */
#bluebird-chatbot {
    position: fixed;
    bottom: 90px; /* Position above back-to-top button */
    right: 20px;
    z-index: 10000;
    font-family: 'Poppins', sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.chatbot-toggle i {
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover i {
    transform: scale(1.1);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* Language Selection */
.language-selection {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.language-options {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    gap: 20px;
    justify-content: center;
}

.language-btn {
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    font-weight: 500;
    color: #334155;
}

.language-btn:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.1);
}

.language-btn i {
    font-size: 20px;
    color: #667eea;
}

/* Chat Interface */
.chat-interface {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-content h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.header-content p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.status-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-text::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-actions {
    display: flex;
    gap: 10px;
}

.language-change-btn,
.minimize-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.language-change-btn:hover,
.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.3);
}

/* Message Bubbles */
.bot-message,
.user-message {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

.user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
    max-width: 85%;
}

.bot-message {
    max-width: 85%;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 5px;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.bot-message .message-content {
    border-radius: 18px 18px 18px 4px;
}

.message-content p {
    margin: 0;
    line-height: 1.4;
    font-size: 14px;
}

.message-content a {
    color: inherit;
    text-decoration: underline;
}

.user-message .message-content a {
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    display: block;
    font-size: 11px;
    opacity: 0.6;
    margin-top: 5px;
}

/* Welcome Message */
.welcome-message .bot-message .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.welcome-text {
    font-weight: 600 !important;
    margin-bottom: 5px !important;
}

.welcome-subtext {
    opacity: 0.9 !important;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.05);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #667eea;
    animation: typing-bounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

.typing-text {
    font-size: 12px;
    color: #667eea;
    font-style: italic;
}

/* Input Container */
.chat-input-container {
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input-wrapper {
    display: flex;
    padding: 15px 20px;
    gap: 10px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    max-height: 100px;
    min-height: 20px;
}

#chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#chat-input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
    opacity: 0.7;
}

#send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    padding: 10px 20px 15px;
    overflow-x: auto;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-action-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-family: 'Poppins', sans-serif;
}

.quick-action-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

.quick-action-btn i {
    font-size: 11px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #bluebird-chatbot {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle {
        width: 60px;
        height: 60px;
        bottom: 90px; /* Just above back-to-top button */
        right: 20px;
        position: fixed;
    }

    .chatbot-toggle i {
        font-size: 24px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 150px);
        max-width: 350px;
        max-height: 500px;
        bottom: 70px;
        right: -15px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: -10px;
        border-radius: 15px;
    }

    .chatbot-header {
        padding: 15px;
        border-radius: 15px 15px 0 0;
    }

    .chat-messages {
        padding: 15px;
    }

    .language-options {
        padding: 20px;
    }

    .language-btn {
        padding: 15px;
        font-size: 14px;
    }

    .quick-actions {
        padding: 10px 15px 15px;
    }

    .chat-input-wrapper {
        padding: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1e293b;
        border-color: rgba(102, 126, 234, 0.2);
    }

    .chat-messages {
        background: #0f172a;
    }

    .bot-message .message-content {
        background: #334155;
        color: white;
    }

    .language-btn {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .language-btn:hover {
        background: #475569;
    }

    #chat-input {
        background: #334155;
        border-color: #475569;
        color: white;
    }

    #chat-input::placeholder {
        color: #94a3b8;
    }

    .typing-indicator {
        background: rgba(102, 126, 234, 0.1);
        border-color: rgba(102, 126, 234, 0.2);
    }

    .quick-action-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
}

/* Error states */
.error-message .message-content {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border-left: 3px solid #dc2626;
}

/* Loading states */
.chatbot-toggle.loading {
    pointer-events: none;
    opacity: 0.7;
}

.chatbot-toggle.loading::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
