/* =========================================================
   ClubApi - Chat bot theme
   This file only changes the LOOK of the chat bot.
   The chat logic is still in assets/js/checkch.js
   (#chatModal is used in selectors so these rules win
   over the old styles that checkch.js adds)
   ========================================================= */

/* ---------- 1) Launcher button (bottom right) ---------- */
body .support_icon {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
}

/* hide old cartoon gif and the small arrow */
body .support_icon .support_icon_gif,
body .support_icon .chatlabel-arrow {
    display: none !important;
}

body .support_icon .chat-label {
    position: static;
    top: 0;
    right: 0;
}

body .support_icon .chatlabel-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--green);
    color: #04130a;
    font-family: "Inter", Arial, sans-serif;
    font-weight: 700;
    font-size: 15px;
    padding: 13px 20px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
    transition: 0.2s;
}

/* chat icon before the text */
body .support_icon .chatlabel-text::before {
    content: "\F249";                  /* bootstrap icon: chat-dots-fill */
    font-family: "bootstrap-icons";
    font-size: 18px;
    font-weight: normal;
}

body .support_icon .chatlabel-text:hover {
    background: #16a34a;
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- 2) Chat window (docked bottom right) ---------- */
#chatModal .modal-dialog {
    position: fixed;
    right: 20px;
    bottom: 90px;
    margin: 0;
    width: 380px;
    max-width: calc(100% - 40px);
}

#chatModal .chat-modal-content {
    margin-top: 0;
    background: #0a0f1d;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

/* lighter page shadow behind chat */
.modal-backdrop.show {
    opacity: 0.35;
}

/* ---------- 3) Header ---------- */
#chatModal .chat-modal-header {
    background: #111a30;
    border-bottom: 1px solid var(--border) !important;
    padding: 14px 16px 14px 62px;
    position: relative;
    min-height: 64px;
    align-items: center;
}

/* bot avatar in header */
#chatModal .chat-modal-header::before {
    content: "\F6B1";                  /* bootstrap icon: robot */
    font-family: "bootstrap-icons";
    position: absolute;
    left: 16px;
    top: 14px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: var(--green);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* title + online status (added by script.js) */
#chatModal .chat-title {
    position: absolute;
    left: 62px;
    top: 12px;
    font-family: "Inter", Arial, sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
    color: var(--white);
}

#chatModal .chat-title small {
    display: block;
    font-family: var(--mono);
    font-weight: 400;
    font-size: 11px;
    color: var(--green);
}

#chatModal .reload_chat {
    position: absolute;
    right: 52px;
    top: 18px;
    color: var(--muted) !important;
    font-size: 18px;
}

#chatModal .reload_chat:hover {
    color: var(--green) !important;
}

#chatModal .btn-close,
#chatModal .close {
    filter: invert(1) grayscale(1) brightness(1.5);
    opacity: 0.6;
    margin: 0;
    position: absolute;
    right: 18px;
    top: 24px;
}

/* ---------- 4) Messages area ---------- */
#chatModal .chat-modal-body {
    height: 55vh;
    max-height: 460px;
    background: #0a0f1d;
    padding: 18px 16px;
    font-size: 14px;
}

/* small bot avatar next to messages: hide old cartoon photo, show icon */
#chatModal .chat_image_section {
    width: 38px;
    flex: 0 0 38px;
}

#chatModal .chat_image_section img {
    display: none;
}

#chatModal .chat_image_section::before {
    content: "\F6B1";                  /* robot icon */
    font-family: "bootstrap-icons";
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
}

/* hide the waving hand gif message */
#chatModal .message-bot:has(.hand_wave),
#chatModal .hand_wave {
    display: none !important;
}

#chatModal .message-bot:has(.hand_wave) + br {
    display: none;
}

/* bot message bubble */
#chatModal .message-bot {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 13px;
    border-radius: 4px 14px 14px 14px;
    margin-top: 6px;
    line-height: 1.55;
    max-width: 100%;
}

#chatModal .message-bot b {
    color: var(--green);
}

/* user message bubble */
#chatModal .message-user {
    background: var(--green);
    color: #04130a;
    font-weight: 600;
    padding: 9px 13px;
    border-radius: 14px 4px 14px 14px;
    margin-top: 6px;
}

/* service options (chips) */
#chatModal .search_category {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

#chatModal .search_category br {
    display: none;
}

#chatModal .search_item {
    background: transparent;
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.45);
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 11px;
    border-radius: 20px;
    margin: 0;
    transition: 0.15s;
}

#chatModal .search_item:hover {
    background: var(--green);
    color: #04130a;
}

/* time text */
#chatModal .chat_segment_timestamp {
    font-family: var(--mono);
    font-size: 10px;
    color: #5b6b8c;
    margin-top: 4px;
}

/* typing dots: green on dark */
#chatModal .typing_animation rect {
    fill: transparent;
}

#chatModal .typing_animation circle {
    fill: var(--green);
}

/* ---------- 5) Input area ---------- */
#chatModal .chat-modal-footer {
    background: #111a30;
    min-height: 64px;
}

#chatModal .chat-footer-content {
    border-top: 1px solid var(--border);
    padding: 12px;
    gap: 8px;
}

#chatModal .chat-footer-content .chat_input,
#chatModal .chat-footer-content input {
    background: var(--bg) !important;
    color: var(--white) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 14px;
}

#chatModal .chat-footer-content input:focus {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important;
}

#chatModal .chat-footer-content input::placeholder {
    color: #5b6b8c;
}

/* send button: grey when empty, green when typed */
#chatModal .send_message_button {
    filter: invert(60%);
}

#chatModal .send_message_button_valid {
    filter: invert(58%) sepia(74%) saturate(470%) hue-rotate(90deg) brightness(95%) !important;
}

/* phone country dropdown */
#chatModal .iti__country-list {
    background: var(--card);
    border-color: var(--border);
    color: var(--text);
}

#chatModal .iti__country.iti__highlight {
    background: var(--bg-2);
}

#chatModal .iti__selected-dial-code,
#chatModal .iti__dial-code {
    color: var(--muted);
}

/* ---------- 6) Mobile ---------- */
@media (max-width: 575px) {
    #chatModal .modal-dialog {
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
        max-width: none;
    }

    #chatModal .chat-modal-body {
        height: 50vh;
    }

    body .support_icon {
        right: 14px;
        bottom: 14px;
    }

    body .support_icon .chatlabel-text {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ---------- 7) Small fixes ---------- */

/* old css sets left:-3px on close button, reset it */
#chatModal .btn-close,
#chatModal .close {
    left: auto !important;
    top: 22px !important;
    right: 18px !important;
}

/* let bot messages use the full width */
#chatModal .chat_text_section {
    flex: 1;
    min-width: 0;
}

#chatModal .message-bot {
    max-width: 90%;
}

/* each bot message starts on a new full line (user bubble is floated right) */
#chatModal .chat_segment {
    clear: both;
    width: 100%;
}
