/* Chatbot Floating Action Button (FAB) */
#turpone-chat-fab {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#turpone-chat-fab:hover {
    transform: scale(1.05);
    background-color: #333;
}

#turpone-chat-fab svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

/* Chatbot Window */
#turpone-chat-window {
    position: fixed;
    bottom: 160px;
    right: 30px;
    width: 350px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 180px);
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* Header */
.turpone-chat-header {
    background-color: #000;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.turpone-chat-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
}

.turpone-chat-header-info p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #ccc;
    font-family: inherit;
}

.turpone-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Messages Area */
.turpone-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.turpone-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    font-family: inherit;
}

.turpone-chat-bubble.user {
    background-color: #000;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.turpone-chat-bubble.assistant {
    background-color: #e5e5ea;
    color: #000;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Input Area */
.turpone-chat-input-area {
    padding: 12px;
    background-color: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.turpone-chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

.turpone-chat-input-area input:focus {
    border-color: #000;
}

.turpone-chat-input-area button {
    background-color: #000 !important;
    color: #fff !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: background-color 0.2s;
}

.turpone-chat-input-area button:hover {
    background-color: #333 !important;
}

.turpone-chat-input-area button svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    fill: #fff !important;
    margin-left: 2px !important;
}

/* Typing Indicator */
.turpone-typing-indicator {
    display: none;
    align-self: flex-start;
    background-color: #e5e5ea;
    padding: 12px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.turpone-typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #8e8e93;
    border-radius: 50%;
    margin: 0 2px;
    animation: turpone-typing 1.4s infinite ease-in-out both;
}

.turpone-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.turpone-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes turpone-typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
