/* Chat Widget Styles */
#auto-category-chat {
    position: fixed;
    width: 350px;
    max-height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Exo 2', Arial, sans-serif;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#auto-category-chat.chat-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Position classes */
.chat-position-bottom_right {
    bottom: 20px;
    right: 20px;
}

.chat-position-bottom_left {
    bottom: 20px;
    left: 20px;
}

.chat-position-top_right {
    top: 20px;
    right: 20px;
}

.chat-position-top_left {
    top: 20px;
    left: 20px;
}

.chat-header {
    background-color: #007cba;
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: bold;
    font-size: 16px;
}

.chat-close {
    font-size: 24px;
    cursor: pointer;
    user-select: none;
}

.chat-body {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100% - 50px);
}

.chat-message {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    max-width: 80%;
    font-size: 14px;
    font-family: 'Exo 2', Arial, sans-serif;
}

.bot-message {
    background-color: #f1f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-message {
    background-color: #007cba;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.view-offers-btn {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 15px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 16px;
    margin-top: 10px;
    width: 100%;
    font-family: 'Exo 2', Arial, sans-serif;
}

.view-offers-btn:hover {
    background-color: #218838;
}

.view-offers-btn:active {
    transform: translateY(1px);
}

.back-to-brands-btn {
    background-color: #6c757d; /* Gray background */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    margin-top: 10px;
    width: 100%;
    font-family: 'Exo 2', Arial, sans-serif;
    margin-bottom: 5px;
}

.back-to-brands-btn:hover {
    background-color: #5a6268; /* Darker gray on hover */
}

.back-to-brands-btn:active {
    transform: translateY(1px);
}

.category-btn {
    background-color: #007cba; /* Blue background */
    color: #ffffff; /* White text */
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-family: 'Exo 2', Arial, sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-btn:hover {
    background-color: #006994; /* Darker blue on hover */
    opacity: 0.9;
}

.category-btn:active {
    transform: translateY(1px);
}

/* Open Icon Styles */
.chat-open-icon {
    position: fixed;
    width: 60px;
    height: 60px;
    background-color: #007cba;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    line-height: 1;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-open-icon.visible {
    opacity: 1;
    transform: scale(1);
}

.chat-open-icon.chat-position-bottom_right {
    bottom: 20px;
    right: 20px;
}

.chat-open-icon.chat-position-bottom_left {
    bottom: 20px;
    left: 20px;
}

.chat-open-icon.chat-position-top_right {
    top: 20px;
    right: 20px;
}

.chat-open-icon.chat-position-top_left {
    top: 20px;
    left: 20px;
}

/* Pulse Animation for Open Icon */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(0, 124, 186, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0);
    }
}

/* Responsive design - Mobile Specific */
@media (max-width: 768px) {
    #auto-category-chat {
        width: 300px;
    }
    
    .chat-position-bottom_right,
    .chat-position-bottom_left,
    .chat-position-top_right,
    .chat-position-top_left {
        right: 20px;
        left: auto;
    }
    
    .back-to-brands-btn {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    #auto-category-chat {
        width: calc(100% - 40px);
        right: 20px;
        left: auto;
    }
    
    .chat-position-bottom_right,
    .chat-position-bottom_left,
    .chat-position-top_right,
    .chat-position-top_left {
        right: 20px;
        left: auto;
    }
}

/* Hide on mobile if setting is disabled */
@media (max-width: 768px) {
    #auto-category-chat.hide-on-mobile {
        display: none !important;
    }
}