/* assets/css/front.css - MCL Floating Chat widget styles (full file) */

/* root & container */
#mcl-chat-root {
    box-sizing: border-box;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999999;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    pointer-events: none;
}

#mcl-chat-root>.mcl-container {
    box-sizing: border-box;
    position: fixed;
    right: 24px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 999999;
    pointer-events: auto;
}

/* panel
   Note: bottom increased so panel sits slightly higher than before,
   leaving more of the circular button visible underneath. */
.mcl-chat-panel {
    position: absolute;
    right: 24px;
    bottom: 96px;
    /* <-- nudged up so close icon / button peeks out underneath */
    z-index: 60;
    width: 360px;
    min-height: 400px;
    max-height: 520px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(12, 12, 20, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 180ms ease, opacity 180ms ease;
    transform-origin: right bottom;
    pointer-events: auto;
}

.mcl-chat-panel.hidden {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

/* chat circular button - fixed size so it never collapses to 0 */
.mcl-chat-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, #6001D3, #FD346E);
    border: none;
    line-height: 0;
    transition: transform .18s ease, opacity .18s ease;
}

/* keep the button visible at a slightly lower position than the panel */
.mcl-chat-button {
    bottom: 8px;
    position: absolute;
    right: 24px;
    z-index: 50;
}

.mcl-chat-button:active {
    transform: scale(.98);
}

.mcl-chat-button svg {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
}

/* header */
.mcl-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #6001D3, #FD346E);
    color: #fff;
    position: relative;
}

.mcl-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* header close (bigger & centered) */
.mcl-close {
    position: absolute !important;
    right: 12px !important;
    top: 10px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 0 !important;
    box-sizing: border-box !important;
    z-index: 80 !important;
}

.mcl-close svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    fill: #ffffff !important;
}

/* messages area */
.mcl-chat-messages {
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    min-height: 220px;
}

/* message bubbles */
.mcl-msg {
    max-width: 78%;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 12px;
    word-break: break-word;
    white-space: pre-wrap;
}

.mcl-msg.assistant {
    background: #f3f3f6;
    align-self: flex-start;
    color: #111;
}

.mcl-msg.user {
    background: linear-gradient(135deg, #6001D3, #FD346E);
    color: #fff;
    align-self: flex-end;
}

/* input row */
/* Reduced padding/min-height so input is slightly lower (slimmer) */
.mcl-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.mcl-input {
    flex: 1;
    padding: 10px 10px !important;
    border-radius: 8px;
    border: 1px solid #e6e6ee;
    font-size: 15px;
    box-sizing: border-box;
}

/* send button (icon only) */
.mcl-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6001D3, #FD346E);
    cursor: pointer;
    box-sizing: border-box;
    line-height: 0;
}

.mcl-send-btn svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    stroke: #ffffff !important;
    fill: none !important;
}

/* option buttons style (border + spacing) */
.mcl-option {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(20, 20, 40, 0.08);
    background: #fff;
    box-shadow: 0 4px 12px rgba(16, 16, 30, 0.04);
    cursor: pointer;
    font-size: 14px;
}

.mcl-option:focus {
    outline: 2px solid rgba(96, 1, 211, 0.12);
}

/* typing dots */
.mcl-dots {
    display: inline-block;
    width: 36px;
    height: 12px;
}

.mcl-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    border-radius: 50%;
    background: #999;
    opacity: .3;
    animation: mcl-bounce 1s infinite;
}

.mcl-dots span:nth-child(2) {
    animation-delay: .12s;
}

.mcl-dots span:nth-child(3) {
    animation-delay: .24s;
}

@keyframes mcl-bounce {
    0% {
        transform: translateY(0);
        opacity: .3
    }

    50% {
        transform: translateY(-6px);
        opacity: 1
    }

    100% {
        transform: translateY(0);
        opacity: .3
    }
}

/* responsive / mobile tweaks
   Adjusted gap so panel still plays nicely with the button on mobile */
@media (max-width: 520px) {
    #mcl-chat-root>.mcl-container {
        right: 12px;
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .mcl-chat-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        top: calc(12px + env(safe-area-inset-top));
        width: auto;
        height: auto;
        max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        min-height: 0;
        border-radius: 12px;
        bottom: 88px;
        /* slightly raised on mobile too so button is visible */
    }

    .mcl-chat-button {
        right: calc(12px + env(safe-area-inset-right));
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: 60px;
        height: 60px;
    }

    .mcl-chat-messages {
        padding-bottom: 84px;
    }

    .mcl-input {
        padding: 10px !important;
        font-size: 16px;
    }

    .mcl-send-btn svg {
        width: 22px;
        height: 22px;
    }

    .mcl-option {
        padding: 10px 14px;
        font-size: 15px;
    }
}

/* small polish for very narrow screens */
@media (max-width: 380px) {
    .mcl-chat-panel {
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .mcl-close {
        top: calc(env(safe-area-inset-top) + 10px);
        right: 12px;
    }

    .mcl-chat-header h3 {
        font-size: 15px;
    }
}