:root {
    --chat-primary: #A31616;
    --chat-primary-dark: #7a1010;
    --chat-primary-light: #c92020;
    --chat-bg: #1a1a1a;
    --chat-surface: #2a2a2a;
    --chat-surface-light: #333;
    --chat-text: #fff;
    --chat-text-muted: #aaa;
    --chat-border: rgba(255, 255, 255, 0.1);
    --chat-radius: 20px;
}

/* Floating Button */
.chat-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-dark));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(163, 22, 22, 0.4);
    z-index: 9998;
    transition: transform 0.3s, box-shadow 0.3s;
}

.chat-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(163, 22, 22, 0.5);
}

.chat-float-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.chat-float-btn .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #e53e3e;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    animation: pulse 2s infinite;
}

.chat-float-btn .chat-badge.show {
    display: flex;
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: var(--chat-bg);
    border-radius: var(--chat-radius);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border: 1px solid var(--chat-border);
    animation: fadeIn 0.3s ease;
}

.chat-container.open {
    display: flex;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-dark));
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-header-avatar img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.chat-header-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-header-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
}

.chat-header-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    transition: background 0.2s;
}

.chat-header-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Message Bubbles */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageIn 0.3s ease;
}

.chat-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-light));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg-bot {
    align-self: flex-start;
    background: var(--chat-surface);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.chat-msg-bot a {
    color: var(--chat-primary-light);
    text-decoration: underline;
}

.chat-msg-bot ul,
.chat-msg-bot ol {
    margin: 6px 0;
    padding-left: 18px;
}

.chat-msg-bot li {
    margin-bottom: 4px;
}

.chat-msg-bot strong {
    color: #fff;
}

/* Typing Indicator */
.chat-typing {
    align-self: flex-start;
    background: var(--chat-surface);
    padding: 12px 18px;
    border-radius: 16px;
    display: none;
    gap: 5px;
    align-items: center;
}

.chat-typing.show {
    display: flex;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chat-text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Quick Buttons */
.chat-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    flex-shrink: 0;
}

.chat-quick-btn {
    padding: 6px 14px;
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    background: transparent;
    color: var(--chat-text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-quick-btn:hover {
    background: var(--chat-primary);
    color: #fff;
    border-color: var(--chat-primary);
}

/* Input Area */
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-input-area textarea {
    flex: 1;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--chat-text);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    min-height: 40px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area textarea::placeholder {
    color: var(--chat-text-muted);
}

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

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

.chat-send-btn:hover {
    background: var(--chat-primary-light);
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

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

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

/* Responsive - Full screen on mobile */
@media (max-width: 480px) {
    .chat-container {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chat-float-btn {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}
