/**
 * Frontend Styles
 * File: assets/css/frontend.css
 */

#aicb-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.aicb-position-bottom-right { bottom: 20px; right: 20px; }
.aicb-position-bottom-left { bottom: 20px; left: 20px; }

/* Toggle Button */
.aicb-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.25s ease;
}

.aicb-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.aicb-toggle-btn svg { width: 26px; height: 26px; }
.aicb-icon-close { display: none; }
.aicb-toggle-btn.active .aicb-icon-chat { display: none; }
.aicb-toggle-btn.active .aicb-icon-close { display: block; }

/* Window */
.aicb-chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(0,0,0,0.16);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.aicb-position-bottom-right .aicb-chatbot-window { right: 0; }
.aicb-position-bottom-left .aicb-chatbot-window { left: 0; }
.aicb-chatbot-window.active { display: flex; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.aicb-header {
    padding: 16px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aicb-header-content { display: flex; align-items: center; gap: 12px; }

.aicb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aicb-avatar svg { width: 20px; height: 20px; }
.aicb-header-text h3 { margin: 0; font-size: 16px; font-weight: 700; }
.aicb-status { font-size: 12px; opacity: 0.9; }
.aicb-minimize-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
}

/* Messages */
.aicb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F9FAFB;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aicb-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 15px; /* Larger text */
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.aicb-message-bot {
    background: #fff;
    color: #374151;
    align-self: flex-start;
    border: 1px solid #E5E7EB;
    border-bottom-left-radius: 4px;
}

.aicb-message-user {
    /* Color handled by JS now */
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing Dots */
.aicb-message-typing { padding: 16px; display: flex; gap: 4px; align-items: center; }
.aicb-typing-dot {
    width: 6px;
    height: 6px;
    background: #9CA3AF;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}
.aicb-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.aicb-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Input */
.aicb-input-area {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #F3F4F6;
}

#aicb-message-form { display: flex; gap: 10px; }

.aicb-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #F9FAFB;
}

.aicb-input:focus { border-color: #667eea; background: #fff; }

.aicb-send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aicb-send-btn svg { width: 20px; height: 20px; }
.aicb-powered-by { text-align: center; font-size: 11px; color: #9CA3AF; margin-top: 8px; }

@media (max-width: 480px) {
    .aicb-chatbot-window { width: calc(100vw - 40px); height: calc(100vh - 100px); }
}