/* ============================================
   GORENT AI CHATBOT - FLOATING BUTTON & POPUP
   ============================================ */

/* CHAT POPUP CONTAINER */
#chatPopup {
    position: fixed;
    bottom: 140px; /* Di atas tombol GoRent AI (7.5rem + margin) */
    right: 25px;
    width: 360px;
    max-width: calc(100vw - 50px);
    height: 520px;
    max-height: calc(100vh - 200px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chatPopup.show {
    display: flex;
}

/* CHAT HEADER */
#chatHeader {
    background: linear-gradient(135deg, #ff7f2a 0%, #ff6a00 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatHeaderLeft {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chatHeader h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

#clearSessionBtn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s ease;
}

#clearSessionBtn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#closeChat {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#closeChat:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* CHAT MESSAGES AREA */
#chatMessages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
}

/* Custom scrollbar */
#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#chatMessages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* MESSAGE BUBBLE */
.message {
    margin-bottom: 12px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-content {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* TYPING INDICATOR */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* CHAT INPUT AREA */
#chatInputArea {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

#chatInput {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#chatInput:focus {
    border-color: #ff7f2a;
}

#sendButton {
    padding: 10px 20px;
    background: #ff7f2a;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#sendButton:hover {
    background: #ff6a00;
    transform: scale(1.05);
}

#sendButton:active {
    transform: scale(0.95);
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* MOBILE RESPONSIVE */
@media (max-width: 640px) {
    #chatPopup {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
        height: 480px;
    }
}
