/* CHERTIC Chatbot - Premium Design */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --chertic-primary: #0d6efd;
    --chertic-primary-dark: #0a58ca;
    --chertic-gradient: linear-gradient(135deg, #0d6efd 0%, #0045a5 100%);
    --chertic-bg-light: #f8f9fa;
    --chertic-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --chertic-radius: 16px;
}

#chertic-chatbot-root * {
    font-family: 'Outfit', 'Inter', sans-serif;
    box-sizing: border-box;
}

.chertic-chatbot-toggler {
    position: fixed;
    right: 30px;
    bottom: 30px;
    height: 60px;
    width: 60px;
    color: #fff;
    background: var(--chertic-gradient);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    box-shadow: 0 5px 20px rgba(13, 110, 253, 0.4);
}

.chertic-chatbot-toggler:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.5);
}

.chertic-chatbot-toggler span {
    font-size: 28px;
    position: absolute;
    transition: all 0.3s ease;
}

.chertic-chatbot-toggler span:last-child {
    opacity: 0;
    transform: rotate(-45deg);
}

body.show-chertic-chatbot .chertic-chatbot-toggler {
    background: #f44336;
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.3);
}

body.show-chertic-chatbot .chertic-chatbot-toggler span:first-child {
    opacity: 0;
    transform: rotate(45deg);
}

body.show-chertic-chatbot .chertic-chatbot-toggler span:last-child {
    opacity: 1;
    transform: rotate(0);
}

.chertic-chatbot-container {
    position: fixed;
    right: 30px;
    bottom: 105px;
    width: 400px;
    background: #fff;
    border-radius: var(--chertic-radius);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10000;
    box-shadow: var(--chertic-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.show-chertic-chatbot .chertic-chatbot-container {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chertic-chatbot-container header {
    background: var(--chertic-gradient);
    padding: 20px;
    text-align: center;
    color: #fff;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chertic-chatbot-container header h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.chertic-chatbot-container header p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.chertic-chatbot-box {
    height: 420px;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chertic-chatbot-box::-webkit-scrollbar {
    width: 5px;
}

.chertic-chatbot-box::-webkit-scrollbar-track {
    background: transparent;
}

.chertic-chatbot-box::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

.chertic-chat-item {
    display: flex;
    list-style: none;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chertic-chat-item p {
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
    max-width: 85%;
    font-size: 0.95rem;
    white-space: pre-wrap;
    line-height: 1.5;
    margin-bottom: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.chertic-chat-item.outgoing {
    justify-content: flex-end;
}

.chertic-chat-item.outgoing p {
    color: #fff;
    background: var(--chertic-gradient);
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.2);
}

.chertic-chat-item.incoming span {
    height: 35px;
    min-width: 35px;
    background: #f0f4ff;
    color: var(--chertic-primary);
    text-align: center;
    line-height: 35px;
    margin-right: 12px;
    font-size: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chertic-chat-item.incoming p {
    color: #2d3436;
    background: #f1f3f5;
}

.chertic-chat-input {
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 15px 20px;
    border-top: 1px solid #f1f3f5;
    align-items: center;
}

.chertic-chat-input textarea {
    height: 40px;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.95rem;
    padding: 8px 0;
    max-height: 120px;
}

.chertic-chat-input .chertic-send-btn {
    color: var(--chertic-primary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    display: none;
}

.chertic-chat-input textarea:valid~.chertic-send-btn {
    display: block;
}

.chertic-send-btn:hover {
    transform: scale(1.1);
    color: var(--chertic-primary-dark);
}

.chertic-chat-item p.error {
    color: #d63031;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

@media(max-width: 480px) {
    .chertic-chatbot-container {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chertic-chatbot-box {
        height: calc(100% - 130px);
    }

    .chertic-chatbot-toggler {
        right: 20px;
        bottom: 20px;
    }
}