/* ===================================
   AI Chatbot Styles
   =================================== */

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

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.6);
}

.chatbot-button.active {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* Pulse Animation */
.chatbot-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(39, 174, 96, 0.4);
    animation: pulse 2s infinite;
}

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

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.open {
    display: flex;
}

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

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

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

.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.chatbot-title p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 1;
    color: white;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    max-height: 400px;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease;
}

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

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

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

.message-avatar.bot {
    background: linear-gradient(135deg, #2e7d8c 0%, #1e5a68 100%);
    color: white;
}

.message-avatar.user {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

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

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

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

.chatbot-message.user .message-bubble {
    background: linear-gradient(135deg, #2e7d8c 0%, #1e5a68 100%);
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 5px;
}

.chatbot-message.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-indicator.active {
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e7d8c;
    animation: typing 1.4s infinite;
}

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

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

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

/* Chatbot Input */
.chatbot-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #2e7d8c;
    box-shadow: 0 0 0 3px rgba(46, 125, 140, 0.1);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e7d8c 0%, #1e5a68 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(46, 125, 140, 0.4);
}

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

/* Quick Actions */
.chatbot-quick-actions {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-action {
    padding: 8px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-action:hover {
    background: #2e7d8c;
    color: white;
    border-color: #2e7d8c;
    transform: translateY(-2px);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.welcome-message h4 {
    color: #2e7d8c;
    margin-bottom: 10px;
    font-size: 18px;
}

.welcome-message p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

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

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

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        bottom: 90px;
        max-height: 70vh;
    }

    .chatbot-button {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }

    .chatbot-messages {
        max-height: calc(70vh - 200px);
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        right: 0;
        left: 0;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        max-height: 80vh;
    }

    .chatbot-button {
        bottom: 15px;
        right: 15px;
    }

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

    .chatbot-quick-actions {
        gap: 6px;
    }

    .quick-action {
        font-size: 12px;
        padding: 6px 12px;
    }
}

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

    .chatbot-messages {
        background: #2a2a2a;
    }

    .chatbot-message.bot .message-bubble {
        background: #333;
        color: #fff;
    }

    .message-time {
        color: #888;
    }

    .chatbot-input-container {
        background: #1a1a1a;
        border-top-color: #444;
    }

    .chatbot-input {
        background: #333;
        color: #fff;
        border-color: #444;
    }

    .chatbot-quick-actions {
        background: #2a2a2a;
        border-top-color: #444;
    }

    .quick-action {
        background: #333;
        color: #fff;
        border-color: #444;
    }

    .typing-indicator {
        background: #333;
    }
}
