/* IdeiasBlah Floating Chatbot Widget Styles */

.ib-chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Floating Launcher */
.ib-chatbot-launcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ib-chatbot-launcher:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 30px rgba(30, 64, 175, 0.45);
}

.ib-launcher-icon {
    font-size: 1.3rem;
}

.ib-launcher-badge {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Chat Window */
.ib-chatbot-window {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
    animation: ib-pop-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ib-pop-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

.ib-chat-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ib-chat-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
}

.ib-chat-status {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ib-status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.ib-chat-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.ib-chat-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

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

.ib-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: ib-msg-fade 0.25s ease-out;
}

@keyframes ib-msg-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ib-message-bot {
    align-self: flex-start;
}

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

.ib-message-content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.90rem;
    line-height: 1.45;
}

.ib-message-bot .ib-message-content {
    background: #ffffff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.ib-message-user .ib-message-content {
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Typing Indicator */
.ib-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.ib-typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: ib-bounce 1.2s infinite ease-in-out;
}

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

@keyframes ib-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Product Cards Inside Chat */
.ib-chat-products-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.ib-chat-product-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.ib-chat-product-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.ib-card-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
}

.ib-card-info {
    flex: 1;
    min-width: 0;
}

.ib-card-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ib-card-price {
    font-size: 0.80rem;
    color: #16a34a;
    font-weight: 700;
}

.ib-card-btn {
    font-size: 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}

/* WhatsApp Handoff CTA */
.ib-chat-whatsapp-cta {
    margin-top: 10px;
}

.ib-chat-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    transition: transform 0.2s;
}

.ib-chat-whatsapp-btn:hover {
    transform: scale(1.03);
}

/* Quick Pills */
.ib-chat-quick-pills {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    overflow-x: auto;
    white-space: nowrap;
}

.ib-pill-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.ib-pill-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Footer Input Form */
.ib-chat-footer {
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ib-chat-input {
    flex: 1;
    border: 1px solid #cbd5e1 !important;
    border-radius: 999px !important;
    padding: 8px 14px !important;
    font-size: 0.88rem !important;
    outline: none !important;
    box-shadow: none !important;
}

.ib-chat-input:focus {
    border-color: #3b82f6 !important;
}

.ib-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ib-chat-send-btn:hover {
    background: #1d4ed8;
}
