/* ========================================
   🤖 CHAT BOT THEME STYLING
   GymSmart Website Integration
   ======================================== */

/* Main Bot Container */
.robot_div {
    background: #ffffff !important;
    border: 2px solid #b55dcd !important;
    box-shadow: 0 10px 40px rgba(181, 93, 205, 0.2) !important;
    transition: all 0.3s ease !important;
}

body.dark .robot_div {
    background: rgba(20, 20, 30, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-color: #c084fc !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
}

/* Override bg-body-tertiary */
.robot_div.bg-body-tertiary {
    background: #ffffff !important;
}

body.dark .robot_div.bg-body-tertiary {
    background: rgba(20, 20, 30, 0.95) !important;
}

/* Bot Header */
.robot_div .bg-success {
    background: linear-gradient(135deg, #b55dcd, #8b5cf6) !important;
    border: none !important;
}

body.dark .robot_div .bg-success {
    background: linear-gradient(135deg, #c084fc, #8b5cf6) !important;
}

.robot_div .BotNameTitleClass {
    color: #ffffff !important;
}

.robot_div .close_btn_robot {
    color: #ffffff !important;
}

/* Chat Box Area */
.robot_div .bot_chat_box {
    background: #f8f9fa !important;
    transition: background 0.3s ease !important;
}

body.dark .robot_div .bot_chat_box {
    background: rgba(15, 15, 15, 0.5) !important;
}

/* Chat Messages Container */
.robot_div .BotChatInInsightsList {
    color: #111827 !important;
}

body.dark .robot_div .BotChatInInsightsList {
    color: #f1f5f9 !important;
}

/* All text elements in chat should be visible */
.robot_div .BotChatInInsightsList * {
    color: inherit;
}

/* Specific text color for bot messages */
.robot_div .user_message:has(.bi-robot) * {
    color: #111827 !important;
}

body.dark .robot_div .user_message:has(.bi-robot) * {
    color: #f1f5f9 !important;
}

/* User Message Bubbles (Right Side) */
.robot_div .user_message .bg-white {
    background: linear-gradient(135deg, #b55dcd, #8b5cf6) !important;
    color: #ffffff !important;
    border: 1px solid #b55dcd !important;
}

body.dark .robot_div .user_message .bg-white {
    background: linear-gradient(135deg, #c084fc, #8b5cf6) !important;
    color: #ffffff !important;
    border: 1px solid #c084fc !important;
}

/* Bot Message Bubbles (Left Side) */
.robot_div .bg-success-subtle {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #e5e7eb !important;
    transition: all 0.3s ease !important;
}

body.dark .robot_div .bg-success-subtle {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
}

/* Bot Message Text Content - IMPORTANT FOR VISIBILITY */
.robot_div .bg-success-subtle .bg-white,
.robot_div .bg-success-subtle .fs-13,
.robot_div .bg-success-subtle div {
    background: transparent !important;
    color: #111827 !important;
    border: none !important;
}

body.dark .robot_div .bg-success-subtle .bg-white,
body.dark .robot_div .bg-success-subtle .fs-13,
body.dark .robot_div .bg-success-subtle div {
    background: transparent !important;
    color: #f1f5f9 !important;
    border: none !important;
}

/* Ensure all text inside bot messages is visible */
.robot_div .bg-success-subtle *,
.robot_div .user_message .bg-success-subtle *,
.robot_div .justify-content-start .bg-success-subtle * {
    color: #111827 !important;
}

body.dark .robot_div .bg-success-subtle *,
body.dark .robot_div .user_message .bg-success-subtle *,
body.dark .robot_div .justify-content-start .bg-success-subtle * {
    color: #f1f5f9 !important;
}

/* Override for italic text in bot messages */
.robot_div .bg-success-subtle i {
    color: #374151 !important;
    font-style: italic;
}

body.dark .robot_div .bg-success-subtle i {
    color: #cbd5e1 !important;
}

/* Specific targeting for bot response text */
.robot_div .user_message .justify-content-start .bg-white.bg-success-subtle,
.robot_div .user_message .justify-content-start .fs-13.bg-success-subtle,
.robot_div .user_message .justify-content-start div.bg-success-subtle {
    color: #111827 !important;
    background: transparent !important;
}

body.dark .robot_div .user_message .justify-content-start .bg-white.bg-success-subtle,
body.dark .robot_div .user_message .justify-content-start .fs-13.bg-success-subtle,
body.dark .robot_div .user_message .justify-content-start div.bg-success-subtle {
    color: #f1f5f9 !important;
    background: transparent !important;
}

/* Force text visibility in bot messages with multiple classes */
.robot_div .fw-normal.bg-white.bg-success-subtle,
.robot_div .fs-13.fw-normal.bg-white.bg-success-subtle {
    color: #111827 !important;
    background: transparent !important;
}

body.dark .robot_div .fw-normal.bg-white.bg-success-subtle,
body.dark .robot_div .fs-13.fw-normal.bg-white.bg-success-subtle {
    color: #f1f5f9 !important;
    background: transparent !important;
}

/* Icons in Chat */
.robot_div .bi-person-fill,
.robot_div .bi-robot {
    color: #6b7280 !important;
    transition: color 0.3s ease !important;
}

body.dark .robot_div .bi-person-fill,
body.dark .robot_div .bi-robot {
    color: #c084fc !important;
}

/* Chat Images */
.robot_div img {
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

/* Message Text */
.robot_div .fs-13 {
    color: inherit !important;
}

/* Border Dark Subtle Override */
.robot_div .border-dark-subtle {
    border-color: #e5e7eb !important;
}

body.dark .robot_div .border-dark-subtle {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Selection Menu */
.robot_div .selection_bot_menu {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    transition: all 0.3s ease !important;
}

body.dark .robot_div .selection_bot_menu {
    background: rgba(20, 20, 30, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.robot_div .bot_select_menu_header {
    background: linear-gradient(135deg, #b55dcd, #8b5cf6) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body.dark .robot_div .bot_select_menu_header {
    background: linear-gradient(135deg, #c084fc, #8b5cf6) !important;
}

.robot_div .bot_select_menu_header h6 {
    color: #ffffff !important;
}

/* Menu Options */
.robot_div .SetOptionMenuOptiosHear {
    color: #1f2937 !important;
}

body.dark .robot_div .SetOptionMenuOptiosHear {
    color: #f1f5f9 !important;
}

.robot_div .bot_select_menu_option {
    color: #1f2937 !important;
}

body.dark .robot_div .bot_select_menu_option {
    color: #9ca3af !important;
}

.robot_div .SendingSingleChoiceResponce {
    background: linear-gradient(135deg, #b55dcd, #8b5cf6) !important;
    color: #ffffff !important;
    border-color: #b55dcd !important;
    transition: all 0.3s ease !important;
}

body.dark .robot_div .SendingSingleChoiceResponce {
    background: linear-gradient(135deg, #c084fc, #8b5cf6) !important;
    border-color: #c084fc !important;
}

.robot_div .SendingSingleChoiceResponce:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(181, 93, 205, 0.4) !important;
}

body.dark .robot_div .SendingSingleChoiceResponce:hover {
    box-shadow: 0 4px 12px rgba(192, 132, 252, 0.5) !important;
}

/* Border Success Subtle */
.robot_div .border-success-subtle {
    border-color: #b55dcd !important;
}

body.dark .robot_div .border-success-subtle {
    border-color: rgba(192, 132, 252, 0.3) !important;
}

/* Input Box */
.robot_div .bot_message_send_box {
    background: #ffffff !important;
    border-top: 2px solid #b55dcd !important;
    transition: all 0.3s ease !important;
}

body.dark .robot_div .bot_message_send_box {
    background: rgba(20, 20, 30, 0.8) !important;
    border-top-color: #c084fc !important;
}

.robot_div .ChatTextInput {
    background: transparent !important;
    color: #1f2937 !important;
    transition: color 0.3s ease !important;
}

body.dark .robot_div .ChatTextInput {
    color: #f1f5f9 !important;
}

.robot_div .ChatTextInput::placeholder {
    color: #9ca3af !important;
}

body.dark .robot_div .ChatTextInput::placeholder {
    color: #6b7280 !important;
}

/* Send Button */
.robot_div .sendMessageBtn {
    color: #b55dcd !important;
    transition: all 0.3s ease !important;
}

body.dark .robot_div .sendMessageBtn {
    color: #c084fc !important;
}

.robot_div .sendMessageBtn:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* Bot Icon */
.robot_div .bi-robot {
    color: #ffffff !important;
}

/* Close Icon */
.robot_div .bi-x-circle {
    transition: transform 0.3s ease !important;
}

.robot_div .bi-x-circle:hover {
    transform: rotate(90deg);
}

/* Scrollbar Styling for Chat Box */
.robot_div .bot_chat_box::-webkit-scrollbar {
    width: 6px;
}

.robot_div .bot_chat_box::-webkit-scrollbar-track {
    background: #f3f4f6;
}

body.dark .robot_div .bot_chat_box::-webkit-scrollbar-track {
    background: rgba(15, 15, 15, 0.5);
}

.robot_div .bot_chat_box::-webkit-scrollbar-thumb {
    background: #b55dcd;
    border-radius: 10px;
}

body.dark .robot_div .bot_chat_box::-webkit-scrollbar-thumb {
    background: #c084fc;
}

.robot_div .bot_chat_box::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

body.dark .robot_div .bot_chat_box::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

/* Bot Launcher Button (if exists) */
.launcher-label-main-div {
    background: linear-gradient(135deg, #b55dcd, #8b5cf6) !important;
    border: 2px solid #b55dcd !important;
    box-shadow: 0 8px 25px rgba(181, 93, 205, 0.4) !important;
    transition: all 0.3s ease !important;
}

body.dark .launcher-label-main-div {
    background: linear-gradient(135deg, #c084fc, #8b5cf6) !important;
    border-color: #c084fc !important;
    box-shadow: 0 8px 30px rgba(192, 132, 252, 0.5) !important;
}

.launcher-label-main-div:hover {
    transform: scale(1.05);
}

/* Bot Options/Buttons */
.robot_div .btn-hover {
    transition: all 0.3s ease !important;
}

.robot_div .btn-hover:hover {
    background: #b55dcd !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

body.dark .robot_div .btn-hover:hover {
    background: #c084fc !important;
}

/* Border Success Override */
.robot_div .border-success {
    border-color: #b55dcd !important;
}

body.dark .robot_div .border-success {
    border-color: #c084fc !important;
}

/* Text Colors */
.robot_div .text-white {
    color: #ffffff !important;
}

body.dark .robot_div .text-dark {
    color: #f1f5f9 !important;
}

/* Font Size Classes */
.robot_div .fs-16 {
    font-size: 16px !important;
}

.robot_div .fs-13 {
    font-size: 13px !important;
    color: inherit !important;
}

/* Ensure fs-13 text is visible in bot messages */
.robot_div .bg-success-subtle .fs-13,
.robot_div .fs-13.bg-success-subtle,
.robot_div .user_message .fs-13.bg-success-subtle {
    color: #111827 !important;
}

body.dark .robot_div .bg-success-subtle .fs-13,
body.dark .robot_div .fs-13.bg-success-subtle,
body.dark .robot_div .user_message .fs-13.bg-success-subtle {
    color: #f1f5f9 !important;
}

/* Text wrap class should maintain color */
.robot_div .text-wrap.bg-success-subtle,
.robot_div .bg-success-subtle .text-wrap {
    color: #111827 !important;
}

body.dark .robot_div .text-wrap.bg-success-subtle,
body.dark .robot_div .bg-success-subtle .text-wrap {
    color: #f1f5f9 !important;
}

/* For break class */
.robot_div .text-break.bg-success-subtle,
.robot_div .bg-success-subtle .text-break {
    color: #111827 !important;
}

body.dark .robot_div .text-break.bg-success-subtle,
body.dark .robot_div .bg-success-subtle .text-break {
    color: #f1f5f9 !important;
}

/* Additional Bot Elements */
.robot_div .botoption_menu_close {
    cursor: pointer;
    transition: transform 0.3s ease !important;
}

.robot_div .botoption_menu_close:hover {
    transform: scale(1.2);
}

/* Message Alignment */
.robot_div .justify-content-end {
    justify-content: flex-end !important;
}

.robot_div .justify-content-start {
    justify-content: flex-start !important;
}

/* Padding Classes */
.robot_div .p-1 {
    padding: 0.25rem !important;
}

.robot_div .p-2 {
    padding: 0.5rem !important;
}

.robot_div .px-2 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.robot_div .px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Margin Classes */
.robot_div .my-1 {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.robot_div .my-2 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.robot_div .me-1 {
    margin-right: 0.25rem !important;
}

/* Display Flex */
.robot_div .d-flex {
    display: flex !important;
}

.robot_div .d-inline-flex {
    display: inline-flex !important;
}

.robot_div .flex-wrap {
    flex-wrap: wrap !important;
}

/* Alignment */
.robot_div .align-items-start {
    align-items: flex-start !important;
}

.robot_div .align-items-center {
    align-items: center !important;
}

/* Width Classes */
.robot_div .col-1 {
    flex: 0 0 auto;
    width: 8.33333333% !important;
}

.robot_div .col-9 {
    flex: 0 0 auto;
    width: 75% !important;
}

.robot_div .col-12 {
    flex: 0 0 auto;
    width: 100% !important;
}

/* Font Weight */
.robot_div .fw-normal {
    font-weight: 400 !important;
}

.robot_div .fw-semibold {
    font-weight: 600 !important;
}

/* Overflow */
.robot_div .overflow-y-scroll {
    overflow-y: auto !important;
}

/* Position */
.robot_div .position-relative {
    position: relative !important;
}

.robot_div .position-sticky {
    position: sticky !important;
}

/* Background Overrides for Better Theme Match */
.robot_div .bg-white:not(.user_message .bg-white) {
    background: #f9fafb !important;
    color: #1f2937 !important;
}

body.dark .robot_div .bg-white:not(.user_message .bg-white) {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f1f5f9 !important;
}

/* Ensure User Messages Stay Highlighted */
.robot_div .user_message > .col-9 > .bg-white {
    background: linear-gradient(135deg, #b55dcd, #8b5cf6) !important;
    color: #ffffff !important;
}

body.dark .robot_div .user_message > .col-9 > .bg-white {
    background: linear-gradient(135deg, #c084fc, #8b5cf6) !important;
    color: #ffffff !important;
}

/* Bot Response Container */
.robot_div .user_message:has(.bi-robot) .bg-success-subtle {
    background: #f3f4f6 !important;
}

body.dark .robot_div .user_message:has(.bi-robot) .bg-success-subtle {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Specific targeting for bot message containers */
.robot_div .justify-content-start .bg-success-subtle {
    background: #f3f4f6 !important;
}

body.dark .robot_div .justify-content-start .bg-success-subtle {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Bot message wrapper with col-9 */
.robot_div .user_message .col-9 .bg-success-subtle,
.robot_div .user_message > .col-9.bg-success-subtle {
    background: #f3f4f6 !important;
}

body.dark .robot_div .user_message .col-9 .bg-success-subtle,
body.dark .robot_div .user_message > .col-9.bg-success-subtle {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Image Container in Bot Messages */
.robot_div .bg-success-subtle img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Container that has both image and text */
.robot_div .bg-success-subtle.rounded-2 {
    background: #f3f4f6 !important;
}

body.dark .robot_div .bg-success-subtle.rounded-2 {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Flex wrapper with bg-success-subtle */
.robot_div .d-flex.bg-success-subtle,
.robot_div .flex-wrap.bg-success-subtle {
    background: #f3f4f6 !important;
}

body.dark .robot_div .d-flex.bg-success-subtle,
body.dark .robot_div .flex-wrap.bg-success-subtle {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Rounded Classes */
.robot_div .rounded-2 {
    border-radius: 0.5rem !important;
}

.robot_div .rounded-4 {
    border-radius: 1rem !important;
}

/* Italic Text in Bot Messages */
.robot_div i {
    font-style: italic;
    color: inherit !important;
}

/* Line Breaks */
.robot_div br {
    display: block;
    content: "";
    margin: 0.25rem 0;
}

/* Text Wrap */
.robot_div .text-wrap {
    word-wrap: break-word !important;
    word-break: break-word !important;
}

.robot_div .text-break {
    word-break: break-word !important;
}

/* For Remove BR Class */
.robot_div .for_br_remove {
    line-height: 1.5 !important;
}

/* Responsive Bot Styling */
@media (max-width: 768px) {
    .robot_div {
        width: 95% !important;
        height: 450px !important;
        margin: 0.5rem !important;
    }

    .robot_div .bot_chat_box {
        height: 350px !important;
    }
}

@media (max-width: 480px) {
    .robot_div {
        width: 100% !important;
        height: 400px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .robot_div .bot_chat_box {
        height: 300px !important;
    }
}
