/* CS Bot AI Styles - Improved Version */

.cs-bot-ai-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}


.cs-bot-ai-floating-btn {
    position: block;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
}


/* Tombol disembunyikan saat chat dibuka */
.cs-bot-ai-chat-container.active + .cs-bot-ai-floating-btn {
    display: none;
}

.cs-bot-ai-floating-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 30px rgba(109, 109, 109, 0.6);
}

.cs-bot-ai-floating-btn i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.cs-bot-ai-floating-btn.active i {
    transform: rotate(360deg);
}

.cs-bot-ai-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    max-width: 90vw;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
    border: 1px solid #e0e0e0;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
    visibility: hidden;
}

.cs-bot-ai-chat-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.cs-bot-ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: white;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.cs-bot-ai-chat-header h1 {
    font-size: 1.3em;
    margin-bottom: 5px;
    color: #4facfe;
    font-weight: 600;
}

.cs-bot-ai-chat-header p {
    color: #666;
    font-size: 0.8em;
}

.cs-bot-ai-close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 6px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-bot-ai-close-btn:hover {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
}

.cs-bot-ai-clear-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s;
}

.cs-bot-ai-clear-btn:hover {
    background: #4facfe;
    color: white;
    border-color: #4facfe;
}

.cs-bot-ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cs-bot-ai-message {
    display: flex;
    max-width: 80%;
    animation: cs-bot-ai-fadeIn 0.3s ease-in;
}

.cs-bot-ai-message.user {
    align-self: flex-end;
}

.cs-bot-ai-message.assistant {
    align-self: flex-start;
}

.cs-bot-ai-message-content {
    padding: 12px 18px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cs-bot-ai-message.user .cs-bot-ai-message-content {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.cs-bot-ai-message.assistant .cs-bot-ai-message-content {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 5px;
}

/* Improved formatting for structured content */
.cs-bot-ai-message-content h3, 
.cs-bot-ai-message-content h4 {
    margin: 10px 0 5px 0;
    color: #2c3e50;
}

.cs-bot-ai-message-content ul, 
.cs-bot-ai-message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.cs-bot-ai-message-content li {
    margin-bottom: 5px;
    line-height: 1.4;
}

.cs-bot-ai-message-content .product-list {
    margin: 10px 0;
}

.cs-bot-ai-message-content .product-item {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e0e0e0;
}

.cs-bot-ai-message-content .product-item:last-child {
    border-bottom: none;
}

.cs-bot-ai-message-content .product-title {
    font-weight: bold;
    color: #4facfe;
    display: block;
    margin-bottom: 5px;
}

.cs-bot-ai-message-content .product-features {
    margin: 5px 0;
    padding-left: 15px;
}

.cs-bot-ai-message-content .product-feature {
    position: relative;
    padding-left: 15px;
    margin-bottom: 3px;
}

.cs-bot-ai-message-content .product-feature:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4facfe;
}

.cs-bot-ai-message-content .benefits-section {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border-left: 3px solid #4facfe;
}

.cs-bot-ai-message-timestamp {
    font-size: 0.7em;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

.cs-bot-ai-chat-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.cs-bot-ai-message-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    outline: none;
    font-size: 0.9em;
    transition: border-color 0.3s;
    background: #f8f9fa;
}

.cs-bot-ai-message-input:focus {
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.cs-bot-ai-send-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.cs-bot-ai-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.cs-bot-ai-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cs-bot-ai-typing-indicator {
    display: none;
    padding: 12px 18px;
    background: #f8f9fa;
    border-radius: 20px;
    margin: 10px 0;
    margin-left: 20px;
    border: 1px solid #e9ecef;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cs-bot-ai-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.cs-bot-ai-typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: cs-bot-ai-typing 1.4s infinite;
}

.cs-bot-ai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.cs-bot-ai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.cs-bot-ai-typing-text {
    font-size: 0.8em;
    color: #666;
    margin-left: 10px;
}

@keyframes cs-bot-ai-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@keyframes cs-bot-ai-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cs-bot-ai-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: bold;
    animation: cs-bot-ai-pulse 2s infinite;
}

.idle-message {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-style: italic;
    color: #856404;
}

.idle-message::before {
    content: "⏰ ";
    margin-right: 5px;
}

@keyframes cs-bot-ai-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cs-bot-ai-chat-container {
        width: 100vw;
        right: 10px;
        bottom: 10px;
        height: 80vh;
    }
    
    .cs-bot-ai-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .cs-bot-ai-floating-btn i {
        font-size: 20px;
    }
    
    .cs-bot-ai-message {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .cs-bot-ai-chat-container {
        width: 100%;       /* lebar penuh */
        height: 80vh;       /* tinggi 80% */
        max-height: 80vh;
        bottom: 10px;       /* jarak bawah 30px */
        right: 10px;
        border-radius: 10px; /* bisa diatur sesuai desain */
        border: 1px solid #ccc; /* opsional */
    }
    
    .cs-bot-ai-message-content {
        padding: 10px 14px;
        font-size: 0.95em;
    }
}
