/* my ai chatbot - styled to match website theme */

:root {
    --chatbot-primary: #3d5a80;
    --chatbot-primary-hover: #4a6fa5;
    --chatbot-bg: #0f1419;
    --chatbot-panel: #1a1f26;
    --chatbot-border: #2d3748;
    --chatbot-text: #e2e8f0;
    --chatbot-text-muted: #718096;
    --chatbot-user-msg: #3d5a80;
    --chatbot-shadow: rgba(0, 0, 0, 0.4);
    --chatbot-success: #2d6a4f;
}

/* chatbot toggle button */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--chatbot-primary);
    border: 1px solid var(--chatbot-border);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--chatbot-shadow);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    background: var(--chatbot-primary-hover);
    box-shadow: 0 6px 20px var(--chatbot-shadow);
}

.chatbot-toggle.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--chatbot-success);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--chatbot-bg);
}

/* main chatbot container */
.chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 560px;
    background: var(--chatbot-panel);
    border: 1px solid var(--chatbot-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: bottom right;
    overflow: hidden;
}

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

/* chatbot header */
.chatbot-header {
    background: var(--chatbot-bg);
    border-bottom: 1px solid var(--chatbot-border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--chatbot-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.chatbot-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chatbot-name {
    color: var(--chatbot-text);
    font-weight: 600;
    font-size: 14px;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--chatbot-text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chatbot-success);
    animation: pulse 2s infinite;
}

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

.chatbot-header-right {
    display: flex;
    gap: 8px;
}

.chatbot-minimize,
.chatbot-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--chatbot-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-minimize:hover,
.chatbot-close:hover {
    background: var(--chatbot-border);
    color: var(--chatbot-text);
}

/* messages display area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--chatbot-panel);
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chatbot-text-muted);
}

/* individual chat messages */
.chat-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

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

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

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--chatbot-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.message-avatar.user {
    background: #5c5470;
}

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

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

.message-text {
    background: var(--chatbot-bg);
    color: var(--chatbot-text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    border: 1px solid var(--chatbot-border);
}

.chat-message.user .message-text {
    background: var(--chatbot-user-msg);
    color: white;
    border-color: var(--chatbot-user-msg);
}

.message-time {
    font-size: 10px;
    color: var(--chatbot-text-muted);
    padding: 0 4px;
}

/* chatbot typing indicator */
.typing-indicator .message-content {
    max-width: fit-content;
}

.typing-dots {
    background: var(--chatbot-bg);
    border: 1px solid var(--chatbot-border);
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-text-muted);
    animation: typing 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 {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* suggested questions */
.chatbot-suggestions {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--chatbot-panel);
    border-top: 1px solid var(--chatbot-border);
}

.suggestion-btn {
    background: var(--chatbot-bg);
    border: 1px solid var(--chatbot-border);
    color: var(--chatbot-text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.suggestion-btn:hover {
    background: var(--chatbot-border);
    border-color: var(--chatbot-primary);
    color: var(--chatbot-text);
}

.suggestion-btn i {
    font-size: 12px;
    opacity: 0.7;
}

/* message input area */
.chatbot-input-area {
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-input-container {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    background: var(--chatbot-panel);
    border: 1px solid var(--chatbot-border);
    border-radius: 6px;
    color: var(--chatbot-text);
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.2s;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 2px rgba(61, 90, 128, 0.15);
}

.chatbot-input::placeholder {
    color: var(--chatbot-text-muted);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--chatbot-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--chatbot-primary-hover);
    transform: translateY(-1px);
}

.chatbot-send:active {
    transform: translateY(0);
}

/* making it mobile responsive */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 16px;
        right: 16px;
        left: 16px;
        margin: auto;
    }

    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
    }

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

