/* Susan's Kitchen Chatbot Pro - Enhanced Styles */

/* Floating Widget Container */
#susans-chatbot-widget {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Position Classes */
.susans-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

.susans-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

.susans-widget-top-right {
    top: 20px;
    right: 20px;
}

.susans-widget-top-left {
    top: 20px;
    left: 20px;
}

/* Chat Button */
.susans-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8787 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.susans-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.susans-chat-button .chat-icon,
.susans-chat-button .close-icon {
    font-size: 28px;
    color: white;
    position: absolute;
    transition: all 0.3s ease;
}

.susans-chat-button .close-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.susans-chat-button.active .chat-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.susans-chat-button.active .close-icon {
    opacity: 1;
    transform: rotate(0);
}

/* Chat Badge */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4CAF50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Chat Popup */
.susans-chat-popup {
    position: absolute;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

/* Adjust popup position based on widget position */
.susans-widget-bottom-right .susans-chat-popup {
    bottom: 80px;
    right: 0;
}

.susans-widget-bottom-left .susans-chat-popup {
    bottom: 80px;
    left: 0;
}

.susans-widget-top-right .susans-chat-popup {
    top: 80px;
    right: 0;
}

.susans-widget-top-left .susans-chat-popup {
    top: 80px;
    left: 0;
}

.susans-chat-popup.active {
    display: flex;
}

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

/* Chat Header */
.chat-header {
    padding: 16px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header-content h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
    display: inline-block;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Content */
.chat-iframe-container {
    flex: 1;
    position: relative;
    background: #f5f5f5;
}

.chat-iframe-container iframe {
    width: 100%;
    height: 100%;
}

/* Chat Footer */
.chat-footer {
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    flex-shrink: 0;
}

.chat-footer small {
    color: #666;
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .susans-chat-popup {
        width: 100vw;
        height: 100vh;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0;
        position: fixed;
    }
    
    .susans-chat-button {
        width: 56px;
        height: 56px;
    }
    
    .susans-widget-bottom-right,
    .susans-widget-bottom-left {
        bottom: 10px;
    }
    
    .susans-widget-bottom-right {
        right: 10px;
    }
    
    .susans-widget-bottom-left {
        left: 10px;
    }
}

/* Embed Styles */
.susans-chatbot-embed {
    position: relative;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
}

.susans-menu-chat {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border-radius: 10px;
    margin: 20px 0;
}

/* Popup Button */
.susans-chatbot-popup-trigger {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.susans-chatbot-popup-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Loading Animation */
.chat-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: white;
}

.chat-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #FF6B6B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Welcome Message Bubble */
.chat-welcome-bubble {
    position: absolute;
    bottom: 90px;
    right: 0;
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 250px;
    animation: fadeInBubble 0.5s ease;
    display: none;
}

.chat-welcome-bubble.show {
    display: block;
}

.chat-welcome-bubble::after {
    content: "";
    position: absolute;
    bottom: -8px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@keyframes fadeInBubble {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Print Styles */
@media print {
    #susans-chatbot-widget {
        display: none !important;
    }
}
