/* ============================================================
   ISHA FOOD PROCESSING — WhatsApp-Style Chatbot Widget
   Brexx-style compact popup on mobile
   ============================================================ */
/* --- Chatbot Floating Bubble --- */
.chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
}
.chatbot-bubble.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}
.bubble-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.45);
    animation: waPulse 2s infinite;
    position: relative;
    z-index: 2;
    transition: transform 0.2s;
    padding: 0;
}
.bubble-btn:hover {
    transform: scale(1.08);
}
.bubble-btn svg {
    width: 34px;
    height: 34px;
}
@keyframes waPulse {
    0%,
    100% {
        box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
    }
}
/* --- Bubble Label --- */
.bubble-label {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    max-width: 190px;
    overflow: hidden;
}
.bubble-label span {
    display: inline-block;
    transition: opacity 0.3s, transform 0.3s;
}
/* ==========================================================
   CHAT WINDOW — Desktop: fixed right corner popup
   Mobile: Brexx-style compact floating popup
   ========================================================== */
.chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 20px;
    width: 370px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 130px);
    border-radius: 16px;
    overflow: hidden;
    z-index: 10000;
    display: none;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
    animation: waSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.chatbot-window.open {
    display: flex;
}
@keyframes waSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* --- Chat Header (WhatsApp Style) --- */
.chat-header {
    background: #075E54;
    padding: 0.65rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #128C7E;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.chat-avatar svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}
.chat-header-info {
    flex: 1;
}
.chat-header-info h4 {
    color: #fff;
    font-size: 0.92rem;
    margin: 0;
    font-weight: 600;
}
.chat-header-info p {
    color: #a8f0c6;
    font-size: 0.68rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.chat-header-info p::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: onPulse 2s infinite;
}
@keyframes onPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}
.chat-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    transition: color 0.2s;
}
.chat-close-btn:hover {
    color: #fff;
}
/* ==========================================================
   MESSAGES AREA — WhatsApp dark background
   ========================================================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 0.5rem;
    background-color: #0b141a;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
/* === CRITICAL: Inner message container MUST be flex column for alignment === */
#chat-messages {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem;
    min-height: 100%;
}
/* ==========================================================
   MESSAGE BUBBLES — Bot LEFT, User RIGHT
   ========================================================== */
.chat-msg {
    max-width: 80%;
    padding: 0.45rem 0.65rem;
    font-size: 0.84rem;
    line-height: 1.4;
    word-wrap: break-word;
    animation: msgIn 0.25s ease;
    position: relative;
    box-sizing: border-box;
}
@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* BOT = LEFT side */
.chat-msg.bot {
    background: #1f2c33 !important;
    color: #e9edef !important;
    border-radius: 0 10px 10px 10px !important;
    align-self: flex-start !important;
    margin-right: auto !important;
    margin-left: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
/* USER = RIGHT side */
.chat-msg.user {
    background: #005c4b !important;
    color: #e9edef !important;
    border-radius: 10px 0 10px 10px !important;
    align-self: flex-end !important;
    margin-left: auto !important;
    margin-right: 0 !important;
}
.chat-msg .msg-time {
    font-size: 0.58rem;
    opacity: 0.5;
    margin-top: 2px;
    display: block;
    text-align: right;
}
/* --- Typing Indicator --- */
.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 0.6rem 0.85rem;
    background: #1f2c33;
    border-radius: 0 10px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-right: auto;
}
.typing-indicator.show {
    display: flex;
    gap: 4px;
    align-items: center;
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #25D366;
    border-radius: 50%;
    animation: tBounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) {
    animation-delay: .16s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: .32s;
}
@keyframes tBounce {
    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.35;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
/* --- Chat Input Bar --- */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    background: #1f2c33;
    flex-shrink: 0;
}
.chat-input-bar input {
    flex: 1;
    background: #2a3942;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 0.8rem;
    color: #e9edef;
    font-size: 0.84rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}
.chat-input-bar input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #00a884;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.chat-send-btn:hover {
    background: #25D366;
}
/* --- Registration Form --- */
.chat-registration {
    padding: 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    flex: 1;
    justify-content: center;
    background: #0b141a;
}
.chat-registration h3 {
    color: #25D366;
    font-size: 0.95rem;
    text-align: center;
    margin: 0;
}
.chat-registration p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    text-align: center;
    margin: 0;
}
.chat-registration input {
    width: 100%;
    background: #2a3942;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    color: #e9edef;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    box-sizing: border-box;
}
.chat-registration input:focus {
    border-color: #25D366;
}
.chat-registration input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.chat-reg-btn {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 10px;
    background: #00a884;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}
.chat-reg-btn:hover {
    background: #25D366;
}
/* --- Lead Capture Popup --- */
.lead-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 11000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}
.lead-overlay.show {
    display: flex;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.lead-popup {
    background: #1a1a28;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 18px;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}
.lead-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.lead-popup-close:hover {
    color: #f59e0b;
}
.lead-popup h3 {
    color: #f59e0b;
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
}
.lead-popup .lead-sub {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.lead-popup input,
.lead-popup select {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    color: #e2e8f0;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    margin-bottom: 0.6rem;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.lead-popup input:focus,
.lead-popup select:focus {
    border-color: #f59e0b;
}
.lead-popup input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.lead-popup select {
    color: rgba(255, 255, 255, 0.3);
}
.lead-popup select.filled {
    color: #e2e8f0;
}
.lead-popup option {
    background: #1a1a28;
    color: #e2e8f0;
}
.lead-submit-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    margin-top: 0.2rem;
    transition: transform 0.15s;
}
.lead-submit-btn:hover {
    transform: translateY(-1px);
}
/* ==========================================================
   MOBILE — Brexx-style compact popup
   NOT full screen! Floats over the page.
   ========================================================== */
@media (max-width: 768px) {
    .chatbot-window {
        position: fixed !important;
        bottom: 80px !important;
        right: 12px !important;
        left: 12px !important;
        top: auto !important;
        width: auto !important;
        max-width: none !important;
        height: 55vh !important;
        max-height: 55vh !important;
        border-radius: 16px !important;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5) !important;
    }
    .chatbot-bubble {
        bottom: 16px !important;
        right: 14px !important;
    }
    .bubble-btn {
        width: 52px !important;
        height: 52px !important;
    }
    .bubble-btn svg {
        width: 28px !important;
        height: 28px !important;
    }
    .bubble-label {
        display: none !important;
    }
    .chat-header {
        padding: 0.55rem 0.7rem !important;
        border-radius: 16px 16px 0 0;
    }
    .chat-avatar {
        width: 32px !important;
        height: 32px !important;
    }
    .chat-avatar svg {
        width: 18px !important;
        height: 18px !important;
    }
    .chat-header-info h4 {
        font-size: 0.85rem !important;
    }
    .chat-header-info p {
        font-size: 0.65rem !important;
    }
    .chat-msg {
        font-size: 0.8rem !important;
        max-width: 82% !important;
        padding: 0.4rem 0.55rem !important;
    }
    .chat-input-bar {
        padding: 0.4rem !important;
    }
    .chat-input-bar input {
        padding: 0.45rem 0.7rem !important;
        font-size: 0.82rem !important;
    }
    .chat-send-btn {
        width: 34px !important;
        height: 34px !important;
    }
    .chat-registration {
        padding: 0.9rem 0.8rem !important;
        gap: 0.55rem !important;
    }
    .chat-registration h3 {
        font-size: 0.88rem !important;
    }
    .chat-registration p {
        font-size: 0.72rem !important;
    }
    .chat-registration input {
        padding: 0.55rem 0.75rem !important;
        font-size: 0.82rem !important;
    }
    .chat-reg-btn {
        padding: 0.6rem !important;
        font-size: 0.82rem !important;
    }
    .lead-popup {
        margin: 0 0.5rem;
        padding: 1.5rem 1.2rem;
    }
}
@media (max-width: 380px) {
    .chatbot-window {
        bottom: 70px !important;
        right: 8px !important;
        left: 8px !important;
        height: 52vh !important;
        max-height: 52vh !important;
        border-radius: 14px !important;
    }
    .chatbot-bubble {
        bottom: 12px !important;
        right: 10px !important;
    }
    .bubble-btn {
        width: 48px !important;
        height: 48px !important;
    }
}