/**
 * ComCart Chatbot Styles
 *
 * @category  ComCart
 * @package   ComCart_Chatbot
 * @author    ComCart
 * @copyright Copyright (c) 2026 ComCart
 */

/* Chatbot Container */
#comcart-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Toggle Button (Icon) */
.comcart-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.comcart-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.comcart-chatbot-toggle:active {
    transform: scale(0.95);
}

.comcart-chatbot-toggle svg {
    transition: opacity 0.2s ease;
}

/* Chatbot Window */
.comcart-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 450px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.comcart-chatbot-header {
    padding: 16px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.comcart-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.minimize-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.minimize-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chatbot Body */
.comcart-chatbot-body {
    flex: 1;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

#comcart-chatbot-react-root {
    height: inherit;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 1rem;
}

#comcart-chatbot-react-root > div {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Override fullscreen utility classes inside widget */
#comcart-chatbot-react-root .min-h-screen {
    min-height: 100% !important;
}

#comcart-chatbot-react-root .h-screen {
    height: 100% !important;
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

.loading-message p {
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .comcart-chatbot-window {
        width: calc(100vw - 40px);
        height: 400px;
        max-height: calc(100vh - 140px);
        right: -10px;
    }
}

@media (max-width: 480px) {
    #comcart-chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .comcart-chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .comcart-chatbot-window {
        position: fixed;
        bottom: 80px;
        right: 10px;
        left: 10px;
        width: auto;
        height: calc(100vh - 100px);
        max-height: none;
    }

    .comcart-chatbot-header {
        padding: 12px 16px;
    }

    .comcart-chatbot-header h3 {
        font-size: 16px;
    }
}
