/* ===== Chat Widget ===== */
.chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #00A0AF;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.chat-bubble svg {
    width: 34px;
    height: 34px;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 112px;
    right: 24px;
    z-index: 9001;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chat Header */
.chat-header {
    background: #141E51;
    color: #fff;
    padding: 20px;
    flex-shrink: 0;
}

.chat-header h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.chat-header p {
    font-size: 0.8rem;
    opacity: 0.75;
    line-height: 1.4;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 300px;
}

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

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

.chat-msg.bot {
    align-self: flex-start;
    background: #F0F0F0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-msg.typing {
    align-self: flex-start;
    background: #F0F0F0;
    color: #999;
    font-style: italic;
}

/* Input Area */
.chat-input-area {
    display: flex;
    border-top: 1px solid #E0E0E0;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}

.chat-input::placeholder {
    color: #999;
}

.chat-send {
    background: #00A0AF;
    color: #fff;
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send:hover {
    background: #008D9A;
}

.chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-send svg {
    width: 20px;
    height: 20px;
}

/* Online label */
.chat-label {
    position: fixed;
    bottom: 40px;
    right: 108px;
    z-index: 9000;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    animation: chat-label-fade 1s ease 2s both;
}

.chat-label.hidden {
    display: none;
}

@keyframes chat-label-fade {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        right: 8px;
        left: 8px;
        bottom: 90px;
        width: auto;
        max-height: 70vh;
    }
}
