/* =========================================
   India SEED Ventures - Website Chatbot
   ========================================= */

/* Back-to-top sits above the chat launcher */
.back-top {
    bottom: 96px;
}

.isv-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1050;
    font-family: 'Poppins', sans-serif;
}

/* ---------- Launcher ---------- */
.isv-chat-launcher {
    position: relative;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), var(--pink-dark));
    color: var(--white);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(230, 42, 149, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.isv-chat-launcher:hover {
    transform: scale(1.06);
}

.isv-chat-launcher::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--pink);
    animation: isvPulse 2s ease-out infinite;
}

.isv-chat.seen .isv-chat-launcher::before,
.isv-chat.seen .isv-chat-badge {
    display: none;
}

.isv-chat-launcher i {
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.isv-chat-launcher .icon-close {
    opacity: 0;
    transform: rotate(-90deg);
    font-size: 20px;
}

.isv-chat.open .isv-chat-launcher .icon-open {
    opacity: 0;
    transform: rotate(90deg);
}

.isv-chat.open .isv-chat-launcher .icon-close {
    opacity: 1;
    transform: rotate(0);
}

.isv-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--navy);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    border: 2px solid var(--white);
}

@keyframes isvPulse {
    from { transform: scale(1); opacity: 0.7; }
    to { transform: scale(1.5); opacity: 0; }
}

/* ---------- Panel ---------- */
.isv-chat-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 370px;
    height: 540px;
    max-height: calc(100vh - 120px);
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 27, 45, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.isv-chat.open .isv-chat-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.isv-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--navy), #1f2f4d);
    color: var(--white);
}

.isv-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.isv-chat-head strong {
    display: block;
    font-size: 15px;
    line-height: 20px;
}

.isv-chat-head small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.isv-chat-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
}

.isv-chat-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    cursor: pointer;
}

.isv-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Messages ---------- */
.isv-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.isv-msg {
    display: flex;
    animation: isvIn 0.25s ease;
}

.isv-msg.user {
    justify-content: flex-end;
}

.isv-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 22px;
    border-radius: 16px;
    word-wrap: break-word;
}

.isv-msg.bot .isv-bubble {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.isv-msg.user .isv-bubble {
    background: var(--pink);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.isv-bubble strong {
    color: var(--heading);
}

.isv-bubble ul,
.isv-bubble ol {
    margin: 6px 0 4px;
    padding-left: 18px;
}

.isv-bubble li {
    margin-bottom: 4px;
}

.isv-bubble a {
    color: var(--pink);
    font-weight: 600;
    text-decoration: underline;
}

.isv-bubble a:hover {
    color: var(--pink-dark);
}

.isv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    animation: isvIn 0.25s ease;
}

.isv-chips button {
    padding: 6px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--pink);
    background: var(--white);
    border: 1px solid var(--pink);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.isv-chips button:hover {
    background: var(--pink);
    color: var(--white);
}

.isv-typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.isv-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b8bcc6;
    animation: isvDot 1.2s infinite ease-in-out;
}

.isv-typing span:nth-child(2) { animation-delay: 0.15s; }
.isv-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes isvDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes isvIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Input ---------- */
.isv-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.isv-chat-input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    color: var(--heading);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 50px;
    outline: none;
}

.isv-chat-input:focus {
    border-color: var(--pink);
    background: var(--white);
}

.isv-chat-send {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--pink);
    color: var(--white);
    cursor: pointer;
}

.isv-chat-send:hover {
    background: var(--pink-dark);
}

/* ---------- Responsive ---------- */
@media (max-width: 575px) {
    .back-top {
        bottom: 84px;
    }

    .isv-chat {
        right: 16px;
        bottom: 16px;
    }

    .isv-chat-launcher {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }

    .isv-chat.open .isv-chat-launcher {
        display: none;
    }

    .isv-chat-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .isv-chat-launcher::before {
        animation: none;
    }
}
