#barbachatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#barbachatbot-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--barbachatbot-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(var(--barbachatbot-primary-rgb), 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    position: relative;
}

#barbachatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(var(--barbachatbot-primary-rgb), 0.4);
    filter: brightness(1.1);
}

#barbachatbot-notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background-color: #ff3b30;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}

#barbachatbot-notification-dot.hidden {
    display: none;
}

#barbachatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

#barbachatbot-header {
    background: var(--barbachatbot-primary);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

#barbachatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#barbachatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

#barbachatbot-content {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    background: #fcfcfc;
    display: flex;
    flex-direction: column;
}

#barbachatbot-lead-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#barbachatbot-lead-form p {
    margin: 0 0 8px 0;
    color: #555;
    font-size: 14px;
}

#barbachatbot-lead-form input,
#barbachatbot-lead-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#barbachatbot-lead-form input:focus,
#barbachatbot-lead-form textarea:focus {
    border-color: var(--barbachatbot-primary);
    box-shadow: 0 0 0 3px rgba(var(--barbachatbot-primary-rgb), 0.1);
    outline: none;
}

#barbachatbot-lead-form textarea {
    height: 100px;
    resize: none;
}

#barbachatbot-lead-form button {
    width: 100%;
    padding: 12px;
    background: var(--barbachatbot-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.1s ease;
}

#barbachatbot-lead-form button:hover {
    filter: brightness(0.9);
}

#barbachatbot-lead-form button:active {
    transform: translateY(1px);
}

#barbachatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 10px;
}

.message {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user {
    background: var(--barbachatbot-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(var(--barbachatbot-primary-rgb), 0.2);
}

.message.bot, .message.system, .message.typing {
    background: #fff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message.typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    width: fit-content;
}

.message.typing span {
    width: 6px;
    height: 6px;
    background: #bbb;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1s infinite ease-in-out;
}

.message.typing span:nth-child(2) { animation-delay: 0.2s; }
.message.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-4px); opacity: 1; }
}

.message p {
    margin: 0 0 10px 0;
}

.message p:last-child {
    margin-bottom: 0;
}

.message ul, .message ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message li {
    margin-bottom: 5px;
}

.message code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.message pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.message pre code {
    background: none;
    padding: 0;
}

.message a {
    color: var(--barbachatbot-primary);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.message a:hover {
    text-decoration: none;
    opacity: 0.7;
}

#barbachatbot-input-area {
    padding: 10px 15px 5px 15px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.barbachatbot-input-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.barbachatbot-footer-text {
    font-size: 10px;
    color: #888;
    text-align: center;
}

.barbachatbot-footer-text a {
    color: #888;
    text-decoration: none;
    font-weight: 600;
}

.barbachatbot-footer-text a:hover {
    text-decoration: underline;
}

#barbachatbot-input-area input {
    flex-grow: 1;
    border: 1px solid #e0e0e0;
    padding: 10px 15px;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

#barbachatbot-input-area input:focus {
    border-color: var(--barbachatbot-primary);
}

#chat-send {
    background: var(--barbachatbot-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
}

#chat-send:hover {
    filter: brightness(0.9);
}

.hidden {
    display: none !important;
}
