/* ==========================================================================
   Maison Carry - AI Luck & Colour Concierge Widget Styles
   ========================================================================== */

#mc-chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Floating Launcher Button */
.mc-launcher-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #111111 0%, #1f2e27 60%, #334f41 100%);
    color: #ffffff;
    border: 2px solid #c5a059;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    position: relative;
    outline: none;
}

.mc-launcher-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
    color: #ffffff;
}

.mc-launcher-btn .mc-icon-chat,
.mc-launcher-btn .mc-icon-close {
    display: block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.mc-launcher-btn .mc-icon-close {
    display: none !important;
}

#mc-chatbot-widget.is-open .mc-launcher-btn .mc-icon-chat {
    display: none !important;
}

#mc-chatbot-widget.is-open .mc-launcher-btn .mc-icon-close {
    display: block !important;
}

/* Launcher Tooltip */
.mc-launcher-tooltip {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: rgba(17, 26, 21, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(197, 160, 89, 0.45);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.mc-launcher-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(17, 26, 21, 0.95);
}

.mc-launcher-btn:hover .mc-launcher-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

#mc-chatbot-widget.is-open .mc-launcher-tooltip {
    display: none !important;
}

/* Unread Badge */
.mc-badge-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: #c5a059;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: mcPulse 2s infinite;
}

@keyframes mcPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(197, 160, 89, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(197, 160, 89, 0); }
}

/* Chat Window Frame */
.mc-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#mc-chatbot-widget.is-open .mc-chat-window {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.mc-chat-header {
    background: linear-gradient(135deg, #111111 0%, #1f2e27 65%, #334f41 100%);
    color: #ffffff;
    padding: 14px 16px;
    border-bottom: 2px solid #c5a059;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mc-brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #c5a059;
    color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.mc-brand-text h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.mc-brand-text span {
    font-size: 11px;
    color: #d1c5a5;
    display: block;
}

.mc-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mc-btn-icon {
    background: transparent;
    border: none;
    color: #ffffff;
    opacity: 0.8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, background-color 0.2s;
}

.mc-btn-icon:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.mc-lang-toggle {
    font-size: 11px;
    font-weight: 700;
    background: rgba(197, 160, 89, 0.2);
    border: 1px solid #c5a059;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.mc-lang-toggle:hover {
    background: rgba(197, 160, 89, 0.4);
}

/* Message History Scroll Container */
.mc-chat-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #faf9f6;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mc-chat-body::-webkit-scrollbar {
    width: 5px;
}

.mc-chat-body::-webkit-scrollbar-thumb {
    background: #d8d4c9;
    border-radius: 4px;
}

/* Bubbles */
.mc-message {
    display: flex;
    flex-direction: column;
    max-width: 86%;
    animation: mcFadeSlide 0.25s ease;
}

@keyframes mcFadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mc-message.user {
    align-self: flex-end;
}

.mc-message.assistant {
    align-self: flex-start;
}

.mc-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.mc-message.user .mc-bubble {
    background: #111111;
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.mc-message.assistant .mc-bubble {
    background: #ffffff;
    color: #222222;
    border: 1px solid #e7e3d8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border-bottom-left-radius: 3px;
}

.mc-meta-time {
    font-size: 10px;
    color: #999999;
    margin-top: 3px;
    padding: 0 4px;
}

.mc-message.user .mc-meta-time {
    text-align: right;
}

/* Swatch Card in Assistant Bubble */
.mc-swatch-strip {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.mc-swatch-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f4f2ec;
    border: 1px solid #e2ddd3;
    font-size: 11.5px;
    font-weight: 600;
}

.mc-swatch-badge .mc-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Product Card Carousel / Grid in Chat */
.mc-products-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px 8px 2px;
    margin-top: 6px;
    width: 100%;
}

.mc-product-card {
    min-width: 135px;
    max-width: 140px;
    background: #ffffff;
    border: 1px solid #e5e0d4;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.mc-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.mc-product-img {
    width: 100%;
    height: 105px;
    object-fit: cover;
    background: #f0f0f0;
}

.mc-product-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mc-product-name {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
    height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #111111;
}

.mc-product-colour {
    font-size: 10px;
    color: #334f41;
    font-weight: 600;
    margin: 2px 0;
}

.mc-product-price {
    font-size: 12px;
    font-weight: 700;
    color: #111111;
    margin-top: auto;
}

/* Typing Indicator */
.mc-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e7e3d8;
    border-radius: 14px;
    border-bottom-left-radius: 3px;
    width: fit-content;
    align-self: flex-start;
}

.mc-typing-dot {
    width: 7px;
    height: 7px;
    background: #c5a059;
    border-radius: 50%;
    animation: mcTypingBounce 1.3s infinite;
}

.mc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.mc-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes mcTypingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Action Chips Bar */
.mc-quick-actions {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 12px;
    background: #ffffff;
    border-top: 1px solid #eeebe3;
}

.mc-quick-actions::-webkit-scrollbar { display: none; }

.mc-action-chip {
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 14px;
    background: #f7f6f2;
    border: 1px solid #dfdacd;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s;
}

.mc-action-chip:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

/* DOB Modal Inside Chat Window */
.mc-dob-card {
    background: #fdfbf7;
    border: 1px solid #c5a059;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;
}

.mc-dob-card label {
    font-size: 11px;
    font-weight: 700;
    color: #334f41;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.mc-dob-input {
    width: 100%;
    border: 1px solid #d5cec0;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    background: #ffffff;
    margin-bottom: 8px;
}

.mc-dob-submit {
    width: 100%;
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.mc-dob-submit:hover {
    background: #334f41;
}

/* Chat Input Bar */
.mc-chat-input-area {
    padding: 10px 12px;
    background: #ffffff;
    border-top: 1px solid #e7e3d8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-input-field {
    flex: 1;
    border: 1px solid #dfdacd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: #fbfbf9;
}

.mc-input-field:focus {
    border-color: #334f41;
    background: #ffffff;
}

.mc-btn-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #111111;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.mc-btn-send:hover {
    background: #334f41;
    transform: scale(1.05);
}

.mc-btn-send:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    #mc-chatbot-widget {
        bottom: 18px;
        right: 16px;
    }

    .mc-launcher-btn {
        width: 50px;
        height: 50px;
    }

    .mc-launcher-tooltip {
        display: none !important;
    }

    .mc-chat-window {
        bottom: 70px;
        right: -8px;
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        max-height: 560px;
        border-radius: 12px;
    }
}

