/* ===== Floating Chat Widget ===== */

/* ── Trigger Button ── */
.floating-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #0A0A1A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(10, 10, 26, 0.3);
    transition: all 250ms ease;
    z-index: 9998;
    border: none;
}

.floating-chat-button:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 32px rgba(10, 10, 26, 0.4);
    background: #1C1C30;
}

.floating-chat-button svg {
    width: 24px;
    height: 24px;
    stroke: #FFFFFF;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 250ms ease;
}

.floating-chat-button.active {
    background: #1C1C30;
}

/* ── Chat Window ── */
.floating-chat-window {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 376px;
    max-width: calc(100vw - 48px);
    height: 580px;
    max-height: calc(100vh - 120px);
    background: #FFFFFF;
    border-radius: 20px;
    border: 1.5px solid #DCDCE8;
    box-shadow: 0 24px 60px rgba(10, 10, 26, 0.18), 0 4px 16px rgba(10, 10, 26, 0.08);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.floating-chat-window.active {
    display: flex;
    animation: chatSlideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ── */
.floating-chat-header {
    background: #0A0A1A;
    color: #FFFFFF;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.floating-chat-header::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(230, 62, 122, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.floating-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.floating-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(230, 62, 122, 0.15);
    border-radius: 50%;
    border: 1.5px solid rgba(230, 62, 122, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.floating-chat-header-text h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
    color: #FFFFFF;
}

.floating-chat-header-text p {
    font-size: 12px;
    margin: 3px 0 0 0;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    gap: 5px;
}

.floating-chat-header-text p::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #4ADE80;
    border-radius: 50%;
    flex-shrink: 0;
}

.floating-chat-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms ease;
    position: relative;
    z-index: 1;
}

.floating-chat-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.floating-chat-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ── Chat Body ── */
.floating-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    background: #F4F4F9;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
}

.floating-chat-body::-webkit-scrollbar {
    width: 4px;
}

.floating-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.floating-chat-body::-webkit-scrollbar-thumb {
    background: #DCDCE8;
    border-radius: 4px;
}

/* ── Messages ── */
.floating-chat-message {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.floating-chat-message.bot {
    flex-direction: row;
    align-items: flex-end;
}

.floating-chat-message.user {
    flex-direction: row-reverse;
    align-items: flex-end;
}

.floating-chat-message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(230, 62, 122, 0.12);
    border: 1.5px solid rgba(230, 62, 122, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.floating-chat-message.user .floating-chat-message-avatar {
    background: #EAEAF2;
    border-color: #DCDCE8;
}

.floating-chat-message-content {
    max-width: 74%;
    display: flex;
    flex-direction: column;
}

.floating-chat-message.user .floating-chat-message-content {
    align-items: flex-end;
}

.floating-chat-message-bubble {
    padding: 11px 14px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}

.floating-chat-message.bot .floating-chat-message-bubble {
    background: #FFFFFF;
    color: #0A0A1A;
    border-radius: 16px 16px 16px 4px;
    border: 1.5px solid #EAEAF2;
    box-shadow: 0 1px 4px rgba(10, 10, 26, 0.05);
}

.floating-chat-message.user .floating-chat-message-bubble {
    background: #0A0A1A;
    color: #FFFFFF;
    border-radius: 16px 16px 4px 16px;
}

.floating-chat-message-time {
    font-size: 11px;
    color: #8C8C9E;
    margin-top: 4px;
    padding: 0 2px;
}

/* ── Quick Replies ── */
.floating-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.floating-chat-quick-reply {
    padding: 7px 14px;
    background: #FFFFFF;
    border: 1.5px solid #DCDCE8;
    border-radius: 999px;
    font-size: 12.5px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #E63E7A;
    cursor: pointer;
    transition: all 200ms ease;
}

.floating-chat-quick-reply:hover {
    background: #E63E7A;
    border-color: #E63E7A;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 62, 122, 0.3);
}

/* ── Footer / Input ── */
.floating-chat-footer {
    padding: 14px 16px;
    background: #FFFFFF;
    border-top: 1px solid #EAEAF2;
    flex-shrink: 0;
}

.floating-chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.floating-chat-input {
    flex: 1;
    padding: 10px 16px;
    background: #F4F4F9;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: #0A0A1A;
    outline: none;
    transition: all 200ms ease;
}

.floating-chat-input::placeholder {
    color: #8C8C9E;
}

.floating-chat-input:focus {
    background: #FFFFFF;
    border-color: #0A0A1A;
}

.floating-chat-send {
    width: 38px;
    height: 38px;
    background: #E63E7A;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 200ms ease;
    box-shadow: 0 2px 8px rgba(230, 62, 122, 0.35);
}

.floating-chat-send:hover {
    background: #C82D65;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(230, 62, 122, 0.45);
}

.floating-chat-send svg {
    width: 17px;
    height: 17px;
    stroke: #FFFFFF;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Typing Indicator ── */
.floating-chat-typing {
    display: flex;
    gap: 4px;
    padding: 4px 2px;
    align-items: center;
}

.floating-chat-typing span {
    width: 7px;
    height: 7px;
    background: #8C8C9E;
    border-radius: 50%;
    animation: chatTypingDot 1.4s infinite;
    display: block;
}

.floating-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.floating-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatTypingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .floating-chat-button {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }

    .floating-chat-window {
        bottom: 82px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        border-radius: 16px;
    }
}
