/* ============================================================
   Poison Stem Cell Clinic — AI Chat Widget Stylesheet
   Class names match the static HTML in includes/footer.php
   ============================================================ */

/* ── Launcher Button ─────────────────────────────────────── */
.poison-chat-launcher {
    position: fixed;
    bottom: 90px;       /* sits above the floating WhatsApp button */
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007BFF, #00e5ff);
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.3s ease,
                opacity 0.3s ease;
    border: 2px solid rgba(255,255,255,0.2);
    color: #ffffff;
    animation: launcherPulse 3s ease-in-out infinite;
}
.poison-chat-launcher:hover {
    transform: scale(1.12) rotate(6deg);
    box-shadow: 0 10px 32px rgba(0, 229, 255, 0.65);
}
.poison-chat-launcher i {
    font-size: 26px;
    line-height: 1;
}
/* Hide launcher when chat is open */
.poison-launcher-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.6) rotate(-20deg);
}
@keyframes launcherPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(0,229,255,0.45); }
    50%       { box-shadow: 0 6px 36px rgba(0,229,255,0.8); }
}

/* ── Tooltip ─────────────────────────────────────────────── */
.poison-chat-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,229,255,0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    font-family: 'Montserrat', sans-serif;
}
.poison-chat-launcher:hover .poison-chat-tooltip {
    opacity: 1;
}

/* ── Chat Window ─────────────────────────────────────────── */
.poison-chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 390px;
    height: 580px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s ease,
                visibility 0.35s ease,
                transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Glass styling */
    background: rgba(5, 5, 5, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0,229,255,0.18);
    box-shadow: 0 24px 60px rgba(0,0,0,0.85),
                0 0 0 1px rgba(0,229,255,0.06);
    font-family: 'Montserrat', sans-serif;
}
/* Visible state */
.poison-chat-window.poison-chat-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Header ──────────────────────────────────────────────── */
.poison-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(90deg,
        rgba(0,123,255,0.18),
        rgba(0,229,255,0.12));
    border-bottom: 1px solid rgba(0,229,255,0.12);
    flex-shrink: 0;
}
.poison-chat-header-profile {
    display: flex;
    align-items: center;
    gap: 11px;
}
.poison-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007BFF, #00e5ff);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid rgba(0,229,255,0.4);
    box-shadow: 0 0 12px rgba(0,229,255,0.3);
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}
.poison-chat-header-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #050505;
    box-shadow: 0 0 6px #22c55e;
    animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 6px #22c55e; }
    50%       { box-shadow: 0 0 12px #22c55e; }
}
.poison-chat-header-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    font-family: 'Outfit', sans-serif;
}
.poison-chat-header-info p {
    margin: 2px 0 0;
    font-size: 11px;
    color: #00e5ff;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}
.poison-chat-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 16px;
    flex-shrink: 0;
}
.poison-chat-close-btn:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.4);
    color: #f87171;
    transform: rotate(90deg);
}

/* ── Messages Area ───────────────────────────────────────── */
.poison-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image: radial-gradient(rgba(0,229,255,0.03) 1px, transparent 1px);
    background-size: 22px 22px;
}
.poison-chat-messages::-webkit-scrollbar { width: 4px; }
.poison-chat-messages::-webkit-scrollbar-track { background: transparent; }
.poison-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,229,255,0.2);
    border-radius: 10px;
}
.poison-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0,229,255,0.5);
}

/* ── Message Bubbles ─────────────────────────────────────── */
.poison-msg {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.55;
    animation: msgPop 0.28s ease-out forwards;
    word-break: break-word;
}
@keyframes msgPop {
    from { opacity:0; transform: translateY(10px) scale(0.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}
.poison-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #007BFF 0%, #0056b3 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 3px 14px rgba(0,123,255,0.22);
}
.poison-msg.assistant {
    align-self: flex-start;
    background: rgba(255,255,255,0.04);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0,229,255,0.1);
    box-shadow: 0 3px 14px rgba(0,0,0,0.22);
}

/* ── Typing Indicator ────────────────────────────────────── */
.poison-typing {
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 12px 16px !important;
}
.poison-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00e5ff;
    opacity: 0.55;
    animation: typingDot 1.3s ease-in-out infinite;
}
.poison-typing span:nth-child(2) { animation-delay: 0.18s; }
.poison-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingDot {
    0%,100% { transform: scale(1);   opacity: 0.55; }
    50%      { transform: scale(1.5); opacity: 1;    }
}

/* ── Quick-Reply Chips ───────────────────────────────────── */
.poison-chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px 14px 6px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.1);
}
.poison-chat-chip {
    padding: 5px 11px;
    background: rgba(0,229,255,0.05);
    border: 1px solid rgba(0,229,255,0.2);
    border-radius: 20px;
    font-size: 11.5px;
    color: #00e5ff;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}
.poison-chat-chip:hover {
    background: rgba(0,229,255,0.18);
    border-color: rgba(0,229,255,0.5);
    color: #fff;
    transform: translateY(-2px);
}

/* ── Contact Action Buttons ──────────────────────────────── */
.poison-chat-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.poison-action-btn {
    padding: 9px 6px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.28s ease;
    font-family: 'Montserrat', sans-serif;
}
.poison-action-btn.whatsapp {
    background: rgba(37,211,102,0.08);
    border: 1px solid rgba(37,211,102,0.3);
    color: #25d366;
}
.poison-action-btn.whatsapp:hover {
    background: #25d366;
    color: #fff;
    box-shadow: 0 0 16px rgba(37,211,102,0.4);
    transform: translateY(-2px);
}
.poison-action-btn.call {
    background: rgba(0,229,255,0.06);
    border: 1px solid rgba(0,229,255,0.25);
    color: #00e5ff;
}
.poison-action-btn.call:hover {
    background: linear-gradient(135deg, #007BFF, #00e5ff);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(0,229,255,0.35);
    transform: translateY(-2px);
}

/* ── Input Area ──────────────────────────────────────────── */
.poison-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.25);
    flex-shrink: 0;
}
.poison-chat-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
    min-width: 0;
}
.poison-chat-input::placeholder { color: rgba(255,255,255,0.3); }
.poison-chat-input:focus {
    border-color: rgba(0,229,255,0.5);
    background: rgba(255,255,255,0.07);
}
.poison-chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #007BFF, #00e5ff);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(0,229,255,0.22);
}
.poison-chat-send-btn:hover:not(:disabled) {
    transform: scale(1.07);
    box-shadow: 0 5px 18px rgba(0,229,255,0.45);
}
.poison-chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Powered-by watermark ────────────────────────────────── */
.poison-chat-powered {
    text-align: center;
    padding: 5px 0 8px;
    font-size: 9.5px;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    flex-shrink: 0;
}

/* ── Mobile — full screen ────────────────────────────────── */
@media (max-width: 480px) {
    .poison-chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    .poison-chat-launcher {
        bottom: 80px;
        right: 16px;
    }
}
