/**
 * VodaBG ChatBot - Frontend Styles
 */

.vodabg-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Launcher Button */
.vodabg-chatbot-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    animation: vodabg-chatbot-bounce-in 0.5s ease;
}

.vodabg-chatbot-launcher:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.5);
}

.vodabg-chatbot-launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    padding: 0 5px;
}

@keyframes vodabg-chatbot-bounce-in {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Chat Window */
.vodabg-chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: vodabg-chatbot-slide-up 0.3s ease;
}

@keyframes vodabg-chatbot-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header */
.vodabg-chatbot-header {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.vodabg-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vodabg-chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.vodabg-chatbot-header-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.vodabg-chatbot-header-status {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.vodabg-chatbot-status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.vodabg-chatbot-header-actions {
    display: flex;
    gap: 4px;
}

.vodabg-chatbot-header-actions button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.vodabg-chatbot-header-actions button:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Pre-chat Form */
.vodabg-chatbot-prechat {
    padding: 24px 20px;
    flex: 1;
    overflow-y: auto;
}

.vodabg-chatbot-welcome-text {
    color: #444;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.vodabg-chatbot-prechat-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vodabg-chatbot-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.vodabg-chatbot-field input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e1e4e8;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.vodabg-chatbot-field input[type="text"]:focus {
    outline: none;
    border-color: #1a73e8;
}

.vodabg-chatbot-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    font-weight: normal;
}

.vodabg-chatbot-field-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.vodabg-chatbot-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid #ef4444;
}

.vodabg-chatbot-btn-primary {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.vodabg-chatbot-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.vodabg-chatbot-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.vodabg-chatbot-privacy-note {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

.vodabg-chatbot-privacy-note a {
    color: #1a73e8;
    text-decoration: none;
}

/* Chat Body */
.vodabg-chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f6f8fa;
}

.vodabg-chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vodabg-chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    animation: vodabg-chatbot-fade-in 0.3s;
}

@keyframes vodabg-chatbot-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.vodabg-chatbot-msg-bot {
    background: #fff;
    color: #222;
    border-radius: 14px 14px 14px 4px;
    align-self: flex-start;
    border: 1px solid #e1e4e8;
}

.vodabg-chatbot-msg-user {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    border-radius: 14px 14px 4px 14px;
    align-self: flex-end;
}

.vodabg-chatbot-msg-system {
    background: transparent;
    color: #888;
    font-style: italic;
    font-size: 12px;
    text-align: center;
    align-self: center;
    padding: 4px 10px;
}

.vodabg-chatbot-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 14px 14px 14px 4px;
}

.vodabg-chatbot-typing span {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: vodabg-chatbot-typing-bounce 1.4s infinite;
}

.vodabg-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.vodabg-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes vodabg-chatbot-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Suggestions */
.vodabg-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.vodabg-chatbot-suggestion {
    background: #fff;
    border: 1.5px solid #1a73e8;
    color: #1a73e8;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.vodabg-chatbot-suggestion:hover {
    background: #1a73e8;
    color: #fff;
}

/* Input Area */
.vodabg-chatbot-input-area {
    border-top: 1px solid #e1e4e8;
    padding: 12px;
    background: #fff;
    flex-shrink: 0;
}

.vodabg-chatbot-message-form {
    display: flex;
    gap: 8px;
}

#vodabg-chatbot-message-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e1e4e8;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#vodabg-chatbot-message-input:focus {
    border-color: #1a73e8;
}

.vodabg-chatbot-btn-send {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.vodabg-chatbot-btn-send:hover {
    transform: scale(1.05);
}

.vodabg-chatbot-btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vodabg-chatbot-quick-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.vodabg-chatbot-btn-link {
    background: transparent;
    border: none;
    color: #1a73e8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    font-family: inherit;
    text-decoration: underline;
}

.vodabg-chatbot-btn-link:hover {
    color: #0d47a1;
}

#vodabg-chatbot-human-btn {
    font-weight: 700;
}

/* Footer */
.vodabg-chatbot-footer {
    background: #f6f8fa;
    padding: 8px 16px;
    border-top: 1px solid #e1e4e8;
    text-align: center;
    color: #888;
    font-size: 11px;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .vodabg-chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    .vodabg-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        bottom: 10px;
        right: 10px;
        border-radius: 12px;
    }
    
    .vodabg-chatbot-launcher {
        width: 56px;
        height: 56px;
    }
}
