/* ========================================
   Process Pulse Chatbot Styles
   Modern, Responsive, Professional Design
   ======================================== */

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066cc 0%, #00a8e8 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 102, 204, 0.6);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    animation: none;
}

/* Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b35;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid white;
    animation: bounce 1s ease-in-out infinite;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

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

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

.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: 22px;
    backdrop-filter: blur(10px);
}

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

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

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

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

/* Message Styles */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

.bot-message {
    align-items: flex-start;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0066cc 0%, #00a8e8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

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

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

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.bot-message .message-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bot-message .message-bubble a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.bot-message .message-bubble a:hover {
    border-bottom-color: #0066cc;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #0066cc 0%, #00a8e8 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    padding: 0 4px;
}

/* Quick Replies */
.chatbot-quick-replies {
    padding: 0 20px 15px;
    background: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.quick-reply-btn {
    background: white;
    border: 1.5px solid #e5e7eb;
    color: #0066cc;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0066cc 0%, #00a8e8 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

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

/* Footer */
.chatbot-footer {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 102, 204, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(0, 102, 204, 0.6);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 75px;
        right: 0;
        left: 15px;
        margin: 0 auto;
    }

    .chatbot-header {
        padding: 16px;
    }

    .chatbot-messages {
        padding: 15px;
    }

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

    .chatbot-input-area {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        border-radius: 15px;
    }

    .chatbot-header {
        border-radius: 15px 15px 0 0;
    }

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

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

    .message-bubble {
        font-size: 13px;
        padding: 10px 14px;
    }

    .quick-reply-btn {
        font-size: 12px;
        padding: 7px 14px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1f2937;
    }

    .chatbot-messages {
        background: #111827;
    }

    .bot-message .message-bubble {
        background: #374151;
        color: #f3f4f6;
    }

    .chatbot-input-area,
    .chatbot-footer {
        background: #1f2937;
        border-color: #374151;
    }

    .chatbot-input {
        background: #374151;
        color: white;
        border-color: #4b5563;
    }

    .quick-reply-btn {
        background: #374151;
        border-color: #4b5563;
        color: #60a5fa;
    }
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-close:focus,
.chatbot-send:focus,
.quick-reply-btn:focus,
.chatbot-input:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Print - Hide chatbot */
@media print {
    .chatbot-container {
        display: none !important;
    }
}
