/* Chatbot Widget - Ocean Theme */
:root {
    --chat-primary: #0891b2;
    --chat-gradient: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
    --chat-bg: rgba(255, 255, 255, 0.95);
    --chat-glass: rgba(255, 255, 255, 0.8);
    --chat-text: #1e293b;
    --chat-user-bg: #0891b2;
    --chat-bot-bg: #f1f5f9;
}

/* Floating Button */
.chat-toggle-btn {
    position: fixed;
    bottom: 80px;
    /* Above bottom nav */
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-gradient);
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.4);
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-soft 3s infinite;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.6);
}

.chat-toggle-btn svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--chat-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.chat-header {
    background: var(--chat-gradient);
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chat-title span {
    font-size: 0.75rem;
    opacity: 0.9;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: slideIn 0.3s ease;
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-bot-bg);
    color: var(--chat-text);
    border-bottom-left-radius: 5px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-bg);
    color: white;
    border-bottom-right-radius: 5px;
}

/* Action Button Styles */
.chat-action-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: white;
    color: var(--chat-primary);
    border: 1px solid var(--chat-primary);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-action-btn:hover {
    background: var(--chat-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.5);
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

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

.chat-send-btn {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 5px 10px;
    background: var(--chat-bot-bg);
    border-radius: 15px;
    width: fit-content;
    margin-bottom: 10px;
    display: none;
    /* Hidden by default */
}

.dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

/* Animations */
@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(8, 145, 178, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(8, 145, 178, 0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        z-index: 10000;
    }

    .chat-toggle-btn {
        bottom: 70px;
        right: 15px;
    }
}