/* Tombol Clear History */
.chat-clear-btn {
    background: none !important;
    border: none !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s !important;
    padding: 0 8px !important;
}

.chat-clear-btn:hover {
    opacity: 1 !important;
    color: #ff6b6b !important;
}

.chat-header {
    display: flex;
    align-items: center;
}

.chat-header h4 {
    flex: 1;
}

.chat-close-btn {
    margin-left: auto;
}

/* ============================================
   QUICK REPLY BUTTONS
   ============================================ */
.quick-reply-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0 4px 0;
    padding: 8px 12px;
    background: #f0f7f3;
    border-radius: 10px;
    border: 1px solid #d4e8d8;
    max-width: 100%;
}

.quick-reply-container.inline {
    background: transparent;
    border: none;
    padding: 8px 0 0 0;
    margin: 6px 0 0 0;
    border-top: 1px solid #eee;
}

.quick-reply-label {
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 2px;
}

.quick-reply-label i {
    color: #d4a847;
}

.quick-reply-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-reply-btn {
    padding: 6px 14px;
    border: 2px solid #d4a847;
    border-radius: 20px;
    background: #fff;
    color: #1a6e3a;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: #1a6e3a;
    color: #fff;
    border-color: #1a6e3a;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(26, 110, 58, 0.2);
}

.quick-reply-btn.small {
    padding: 4px 12px;
    font-size: 0.7rem;
    border-color: #ccc;
    color: #555;
}

.quick-reply-btn.small:hover {
    background: #1a6e3a;
    color: #fff;
    border-color: #1a6e3a;
}

/* Responsive */
@media (max-width: 480px) {
    .quick-reply-wrapper {
        gap: 4px;
    }
    
    .quick-reply-btn {
        padding: 5px 10px;
        font-size: 0.65rem;
        white-space: normal;
        flex: 1 1 auto;
        min-width: 60px;
        text-align: center;
    }
    
    .quick-reply-btn.small {
        padding: 4px 8px;
        font-size: 0.6rem;
    }
}



/* ============================================
   FEEDBACK BUTTONS
   ============================================ */
.chat-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.chat-feedback .feedback-label {
    color: #888;
    font-size: 0.7rem;
    margin-right: 4px;
}

.chat-feedback .feedback-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #fff;
}

.chat-feedback .feedback-btn:hover:not(:disabled) {
    transform: scale(1.15);
    border-color: #999;
}

.chat-feedback .feedback-btn.yes:hover:not(:disabled) {
    background: #d4edda;
    border-color: #28a745;
}

.chat-feedback .feedback-btn.no:hover:not(:disabled) {
    background: #f8d7da;
    border-color: #dc3545;
}

.chat-feedback .feedback-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Untuk pesan bot yang memiliki feedback */
.chat-msg.bot .chat-feedback {
    border-top-color: #e8e0d0;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-feedback {
        font-size: 0.65rem;
        gap: 5px;
    }
    .chat-feedback .feedback-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}




/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}
.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-window {
        bottom: 80px;
        right: 10px;
        width: calc(100vw - 20px);
        height: 600px;
    }
    
    .chat-toggle-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}




/* Widget Floating Button */
#pgni-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a6e3a, #2d8f52);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chat-toggle-btn:hover {
    transform: scale(1.08);
}

/* Chat Box Window */
.chat-window {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border: 1px solid #e0e0e0;
}

.chat-window.active {
    display: flex;
}

/* Header */
.chat-header {
    background: #1a6e3a;
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #d4a847;
}

.chat-header h4 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Body / Logs */
.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.chat-msg.bot {
    background: #ffffff;
    color: #333;
    align-self: flex-start;
    border-left: 3px solid #d4a847;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chat-msg.user {
    background: #1a6e3a;
    color: #fff;
    align-self: flex-end;
}

/* Footer / Input */
.chat-footer {
    display: flex;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #eee;
}

.chat-footer input {
    flex: 1;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 20px;
    outline: none;
    font-size: 0.85rem;
}

.chat-footer button {
    background: #1a6e3a;
    color: #fff;
    border: none;
    padding: 8px 15px;
    margin-left: 5px;
    border-radius: 50%;
    cursor: pointer;
}