/* === YIZEE Chat Widget === */
#yz-chat-btn {
    position: fixed; bottom: 28px; right: 28px; z-index: 9999;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none; cursor: pointer; box-shadow: 0 4px 20px rgba(37,99,235,0.4);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
}
#yz-chat-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(37,99,235,0.5); }
#yz-chat-btn svg { width: 28px; height: 28px; fill: white; }
#yz-chat-btn .yz-badge {
    position: absolute; top: -2px; right: -2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #ef4444; border: 2px solid white;
    animation: yz-pulse 2s infinite;
}
@keyframes yz-pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

#yz-chat-box {
    position: fixed; bottom: 100px; right: 28px; z-index: 9998;
    width: 380px; max-width: calc(100vw - 32px); height: 520px; max-height: 70vh;
    background: #fff; border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
    display: none; flex-direction: column; overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#yz-chat-box.yz-open { display: flex; animation: yz-slideUp 0.3s ease-out; }
@keyframes yz-slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

#yz-chat-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white; padding: 16px 20px; flex-shrink: 0;
}
#yz-chat-header h4 { margin: 0 0 2px; font-size: 16px; font-weight: 600; }
#yz-chat-header p { margin: 0; font-size: 12px; opacity: 0.85; }
#yz-chat-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; color: white; font-size: 22px;
    cursor: pointer; opacity: 0.7; line-height: 1;
}
#yz-chat-close:hover { opacity: 1; }

/* Language selector in header */
#yz-lang-sel {
    position: absolute; top: 14px; right: 44px;
    width: auto; max-width: 70px;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
    color: white; font-size: 12px; padding: 3px 6px; border-radius: 6px;
    cursor: pointer; outline: none; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 6px center;
    padding-right: 20px;
}
#yz-lang-sel option { color: #1e293b; background: white; }

#yz-chat-body {
    flex: 1; overflow-y: auto; padding: 16px;
    background: #f8fafc; scroll-behavior: smooth;
}
.yz-msg { display: flex; margin-bottom: 12px; gap: 8px; }
.yz-msg-bot { justify-content: flex-start; }
.yz-msg-user { justify-content: flex-end; }
.yz-msg-bubble {
    max-width: 80%; padding: 10px 14px; border-radius: 14px;
    font-size: 14px; line-height: 1.5; word-wrap: break-word;
}
.yz-msg-bot .yz-msg-bubble {
    background: white; color: #1e293b;
    border: 1px solid #e2e8f0; border-bottom-left-radius: 4px;
}
.yz-msg-user .yz-msg-bubble {
    background: #2563eb; color: white; border-bottom-right-radius: 4px;
}
.yz-msg-bubble a { color: #2563eb; text-decoration: underline; }
.yz-msg-user .yz-msg-bubble a { color: #bfdbfe; }

.yz-quick-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.yz-quick-btn {
    background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
    padding: 6px 12px; border-radius: 20px; font-size: 12px;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.yz-quick-btn:hover { background: #2563eb; color: white; }

.yz-typing { display: flex; gap: 4px; padding: 8px 14px; }
.yz-typing span {
    width: 8px; height: 8px; background: #94a3b8; border-radius: 50%;
    animation: yz-bounce 1.4s infinite;
}
.yz-typing span:nth-child(2) { animation-delay: 0.2s; }
.yz-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes yz-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-8px)} }

#yz-chat-input-area {
    display: flex; padding: 12px; gap: 8px;
    border-top: 1px solid #e2e8f0; background: white; flex-shrink: 0;
}
#yz-chat-input {
    flex: 1; border: 1px solid #d1d5db; border-radius: 24px;
    padding: 10px 16px; font-size: 14px; outline: none;
    transition: border-color 0.2s;
    background: #ffffff !important; color: #1e293b !important;
    -webkit-appearance: none;
}
#yz-chat-input::placeholder { color: #94a3b8 !important; }
#yz-chat-input:focus { border-color: #2563eb; background: #ffffff !important; }
#yz-chat-send {
    width: 40px; height: 40px; border-radius: 50%;
    background: #2563eb; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; flex-shrink: 0;
}
#yz-chat-send:hover { background: #1d4ed8; }
#yz-chat-send svg { width: 18px; height: 18px; fill: white; }

/* Contact form inside chat */
.yz-contact-form { margin-top: 8px; }
.yz-contact-form input, .yz-contact-form textarea {
    width: 100%; padding: 8px 12px; margin-bottom: 8px;
    border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px;
    font-family: inherit; box-sizing: border-box;
}
.yz-contact-form textarea { height: 60px; resize: none; }
.yz-contact-form button {
    background: #2563eb; color: white; border: none;
    padding: 8px 20px; border-radius: 8px; cursor: pointer;
    font-size: 13px; width: 100%;
}
.yz-contact-form button:hover { background: #1d4ed8; }

@media (max-width: 480px) {
    #yz-chat-box { right: 0; bottom: 0; width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
    #yz-chat-btn { bottom: 16px; right: 16px; }
}
