/* Chat Widget Container - Fixed to bottom right */

:root {
    --primary-gradient: linear-gradient(135deg, #4A2D8B 0%, #8B2D6A 100%);
    --primary-color: #4A2D8B;
    --secondary-color: #8B2D6A;
    --text-color: #333333;
    --bg-color: #f9f9fc;
    --message-bg: #ffffff;
    --border-color: #eaeaea;
}


.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Chat Bubble Button */
.chat-bubble {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: absolute;
    bottom: 0;
    right: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1001;
}

.chat-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-bubble svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chat-bubble.active svg.chat-icon {
    display: none;
}

.chat-bubble svg.close-icon {
    display: none;
}

.chat-bubble.active svg.close-icon {
    display: block;
}

/* Chat Container */
.chat-container {
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 70px;
    right: 0;
    transform: scale(0);
    opacity: 0;
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.chat-widget.open .chat-container {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 18px;
    background: var(--primary-gradient);
    color: white;
}

.logo {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--primary-color);
}

.chat-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-color);
}

.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;
    background: var(--message-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.message.loading {
    background: #e6e6e6;
    padding: 12px;
    width: 80px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    animation: bounce 1.5s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

.chat-input {
    display: flex;
    padding: 14px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 30px;
    outline: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(139, 45, 106, 0.1);
}

.chat-input button {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(139, 45, 106, 0.2);
}

.chat-footer {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--border-color);
    justify-content: center;
    gap: 16px;
}

.chat-action {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background 0.2s, transform 0.2s;
}

.chat-action:hover {
    background: rgba(74, 45, 139, 0.08);
    transform: translateY(-2px);
}

/* Mobile Responsive Styles */
@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 40px);
        height: 70vh;
        bottom: 80px;
    }
    
    .chat-bubble {
        width: 55px;
        height: 55px;
    }
}