/* Chat Widget Styles - Premium Dark/Gold Theme */
:root {
    --chat-bg: #121212;
    --chat-header-bg: #000000;
    --chat-accent: #D4AF37;
    /* Gold */
    --chat-text: #ffffff;
    --chat-text-secondary: #aaaaaa;
    --chat-user-msg: #2a2a2a;
    --chat-bot-msg: #1e1e1e;
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Floating Toggle Button */
.chat-toggle-btn {
    width: 65px;
    height: 65px;
    background: var(--chat-header-bg);
    border: 2px solid var(--chat-accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.chat-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.5);
}

.chat-toggle-btn i {
    font-size: 1.8rem;
    color: var(--chat-accent);
    transition: transform 0.3s ease;
}

.chat-toggle-btn.open i {
    transform: rotate(45deg);
    /* Turn plus to close x if needed */
}

/* Chat Window */
.chat-window {
    width: 360px;
    height: 550px;
    background: var(--chat-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    border: 1px solid #333;

    /* Animation defaults */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
    /* Prevent clicks when hidden */
    position: absolute;
    bottom: 80px;
    right: 0;
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chat-header {
    background: var(--chat-header-bg);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #333;
}

.bot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--chat-accent);
    position: relative;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #4CAF50;
    /* Online green */
    border-radius: 50%;
    border: 2px solid #000;
}

.chat-info h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--chat-accent);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.chat-info p {
    color: var(--chat-text-secondary);
    font-size: 0.8rem;
    margin: 2px 0 0 0;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: #333 #121212;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    background: var(--chat-bot-msg);
    color: var(--chat-text);
    border-bottom-left-radius: 2px;
    border: 1px solid #333;
}

.message.user {
    background: var(--chat-accent);
    /* Gold bg */
    color: #000;
    /* Contrast text */
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    font-weight: 500;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: var(--chat-bot-msg);
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #333;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Input Area */
.chat-input-area {
    padding: 1rem;
    background: var(--chat-header-bg);
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 12px 15px;
    border-radius: 25px;
    color: white;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input-area input:focus {
    border-color: var(--chat-accent);
}

.send-btn {
    background: var(--chat-accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #000;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Integrated Actions (WhatsApp Button Style within Chat) */
.chat-action-btn {
    display: inline-block;
    margin-top: 10px;
    background: #25D366;
    /* WhatsApp Green */
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.chat-action-btn:hover {
    background: #128C7E;
}

@media (max-width: 480px) {
    .chat-window {
        width: 90vw;
        height: 70vh;
        right: 0;
        bottom: 80px;
    }
}

/* Chat Content Styling Updates */
.message ul {
    margin: 5px 0 5px 20px;
    padding: 0;
    list-style-type: disc;
}

.message li {
    margin-bottom: 4px;
}

.message strong {
    font-weight: 700;
    color: var(--chat-accent);
}

.message.user strong {
    color: #000;
}