/**
 * Property AI Assistant - Chat Widget CSS
 * Version 3.0
 */

#paa-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#paa-chat-header {
    padding: 16px 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#paa-chat-title {
    font-weight: 700;
    font-size: 16px;
}

#paa-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}
#paa-chat-close:hover { opacity: 1; }

#paa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8f8f8;
}

.paa-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: paa-msgIn 0.25s ease-out;
}

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

.paa-msg-user {
    align-self: flex-end;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.paa-msg-assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.paa-msg-typing {
    align-self: flex-start;
    background: #ffffff;
    color: #999;
    font-style: italic;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 85%;
    animation: paa-msgIn 0.25s ease-out;
}

.paa-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    align-self: flex-start;
    animation: paa-msgIn 0.3s ease-out;
}

.paa-quick-btn {
    background: #ffffff;
    border: 2px solid;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
    text-align: left;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.paa-quick-btn:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.paa-contact-form {
    align-self: flex-start;
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    width: 90%;
    animation: paa-msgIn 0.3s ease-out;
}

.paa-form-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.paa-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8f8f8;
    box-sizing: border-box;
}

.paa-form-input:focus {
    border-color: #e63529;
    background: #fff;
}

.paa-form-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 4px;
    transition: opacity 0.2s;
}

#paa-greeting-bubble {
    position: fixed;
    bottom: 88px;
    right: 20px;
    background: #ffffff;
    color: #333;
    padding: 14px 18px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    z-index: 99998;
    max-width: 260px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    animation: paa-bubblePop 0.35s ease-out;
    border: 1px solid rgba(0,0,0,0.04);
}

#paa-greeting-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 24px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.03);
}

.paa-bubble-close {
    position: absolute;
    top: 4px;
    right: 10px;
    font-size: 18px;
    color: #ccc;
    cursor: pointer;
    line-height: 1;
}
.paa-bubble-close:hover { color: #666; }

@keyframes paa-bubblePop {
    0% { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

#paa-chat-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #eee;
    gap: 8px;
    flex-shrink: 0;
    background: #ffffff;
}

#paa-chat-input {
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background: #f8f8f8;
    transition: border-color 0.2s, background 0.2s;
}

#paa-chat-input:focus {
    border-color: #e63529;
    background: #fff;
}

#paa-chat-input::placeholder { color: #aaa; }

#paa-chat-send {
    border: none;
    color: #fff;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: opacity 0.2s;
}

#paa-chat-send:hover { opacity: 0.9; }

#paa-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 99999;
    transition: transform 0.2s;
}

#paa-chat-toggle:hover { transform: scale(1.1); }

@media (max-width: 480px) {
    #paa-chat-container {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 80px;
        height: 70vh;
        border-radius: 12px;
    }
    #paa-greeting-bubble {
        right: 8px;
        bottom: 80px;
        max-width: calc(100vw - 80px);
    }
    .paa-quick-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    .paa-contact-form { width: 95%; }
}