/* ================= ICON ================= */

#chatbot-icon {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #033576;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,.25);
    transition: transform .2s ease;
    z-index: 9999;
}

#chatbot-icon:hover {
    transform: scale(1.05);
}

/* ================= CHAT BOX ================= */

#chatbot-box {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: slideUp .25s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================= HEADER ================= */

.chat-header {
    background: #033576;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 14px !important;
}

/* ================= BODY ================= */

.chat-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f8fafc;
    font-size: 14px;
}

/* Messages */

.chat-message {
    margin-bottom: 12px;
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot > div,
.chat-message.user > div {
    padding: 10px 12px;
    border-radius: 12px;
    line-height: 1.4;
}

.chat-message.bot > div {
    background: #eef2f7;
    color: #111;
}

.chat-message.user > div {
    background: #033576;
    color: #fff;
}

/* ================= FORMS ================= */

.chat-body input,
.chat-body select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

.chat-body .select2 {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

.chat-body input:focus,
.chat-body select:focus {
    outline: none;
    border-color: #033576;
}

.chat-body .select2:focus {
    outline: none;
    border-color: #033576;
}

/* Buttons */

.chat-body button {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #033576;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s ease;
}

.chat-body button:hover {
    background: #022b5c;
}

/* Action buttons */

.chat-actions button {
    margin-top: 8px;
}

/* ================= FOOTER ================= */

.chat-footer {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #6b7280;
    background: #f1f5f9;
}


.loader-wrapper {
    text-align: center;
    padding: 20px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {

    #chatbot-box {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        animation: none;
    }

    #chatbot-icon {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .chat-header {
        padding: 12px 14px;
        font-size: 15px;
    }

    .chat-body {
        padding: 12px;
        font-size: 14px;
    }

    .chat-footer {
        font-size: 10px;
    }

    .chat-body input,
    .chat-body select,
    .chat-body button {
        font-size: 16px; /* prevents mobile zoom */
    }

    .chat-body .select2,
    .chat-body button {
        font-size: 16px; /* prevents mobile zoom */
    }
}

/* Small phones */

@media (max-width: 480px) {

    .chat-header span {
        font-size: 14px;
    }

    .chat-message > div {
        max-width: 90%;
    }

    #chatbot-icon {
        width: 48px;
        height: 48px;
    }
}


.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 26px;
    position: absolute;
    top: 10px !important;
    right: 10px !important;
    width: 20px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    display: block;
    padding-left: 8px;
    padding-right: 20px;
    overflow: visible !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}