/* Chatbot Modal Variables */
:root {
    --chat-bg: #1c1c1c;
    --chat-bubble-bot: #2a2a2a;
    --chat-bubble-user: #005baa;
    --chat-text: #ffffff;
    --chat-border: rgba(255, 255, 255, 0.1);
}

.chat-widget {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 66vw;
    max-width: 800px;
    height: 600px;
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    background: var(--chat-bg);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    border: 1px solid var(--chat-border);
    
    /* Animation hidden state */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-widget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    background: linear-gradient(135deg, #111111, #001f3f);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--chat-border);
    flex-shrink: 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}
.chat-bot-icon {
    font-size: 1.5rem;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.chat-close:hover { opacity: 1; }

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--chat-text);
    animation: fadeIn 0.3s;
}

.chat-bubble.bot {
    background: var(--chat-bubble-bot);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-bubble.user {
    background: var(--chat-bubble-user);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    display: flex;
    padding: 15px;
    background: #111;
    border-top: 1px solid var(--chat-border);
    gap: 10px;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    background: var(--chat-bubble-bot);
    border: 1px solid var(--chat-border);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
}
#chat-input::placeholder { color: #888; }

#chat-send {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}
#chat-send:active { transform: scale(0.9); }
#chat-send svg { width: 18px; height: 18px; }

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--chat-bubble-bot);
    width: fit-content;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Suggestion Chips */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 15px 20px;
    background: var(--chat-bg);
    flex-shrink: 0;
}

.suggestion-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--chat-border);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media(max-width: 900px) {
    .chat-widget {
        bottom: 80px;
        right: 20px;
        width: calc(100% - 40px);
        max-height: calc(100vh - 100px);
        max-height: calc(100dvh - 100px);
    }
}

@media(max-width: 640px) {
    .chat-widget {
        bottom: 70px;
        right: 12px;
        left: 12px;
        width: calc(100% - 24px);
        max-width: none;
        border-radius: 12px;
        max-height: calc(100vh - 85px);
        max-height: calc(100dvh - 85px);
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-messages {
        padding: 14px;
        gap: 10px;
    }
    
    .chat-suggestions {
        padding: 0 14px 10px 14px;
        gap: 6px;
    }
    
    .chat-input-area {
        padding: 10px 14px;
    }
}
