/* ── Petciler AI Asistan Chat Widget ───────────────────────── */

#paa-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* ── Karakter ── */

#paa-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

#paa-char-inner {
    animation: paa-float 3s ease-in-out infinite;
    transition: transform 0.2s;
}

#paa-char-inner:hover {
    transform: scale(1.08);
}

#paa-char-inner svg {
    display: block;
}

@keyframes paa-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

/* ── Dismiss butonu ── */

#paa-dismiss {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #555;
    color: #fff;
    border: 2px solid #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0;
}

#paa-char:hover #paa-dismiss {
    opacity: 1;
}

/* ── Konuşma balonu ── */

#paa-bubble {
    position: absolute;
    bottom: calc(100% + 18px);
    right: -8px;
    max-width: 280px;
    background: linear-gradient(135deg, #018ac4 0%, #0199d8 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.55;
    padding: 13px 17px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 8px 28px rgba(1,138,196,0.35), 0 2px 8px rgba(0,0,0,0.10);
    white-space: normal;
    animation: paa-bubble-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) 1.2s both;
    cursor: default;
}

/* Aşağı bakan üçgen kuyruk */
#paa-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 4px solid transparent;
    border-top: 11px solid #0199d8;
}

@keyframes paa-bubble-pop {
    from { opacity: 0; transform: scale(0.6) translateY(12px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ── Chat Penceresi ── */

#paa-window {
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 44px rgba(1,138,196,0.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: paa-slide-up 0.38s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes paa-slide-up {
    from { opacity: 0; transform: translateY(28px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Header ── */

#paa-header {
    background: linear-gradient(135deg, #018ac4 0%, #0199d8 100%);
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    flex-shrink: 0;
}

#paa-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#paa-name {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
}

#paa-status {
    font-size: 11.5px;
    opacity: 0.88;
    margin-top: 2px;
}

#paa-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    opacity: 0.75;
    transition: opacity 0.2s, background 0.2s;
}

#paa-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}

/* ── Mesajlar ── */

#paa-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f0f8fc;
    scroll-behavior: smooth;
}

#paa-messages::-webkit-scrollbar       { width: 4px; }
#paa-messages::-webkit-scrollbar-track { background: transparent; }
#paa-messages::-webkit-scrollbar-thumb { background: #9dd4ed; border-radius: 2px; }

.paa-msg {
    display: flex;
    max-width: 84%;
    animation: paa-msg-in 0.25s ease;
}

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

.paa-bot  { align-self: flex-start; }
.paa-user { align-self: flex-end;   }

.paa-msg-text {
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}

.paa-bot .paa-msg-text {
    background: #fff;
    color: #1a3a4a;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 5px rgba(1,138,196,0.10);
}

.paa-user .paa-msg-text {
    background: linear-gradient(135deg, #018ac4, #0199d8);
    color: #fff;
    border-bottom-right-radius: 5px;
}

/* ── Yazıyor göstergesi ── */

.paa-typing .paa-msg-text {
    padding: 13px 18px;
}

.paa-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.paa-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9dd4ed;
    animation: paa-dot 1.2s ease-in-out infinite;
}

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

@keyframes paa-dot {
    0%, 80%, 100% { transform: scale(0.65); opacity: 0.35; }
    40%           { transform: scale(1);    opacity: 1; }
}

/* ── Input alanı ── */

#paa-footer {
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #d4eef9;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

#paa-input {
    flex: 1;
    border: 1.5px solid #cce9f6;
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #f0f8fc;
    transition: border-color 0.2s, background 0.2s;
    color: #1a3a4a;
}

#paa-input:focus {
    border-color: #018ac4;
    background: #fff;
}

#paa-input::placeholder { color: #7ab8d4; }

#paa-send {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #018ac4, #0199d8);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

#paa-send:hover  { transform: scale(1.08); }
#paa-send:active { transform: scale(0.94); }

#paa-send:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

/* ── Hazır mesaj butonları ── */

#paa-quick-replies {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 4px 0;
    animation: paa-msg-in 0.25s ease;
}

.paa-quick-btn {
    background: #fff;
    border: 1.5px solid #018ac4;
    color: #018ac4;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s, color 0.18s;
    line-height: 1.4;
}

.paa-quick-btn:hover {
    background: #018ac4;
    color: #fff;
}

/* ── Irk seçim butonları ── */

.paa-breed-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 4px 0;
    animation: paa-msg-in 0.25s ease;
}

.paa-breed-btn {
    background: #f0f8fc;
    border: 1.5px solid #9dd4ed;
    color: #1a3a4a;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    white-space: nowrap;
}

.paa-breed-btn:hover {
    background: #018ac4;
    border-color: #018ac4;
    color: #fff;
}

/* ── İlan kartları ── */

.paa-listings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
    animation: paa-msg-in 0.25s ease;
}

.paa-listing-card {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #d4eef9;
    border-radius: 12px;
    padding: 8px 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.paa-listing-card:hover {
    border-color: #018ac4;
    box-shadow: 0 3px 14px rgba(1,138,196,0.14);
}

.paa-listing-thumb {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f8fc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paa-listing-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.paa-no-thumb { font-size: 26px; }

.paa-listing-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
}

.paa-listing-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a3a4a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paa-listing-price {
    font-size: 13px;
    font-weight: 700;
    color: #018ac4;
}

.paa-all-link {
    display: block;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: #018ac4;
    text-decoration: none;
    padding: 7px;
    border-radius: 10px;
    background: #f0f8fc;
    border: 1px solid #d4eef9;
    transition: background 0.2s;
}

.paa-all-link:hover { background: #d4eef9; }

/* ── Mobil ── */

@media (max-width: 480px) {
    #paa-root   { bottom: 12px; right: 12px; }
    #paa-window { width: calc(100vw - 24px); height: 470px; }
    #paa-bubble { white-space: normal; max-width: 180px; }
}
