﻿body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f1f5f9;
    min-height: 200vh;
}

/* ✅ Floating Chat Icon */
.chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 9999;
}

/* ✅ Chat Popup - Hidden Initially */
.chat-popup {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 0; /* ✅ Start with NO WIDTH */
    height: 70vh;
    max-height: 520px;
    background: #fff;
    box-shadow: -10px 0 30px rgba(0,0,0,0.25);
    display: none; /* ✅ FULLY HIDDEN INITIALLY */
    flex-direction: column;
    transition: width 0.35s ease-in-out;
    z-index: 9999;
    border-radius: 12px 0 0 0;
    overflow: hidden;
}

/* ✅ Header */
.chat-header {
    background: #03457d;
    color: white;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sub {
    font-size: 11px;
    font-weight: 400;
}

/* ✅ Chat Body */
.chat-body {
    flex: 1;
    padding: 12px;
    background: linear-gradient(rgba(248,250,252,0.88), rgba(248,250,252,0.88));
    background-size: cover;
    overflow-y: auto;
}

.message-row {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-end;
}

.bot {
    justify-content: flex-start;
}

.user {
    justify-content: flex-end;
}

/* ✅ Bot Avatar */
.bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-size: 14px;
}

.message-bubble {
    max-width: 70%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 12.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.bot .message-bubble {
    background: #e5e7eb;
    color: #111827;
}

.user .message-bubble {
    background: #2563eb;
    color: white;
}

.message-meta {
    font-size: 10px;
    margin-top: 4px;
    text-align: right;
}

.success-icon {
    color: #22c55e;
}

/* ✅ Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
}

    .typing span {
        width: 6px;
        height: 6px;
        background: #6b7280;
        border-radius: 50%;
        animation: blink 1.4s infinite;
    }

        .typing span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes blink {
    0%, 100% {
        opacity: 0.2;
    }

    20% {
        opacity: 1;
    }
}

/* ✅ Input */
.chat-input-area {
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    height:63px;
}

textarea {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 8px 14px;
    resize: none;
}

button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0 16px;
    cursor: pointer;
}

.conversation-ended {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin: 10px 0;
}

.new-chat-btn {
    width: 100%;
    background: #29439b;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
}

/* ✅ Mobile Fix */
@media (max-width: 600px) {
    .chat-popup {
        width: 100% !important;
        border-radius: 0;
    }
}

/* ✅ Input Wrapper */
.input-wrapper {
    position: relative;
    width: 100%;
}

/* ✅ Suggestion Dropdown with Scroll */
.suggestion-box {
    position: absolute;
    bottom: 45px;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow-y: auto; /* ✅ ENABLE VERTICAL SCROLL */
    max-height: 220px; /* ✅ LIMIT HEIGHT */
    display: none;
    z-index: 9999;
    border: 1px solid #e5e7eb;
}
/* ✅ Individual Suggestion as Separate Card */
.suggestion-item {
    margin: 6px 8px; /* ✅ Space between cards */
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 10px; /* ✅ Rounded card look */
    background: #f8fafc; /* ✅ Light card background */
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease-in-out;
}

    /* ✅ Hover Effect (Active Card) */
    .suggestion-item:hover {
        background: #2563eb;
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
    }

    /* ✅ Optional: Active/Clicked Effect */
    .suggestion-item:active {
        transform: scale(0.98);
    }


    /* ✅ Optional: Custom Scrollbar (Modern Look) */
    .suggestion-box::-webkit-scrollbar {
        width: 6px;
    }

    .suggestion-box::-webkit-scrollbar-thumb {
        background: #c7d2fe;
        border-radius: 10px;
    }

    .suggestion-box::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

/* ✅ Confirmation Popup Overlay */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* ✅ Popup Box */
.confirm-box {
    background: #1f2933;
    color: #fff;
    padding: 18px 20px;
    width: 300px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: fadeInScale 0.2s ease;
}

.confirm-title {
    font-size: 14px;
    margin-bottom: 14px;
    text-align: center;
}

/* ✅ Buttons */
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-yes {
    background: #22c55e;
    border: none;
    color: #fff;
    padding: 6px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-no {
    background: #ef4444;
    border: none;
    color: #fff;
    padding: 6px 18px;
    border-radius: 6px;
    cursor: pointer;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
