/* Racket Assistant Chatbot Styles */

.racket-assistant-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

/* The chat bubble/icon that is always visible */
.racket-chat-bubble {
    width: 60px;
    height: 60px;
    background-color: rgb(249, 50, 98);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    position: absolute;
    bottom: 0;
    right: 0;
}

.racket-chat-bubble .unread-indicator {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: rgb(235, 77, 61);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 4px 12px 0px;
}

.racket-chat-bubble .unread-indicator.visible {
    visibility: visible;
}

/* Keyframes for the pulsing animation */
@keyframes bubble-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Class to apply the animation */
.racket-chat-bubble.animate-pulse {
    animation: bubble-pulse 0.8s infinite;
}

.racket-chat-bubble:hover {
    transform: scale(1.1);
}

/* The main chat window, hidden by default */
.racket-chat-window {
    display: none;
    width: 450px; /* Increased width */
    flex-direction: column;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    position: absolute;
    bottom: 80px; /* Position above the bubble */
    right: 0;
}

/* When the 'open' class is added, the window becomes visible */
.racket-chat-window.open {
    display: flex;
}

/* Header of the chat window */
.racket-chat-header {
    background-color: white;
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
}

#racket-assistant-new-conversation,
#racket-assistant-close {
    background: none;
    border: none;
    color: gray;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

#racket-assistant-new-conversation:hover,
#racket-assistant-close:hover {
    background-color: rgba(0,0,0,0.1);
}

/* The area where messages are displayed */
#racket-assistant-results {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
    min-height: 400px;
    max-height: 400px;
    border-bottom: 1px solid #f0f0f0;
}



/* Container for choice buttons inside the results area */
.racket-choices-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}


/* The footer containing the input and button */
.racket-chat-footer {
    padding: 15px;
    display: flex;
    border-top: 1px solid #eee;
}

#racket-assistant-query {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 10px;
}

#racket-assistant-query:focus {
    border-color: rgb(249, 50, 98)
}

#racket-assistant-submit {
    background-color: rgb(249, 50, 98);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
#racket-assistant-submit:hover {
    background-color: #c3c841;
} */

/* Styles for choice buttons (now inside the results area) */
.racket-choice-button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 20px; /* Rounded buttons */
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.2s;
    font-weight: 400;
}

.racket-choice-button:hover {
    background-color: #e0e0e0;
}

/* Styles for Owl Carousel */
.owl-carousel .racket-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    margin: 10px;
}
.owl-carousel .racket-item img {
    border-radius: 10px;
}
.owl-carousel .racket-item h4 {
    margin: 10px 0 5px;
}
.owl-carousel .racket-item a {
    font-weight: bold;
    text-decoration: none;
    color: #333;
}
.owl-carousel .racket-item a:hover {
    color: #DADF50;
}
.owl-carousel .racket-price {
    font-size: 1.1em;
    color: #DADF50;
    margin: 10px 0;
}
.owl-carousel .racket-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
    max-height: 50px; /* Limit height for description */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* number of lines to show */
    -webkit-box-orient: vertical;
}
.owl-nav button.owl-prev, .owl-nav button.owl-next {
    font-size: 20px;
    color: #333;
}

/* Thinking bubble animation */
.thinking-dots {
    display: flex;
    align-items: center;
    padding: 10px 0;
}
.thinking-dots div {
    width: 8px;
    height: 8px;
    background-color: rgb(249, 50, 98);
    border-radius: 50%;
    margin: 0 4px;
    animation: thinking-bubble 1.4s infinite ease-in-out both;
}
.thinking-dots div:nth-child(1) {
    animation-delay: -0.32s;
}
.thinking-dots div:nth-child(2) {
    animation-delay: -0.16s;
}
@keyframes thinking-bubble {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}

#racket-assistant-results .owl-prev{
    position: absolute;
    top: 50%;
}

#racket-assistant-results .owl-next{
    position: absolute;
    top: 50%;
    right: 0px;
}

/* Styling for individual chat messages */
.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%; /* Limit message width */
    word-wrap: break-word; /* Ensure long words wrap */
}

.user-message {
    align-self: flex-end; /* Align to the right */
    margin-left: auto; /* Push to the right */
    border-bottom-right-radius: 2px; /* Small corner radius for the tail */
    width: fit-content;
    border: 1px solid #F0F0F0;
    background-color: rgb(249, 50, 98);
    color: rgb(255, 255, 255);
}

.ai-message {
    background-color: rgb(243, 243, 243);;
    color: rgb(17, 17, 17) !important;
    align-self: flex-start; /* Align to the left */
    margin-right: auto; /* Push to the left */
    border-bottom-left-radius: 2px; /* Small corner radius for the tail */
}

.chat-message p {
    margin: 0; /* Remove default paragraph margin */
    padding:5px;
}


.racket-assistant-container {
    z-index:999;
}

@media screen and (max-width: 500px) {
    .racket-assistant-container {
        position: fixed;
    }
    .racket-assistant-container.open {
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 100% !important;
    }
    .racket-chat-window {
        bottom: 0;
        width: 100%;
    }
    .racket-chat-window, .racket-assistant-results {
        height: 100%;
        max-height: unset;
    }
    .racket-chat-window.open {
        border-radius: 0;
    }
    #racket-assistant-results {
        max-height: unset;
    }
    html.assistant_open {
        overflow: hidden;
    }
    .racket-chatbot.open .unread-indicator {
        display: none !important;
    }
}
