/* Core shell */
.zty-ai-chat-window {
    width: var(--zty-width, 380px);
    height: var(--zty-height, 480px);
    max-height: 80vh;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.25, 1), opacity 0.2s;
}

.zty-ai-chat-window.zty-is-inline {
    position: relative;
}

.zty-ai-chat-window.zty-is-floating {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

.zty-ai-chat-window.zty-is-floating.zty-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Floating button with dynamic responsive size */
.zty-floating-toggle-btn {
    width: 56px;
    height: 56px;
    background: var(--zty-btn-bg, #0f172a);
    color: var(--zty-btn-icon, #ffffff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    box-sizing: border-box !important;
    transition: transform 0.2s;
}

.zty-floating-toggle-btn:hover {
    transform: scale(1.05);
}

.zty-floating-toggle-btn svg {
    width: 45% !important;
    height: 45% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: auto !important;
}

@media (max-width: 768px) {
    .zty-floating-toggle-btn svg {
        width: 45% !important;
        height: 45% !important;
    }
}

/* Header */
.zty-ai-chat-header {
    background: var(--zty-hdr-bg, #0f172a);
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.zty-ai-chat-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff !important;
}

.zty-ai-status {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
}

/* Body */
.zty-ai-chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--zty-chat-bg, #f8fafc);
}

.zty-ai-chat-box::-webkit-scrollbar {
    width: 5px;
}

.zty-ai-chat-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.zty-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.zty-msg-row-user {
    justify-content: flex-end;
}

.zty-msg-row-ai {
    justify-content: flex-start;
}

.zty-msg-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: var(--zty-hdr-bg, #0f172a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.zty-msg {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.zty-msg-user {
    align-self: flex-end;
    background: var(--zty-btn-bg, #0f172a);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.zty-msg-ai {
    align-self: flex-start;
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 2px;
}

/* Input area & Customizable Send button */
.zty-ai-chat-input-area {
    display: flex;
    border-top: 1px solid #e2e8f0;
    padding: 12px;
    background: #ffffff;
    gap: 8px;
    align-items: center;
}

.zty-ai-chat-input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    outline: none;
    font-size: 13.5px;
}

.zty-ai-chat-input:focus {
    border-color: var(--zty-btn-bg, #0f172a);
}

.zty-ai-chat-send {
    background: var(--zty-send-btn-bg, #0f172a);
    color: var(--zty-send-btn-icon, #ffffff);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}

.zty-ai-chat-send:active {
    transform: scale(0.95);
}

.zty-ai-chat-send:disabled,
.zty-ai-chat-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Typing indicator */
.zty-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
}

.zty-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: ztyBlink 1.4s infinite both;
}

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

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

@keyframes ztyBlink {
    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}
