/* ============================================================
   INCHCRAFT - AI DESIGN ASSISTANT FLOATING WIDGET STYLES
   Parent Scoped: .ic-ai-chat-trigger, .ic-ai-chat-window, .floating-action-dock
   ============================================================ */

/* AI Chatbot Floating Trigger Button */
.ic-ai-chat-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 16px 8px 10px;
    border-radius: 50rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4), 0 0 20px rgba(200, 59, 59, 0.25);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    user-select: none;
}

.ic-ai-chat-trigger:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px rgba(200, 59, 59, 0.35);
    background: linear-gradient(135deg, #c83b3b 0%, #991b1b 100%);
    color: #ffffff;
}

.ic-ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1.5px solid #ffffff;
    flex-shrink: 0;
}

.ic-ai-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #0f172a;
    border-radius: 50%;
}

.ic-ai-trigger-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ic-ai-trigger-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.ic-ai-trigger-subtitle {
    font-size: 10px;
    opacity: 0.75;
}

/* AI Chat Window Container */
.ic-ai-chat-window {
    position: fixed;
    bottom: 0px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 80px);
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: none;
    z-index: 10005;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease, visibility 0.3s ease;
}

@media (max-width: 575.98px) {
    .ic-ai-chat-window {
        bottom: 0px;
        right: 0px;
        width: 100vw;
        max-width: 100vw;
        height: 85vh;
        max-height: calc(100vh - 50px);
        border-radius: 20px 20px 0 0;
        z-index: 10005;
    }

    .ic-ai-chat-trigger {
        padding: 6px 12px 6px 8px;
        gap: 6px;
    }

    .ic-ai-avatar {
        width: 32px;
        height: 32px;
    }

    .ic-ai-avatar img {
        width: 20px !important;
        height: 20px !important;
    }

    .ic-ai-trigger-title {
        font-size: 11.5px;
    }

    .ic-ai-trigger-subtitle {
        font-size: 9px;
    }
}

.fs-10 {
    font-size: 10px !important;
}

.fs-12 {
    font-size: 12px !important;
}

.ic-ai-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hide floating dock & chatbot window when any Bootstrap modal is open */
body.modal-open .floating-action-dock,
body.modal-open .ic-ai-chat-window {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: all 0.25s ease;
}

/* Hide trigger pill when AI Chatbot window is open */
.floating-action-dock.ai-open #icAiTrigger {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    transition: all 0.3s ease;
}

/* Header */
.ic-ai-chat-window .ic-ai-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ic-ai-chat-window .ic-ai-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ic-ai-chat-window .ic-ai-header-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.ic-ai-chat-window .ic-ai-header-status {
    font-size: 11px;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ic-ai-chat-window .ic-ai-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ic-ai-chat-window .ic-ai-close-btn:hover {
    background: rgba(200, 59, 59, 0.8);
}

/* Chat Messages Body */
.ic-ai-chat-window .ic-ai-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Bubbles */
.ic-ai-chat-window .ic-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: fadeInMsg 0.25s ease forwards;
}

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

.ic-ai-chat-window .ic-msg-bot {
    align-self: flex-start;
}

.ic-ai-chat-window .ic-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ic-ai-chat-window .ic-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.ic-ai-chat-window .ic-msg-bot .ic-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-top-left-radius: 4px;
}

.ic-ai-chat-window .ic-msg-user .ic-msg-bubble {
    background: linear-gradient(135deg, #c83b3b 0%, #991b1b 100%);
    color: #ffffff;
    border-top-right-radius: 4px;
}

/* Quick Suggestion Chips */
.ic-ai-chat-window .ic-ai-chips {
    padding: 8px 14px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.ic-ai-chat-window .ic-ai-chips::-webkit-scrollbar {
    display: none;
}

.ic-ai-chat-window .ic-chip-btn {
    background: rgba(200, 59, 59, 0.06);
    color: #c83b3b;
    border: 1px solid rgba(200, 59, 59, 0.15);
    padding: 6px 12px;
    border-radius: 50rem;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ic-ai-chat-window .ic-chip-btn:hover {
    background: #c83b3b;
    color: #ffffff;
    border-color: #c83b3b;
}

/* Footer Input Area */
.ic-ai-chat-window .ic-ai-input-area {
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ic-ai-chat-window .ic-ai-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 50rem;
    padding: 9px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.ic-ai-chat-window .ic-ai-input:focus {
    border-color: #c83b3b;
}

.ic-ai-chat-window .ic-ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c83b3b 0%, #991b1b 100%);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ic-ai-chat-window .ic-ai-send-btn:hover {
    transform: scale(1.08);
}
