/* Global variables for consistent design */
:root {
    --chaty-primary: #000000;
    --chaty-bg: #ffffff;
    --chaty-bot-msg: #f0f2f5;
    --chaty-user-msg: #000000;
    --chaty-user-text: #ffffff;
    --chaty-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --chaty-radius: 12px;
    --chaty-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#chaty-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 99999;
    font-family: var(--chaty-font);
}

/* Floating Button */
#chaty-trigger {
    width: 60px;
    height: 60px;
    background: var(--chaty-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--chaty-shadow);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chaty-trigger:hover {
    transform: scale(1.1);
}

#chaty-trigger svg {
    width: 30px;
    height: 30px;
}

/* Chat Window */
#chaty-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--chaty-bg);
    border-radius: var(--chaty-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

.chaty-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    pointer-events: none;
}

/* Header */
.chaty-header {
    background: var(--chaty-bg);
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chaty-title {
    font-weight: 600;
    font-size: 16px;
}

#chaty-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

/* Body */
.chaty-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chaty-message {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.chaty-bot {
    align-self: flex-start;
    background: var(--chaty-bot-msg);
    color: #333;
    border-bottom-left-radius: 4px;
}

.chaty-user {
    align-self: flex-end;
    background: var(--chaty-user-msg);
    color: var(--chaty-user-text);
    border-bottom-right-radius: 4px;
}

/* Footer & Options */
.chaty-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chaty-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.chaty-option {
    background: var(--chaty-bg);
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.chaty-option:hover {
    background: #f8f9fa;
    border-color: #000;
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Indicator */
.chaty-typing {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: var(--chaty-bot-msg);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    align-self: flex-start;
    margin-bottom: 10px;
}

.chaty-typing span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.chaty-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chaty-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}

/* Action Buttons (External Links) */
.chaty-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    /* WhatsApp Green */
    color: white !important;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 5px;
    width: fit-content;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    transition: transform 0.2s;
}

.chaty-action-btn:hover {
    transform: scale(1.05);
}

.chaty-action-btn.email {
    background: var(--chaty-primary);
}

/* Responsive */
@media (max-width: 480px) {
    #chaty-window {
        width: 310px;
        height: 480px;
        bottom: 70px;
        right: 0;
    }
}