/* Time M.A.N. AI Chatbot Styles - Matching Brand Colors */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--secondary-color);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
    border-color: var(--hover-color);
}

.chatbot-toggle i {
    font-size: 24px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

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

/* Toggle button with logo */
.chatbot-toggle img {
    margin-top: 3px;
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.chatbot-toggle.active img {
    display: none;
}

/* Chatbot notification badge */
.chatbot-toggle .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    animation: pulse 2s infinite;
}

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

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 520px;
    background: var(--secondary-color);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.chatbot-container.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
    background: var(--primary-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.chatbot-avatar img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chatbot-avatar i {
    font-size: 22px;
    color: var(--secondary-color);
}

.chatbot-info {
    flex: 1;
}

.chatbot-name {
    color: var(--secondary-color);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

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

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

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

.chatbot-close i {
    color: var(--secondary-color);
    font-size: 14px;
}

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

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

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

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

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

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

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

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

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

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

.message.bot .message-avatar {
    background: var(--primary-color);
}

.message.bot .message-avatar img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.message.bot .message-avatar i {
    color: var(--secondary-color);
    font-size: 14px;
}

.message.user .message-avatar {
    background: var(--hover-color);
}

.message.user .message-avatar i {
    color: var(--secondary-color);
    font-size: 14px;
}

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

.message.bot .message-content {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message.user .message-content {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--secondary-color);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    opacity: 0.5;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

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

.quick-action-btn {
    padding: 8px 14px;
    background: var(--secondary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Poppins", sans-serif;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--secondary-color);
}

/* Chatbot Input Area */
.chatbot-input-area {
    padding: 15px 20px;
    background: var(--secondary-color);
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: "Poppins", sans-serif;
}

.chatbot-input:focus {
    border-color: var(--primary-color);
}

.chatbot-input::placeholder {
    color: #aaa;
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(42, 49, 54, 0.4);
    background: var(--hover-color);
}

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

.chatbot-send i {
    color: var(--secondary-color);
    font-size: 16px;
}

/* Responsive Design */
@media screen and (max-width: 480px) {
    .chatbot-container {
        right: 15px;
        left: 15px;
        bottom: 90px;
        width: auto;
        height: calc(100vh - 150px);
        max-height: 500px;
    }

    .chatbot-toggle {
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
    }

    .chatbot-toggle i {
        font-size: 22px;
    }

    .chatbot-toggle img {
        width: 35px;
        height: 35px;
    }

    .message {
        max-width: 90%;
    }

    .quick-actions {
        padding: 8px 15px;
    }

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

/* Error message styling */
.message.error .message-content {
    background: #ffe0e0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}
