/* LoveYou Chatbot Widget Styles */

#loveyou-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Positioning */
#loveyou-chatbot-container.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#loveyou-chatbot-container.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

#loveyou-chatbot-container.position-top-right {
    top: 20px;
    right: 20px;
}

#loveyou-chatbot-container.position-top-left {
    top: 20px;
    left: 20px;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary, #E91E63) 0%, var(--chatbot-secondary, #880E4F) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.chatbot-toggle svg {
    transition: transform 0.3s ease;
}

.chatbot-closed .chatbot-toggle svg {
    transform: scale(1);
}

.chatbot-open .chatbot-toggle svg {
    transform: rotate(90deg) scale(0);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-open .chatbot-window {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.position-bottom-left .chatbot-window,
.position-top-left .chatbot-window {
    right: auto;
    left: 0;
}

.position-top-right .chatbot-window,
.position-top-left .chatbot-window {
    bottom: auto;
    top: 80px;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary, #E91E63) 0%, var(--chatbot-secondary, #880E4F) 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.chatbot-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: white;
    color: var(--chatbot-text, #333);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.user .message-bubble {
    background: var(--chatbot-primary, #E91E63);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply-btn {
    background: white;
    border: 2px solid var(--chatbot-primary, #E91E63);
    color: var(--chatbot-primary, #E91E63);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: var(--chatbot-primary, #E91E63);
    color: white;
}

/* Buttons */
.chatbot-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-btn {
    background: var(--chatbot-primary, #E91E63);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-weight: 500;
}

.chatbot-btn:hover {
    background: var(--chatbot-secondary, #880E4F);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Typing Indicator */
.chatbot-typing {
    padding: 12px 20px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary, #E91E63);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--chatbot-primary, #E91E63);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send:hover:not(:disabled) {
    background: var(--chatbot-secondary, #880E4F);
    transform: scale(1.1);
}

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

/* Footer */
.chatbot-footer {
    padding: 10px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 16px 16px;
}

.chatbot-footer strong {
    color: var(--chatbot-primary, #E91E63);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #loveyou-chatbot-container {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
    }
    
    .chatbot-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
    }
    
    .chatbot-header {
        border-radius: 0;
    }
    
    .chatbot-footer {
        border-radius: 0;
    }
}

/* Form in chat */
.chatbot-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-form input {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-form input:focus {
    border-color: var(--chatbot-primary, #E91E63);
}

.chatbot-form button {
    background: var(--chatbot-primary, #E91E63);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-form button:hover {
    background: var(--chatbot-secondary, #880E4F);
}

/* Menu Styles */
.chatbot-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
    max-width: 85%;
}

.menu-section {
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.menu-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--chatbot-secondary, #880E4F);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.menu-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    border: 2px solid #e8e8e8;
    color: var(--chatbot-text, #333);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.menu-btn:hover {
    background: linear-gradient(135deg, var(--chatbot-primary, #E91E63) 0%, var(--chatbot-secondary, #880E4F) 100%);
    color: white;
    border-color: var(--chatbot-primary, #E91E63);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn-primary {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--chatbot-primary, #E91E63) 0%, var(--chatbot-secondary, #880E4F) 100%);
    color: white;
    border-color: var(--chatbot-primary, #E91E63);
    justify-content: center;
    font-weight: 600;
}

.menu-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(233, 30, 99, 0.4);
}

/* Back to Menu Button */
.back-to-menu-btn {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px solid #d0d0d0;
    color: var(--chatbot-text, #333);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
}

.back-to-menu-btn:hover {
    background: linear-gradient(135deg, var(--chatbot-primary, #E91E63) 0%, var(--chatbot-secondary, #880E4F) 100%);
    color: white;
    border-color: var(--chatbot-primary, #E91E63);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.quick-reply-btn.back-btn {
    background: #f5f5f5;
    border-color: #d0d0d0;
    color: #666;
    font-weight: 600;
}

.quick-reply-btn.back-btn:hover {
    background: var(--chatbot-primary, #E91E63);
    border-color: var(--chatbot-primary, #E91E63);
    color: white;
}

.chatbot-btn.back-btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #d0d0d0;
    margin-top: 8px;
}

.chatbot-btn.back-btn-secondary:hover {
    background: var(--chatbot-primary, #E91E63);
    color: white;
    border-color: var(--chatbot-primary, #E91E63);
}

/* Mobile adjustments for menu */
@media (max-width: 480px) {
    .chatbot-menu {
        max-width: 95%;
    }
    
    .menu-buttons {
        grid-template-columns: 1fr;
    }
}
