/**
 * YourBeans Chatbot Styles
 * Coffee-themed, professional chat widget
 */

/* Chatbot Widget Container */
.yourbeans-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Toggle Button */
.chatbot-toggle button {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
    transition: all 0.3s ease;
}

.chatbot-toggle button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
    background: linear-gradient(135deg, #A0522D, #DEB887);
}

.chatbot-icon {
    font-size: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    max-height: calc(100vh - 100px);
}

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

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white !important;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #D2691E;
    border-radius: 3px;
}

/* Chat Messages */
.chat-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

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

.bot-message {
    display: flex;
    justify-content: flex-start;
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.bot-message p,
.user-message p {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    margin: 0;
    word-wrap: break-word;
}

.bot-message p {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.user-message p {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #8B4513;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    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);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chatbot-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chatbot-input form {
    display: flex;
    gap: 10px;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chatbot-input input:focus {
    border-color: #8B4513;
}

.chatbot-input button {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.chatbot-input button:hover {
    background: linear-gradient(135deg, #A0522D, #DEB887);
}

/* Quick Actions */
.chatbot-quick-actions {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 15px 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-action {
    background: white;
    border: 1px solid #8B4513;
    color: #8B4513;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-action:hover {
    background: #8B4513;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 70px;
    }
    
    .chatbot-toggle {
        right: 10px;
        bottom: 10px;
    }
}

/* Notification Badge */
.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Contact Form */
.chatbot-contact-form {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.chatbot-contact-form .form-header {
    text-align: center;
    margin-bottom: 15px;
}

.chatbot-contact-form .form-header h4 {
    margin: 0 0 5px 0;
    color: #8b4513;
    font-size: 16px;
}

.chatbot-contact-form .form-header p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.chatbot-contact-form .form-group {
    margin-bottom: 12px;
}

.chatbot-contact-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.chatbot-contact-form input:focus {
    outline: none;
    border-color: #c8956d;
    box-shadow: 0 0 0 2px rgba(200, 149, 109, 0.2);
}

.chatbot-contact-form .form-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

.chatbot-contact-form .btn-submit {
    background: #c8956d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.chatbot-contact-form .btn-submit:hover {
    background: #b8804d;
}

.chatbot-contact-form .btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.chatbot-contact-form .btn-cancel:hover {
    background: #5a6268;
}