﻿#af-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #0b1f33;
}

#af-chat-widget button,
#af-chat-widget input,
#af-chat-widget textarea {
    font-family: inherit;
}

.af-chat-toggle {
    background: linear-gradient(120deg, #8a0d0d, #c31b1b);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0;
    width: 62px;
    height: 62px;
    box-shadow: 0 12px 30px rgba(138, 13, 13, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    animation: af-chat-pulse 3s ease-in-out infinite;
}

.af-chat-toggle i {
    font-size: 26px;
    line-height: 1;
}

@keyframes af-chat-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(138, 13, 13, 0.45);
    }
    50% {
        transform: scale(0.9);
        box-shadow: 0 15px 32px rgba(138, 13, 13, 0.55);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(138, 13, 13, 0.45);
    }
}

.af-chat-window {
    width: 360px;
    max-height: 520px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(5, 25, 55, 0.35);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.af-chat-window.af-chat-window--hidden {
    display: none;
}

.af-chat-header {
    background: linear-gradient(120deg, #8a0d0d, #c31b1b);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.af-chat-close {
    border: none !important;
    background: none !important;
    color: #fff;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0;
}

.af-chat-close:hover {
    transform: scale(1.1);
}

.af-chat-close i {
    font-size: 16px;
    line-height: 1;
}

.af-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #f5f8ff;
}

.af-chat-message {
    margin-bottom: 12px;
    display: flex;
}

.af-chat-message span {
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.35;
    font-size: 14px;
}

.af-chat-message--bot {
    justify-content: flex-start;
}

.af-chat-message--bot span {
    background: #fff;
    border: 1px solid #e1e9ff;
}

.af-chat-message--user {
    justify-content: flex-end;
}

.af-chat-message--user span {
    background: #c31b1b;
    color: #fff;
}

.af-chat-open-form {
    padding: 16px 20px 20px;
    border-top: 1px solid #f3c3c3;
    text-align: center;
}

.af-chat-open-form__btn {
    border: none;
    background: linear-gradient(120deg, #8a0d0d, #c31b1b);
    color: #fff;
    border-radius: 14px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    display: block;
    box-shadow: 0 10px 25px rgba(138, 13, 13, 0.35);
}

.af-chat-open-form__btn:hover {
    opacity: 0.9;
}

.af-chat-form {
    padding: 16px 20px 20px;
    border-top: 1px solid #f3c3c3;
}

.af-chat-form label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 600;
}

.af-chat-form input,
.af-chat-form textarea {
    width: 100%;
    border: 1px solid #f3c3c3;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
    background: #fff7f7;
}

.af-chat-form textarea {
    resize: vertical;
    min-height: 80px;
}

.af-chat-form button {
    width: 100%;
    border: none;
    background: linear-gradient(120deg, #8a0d0d, #c31b1b);
    color: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(138, 13, 13, 0.35);
    box-sizing: border-box;
}

.af-chat-form--hidden {
    display: none;
}

.af-chat-status {
    font-size: 12px;
    color: #60709c;
    margin-top: 6px;
    text-align: center;
}

@media (max-width: 600px) {
    #af-chat-widget {
        right: 16px;
        left: 16px;
    }

    .af-chat-window {
        width: auto;
        max-width: none;
        max-height: 70vh;
    }
}
