
/*------------------------------------------------------------- Chatbot--------------------------------------------------*/


#cschat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transition: transform .3s, background .3s;
    animation: cschat-pulse 3s infinite ease-in-out;
    z-index: 999999;
}

#cschat-toggle-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #5aa3ea, #448ad7);
}

#cschat-toggle-btn[aria-pressed="true"] {
    animation: none;
    background: #2c3e50;
}

@keyframes cschat-pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.1)
    }
}

/* ===== Chat Container ===== */
#cschat-container {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    height: 80vh; /* Uses 80% of the viewport height */
    max-height: 540px; /* Still maintains the max size on large screens */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    animation: cschat-fadeInUp .5s ease forwards;
}

@keyframes cschat-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ===== Header ===== */
#cschat-header {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 14px 16px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#cschat-close-btn {
    background: transparent;
    border: none;
    color: #ecf0f1;
    font-size: 20px;
    cursor: pointer;
    transition: color .2s, transform .2s;
}

#cschat-close-btn:hover {
    color: #e74c3c;
    transform: scale(1.2);
}

/* ===== Chat Output ===== */
#cschat-output {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    background: #f7f9fa;
    gap: 12px;
    position: relative;
}

.cschat-message {
    max-width: 75%;
    padding: 5px 17px;
    border-radius: 20px;
    position: relative;
    line-height: 1.5;
    font-size: 13px;
    opacity: 0;
    transform: translateY(20px);
    animation: cschat-appear .4s ease-out forwards;
}

@keyframes cschat-appear {
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.cschat-bot {
    background: #4a90e2;
    color: #fff;
    align-self: flex-start;
}

.cschat-bot::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: #4a90e2;
}

.cschat-user {
    background: #1abc9c;
    color: #fff;
    align-self: flex-end;
}

.cschat-user::after {
    content: '';
    position: absolute;
    right: -13px; /* Changed from left to right */
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #1abc9c; /* Changed from border-right-color */
}

/* ===== Buttons ===== */
.cschat-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    
}

.cschat-btn {
    padding: 10px 16px;
    border-radius: 24px;
    border: 2px solid #4a90e2;
    background: transparent;
    color: #4a90e2;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: cschat-appear .4s ease-out forwards;
    transition: background .3s, color .3s, transform .2s;
    align-self: flex-end !important;
}

.cschat-btn:hover {
    background: #4a90e2;
    color: #fff;
    transform: scale(1.05);
}

/* ===== Typing Indicator ===== */
.cschat-typing {
    display: flex;
    gap: 6px;
    align-self: flex-start;
    margin: 4px 0;
}

.cschat-typing .dot {
    width: 8px;
    height: 8px;
    background: #555;
    border-radius: 50%;
    animation: cschat-dotPulse 1s infinite;
}

.cschat-typing .dot:nth-child(2) {
    animation-delay: .2s
}

.cschat-typing .dot:nth-child(3) {
    animation-delay: .4s
}

@keyframes cschat-dotPulse {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-4px)
    }
}

/* ===== Popup Hint ===== */
#cschat-popup {
    position: fixed;
    bottom: 96px;
    right: 24px;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: cschat-slideInOut 6s ease-in-out forwards;
    z-index: 998;
    max-width: 280px;
}

@keyframes cschat-slideInOut {
    0% {
        transform: translateX(100%);
        opacity: 0
    }

    10%,
    80% {
        transform: translateX(0);
        opacity: 1
    }

    100% {
        transform: translateX(100%);
        opacity: 0
    }
}

#cschat-popup .cschat-avatar {
    width: 100px;
    height: 100px;
    margin-bottom: -50px;
    animation: cschat-wave 4s infinite ease-in-out;
}

@keyframes cschat-wave {

    0%,
    100% {
        transform: rotate(0deg)
    }

    20% {
        transform: rotate(14deg)
    }

    40% {
        transform: rotate(-8deg)
    }

    60% {
        transform: rotate(14deg)
    }

    80% {
        transform: rotate(-4deg)
    }
}

#cschat-popup::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 89%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

.cschat-text {
    font-size: 15px;
    position: relative;
    animation: cschat-slideInRTL .8s ease-out forwards;
}

@keyframes cschat-slideInRTL {
    from {
        transform: translateX(100%);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

.cschat-text::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #2c3e50;
}

/* ===== End Chat Overlay ===== */
#cschat-end {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.8);
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: none;
    z-index: 1001;
    animation: cschat-popIn .4s ease-out forwards;
}

@keyframes cschat-popIn {
    to {
        transform: translate(-50%, -50%) scale(1)
    }
}

#cschat-end h2 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 8px;
}

#cschat-end p {
    font-size: 16px;
    color: #555;
}

/* ===== Responsive ===== */
@media (max-width:600px) {
    #cschat-toggle-btn {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    #cschat-container {
        width: 90vw;
        height: 80vh;
        bottom: 20px;
        right: 5vw;
    }

    #cschat-output {
        padding: 12px;
        gap: 8px;
    }

    .cschat-message {
        font-size: 13px;
        padding: 10px 14px;
        max-width: 80%;
    }

    #cschat-header {
        padding: 12px 14px;
        font-size: 15px;
    }

    .cschat-btn {
        padding: 5px 10px;
        font-size: 13px;
    }

    .cschat-grid {
        justify-content: center;
    }

    #cschat-popup {
        bottom: 70px;
        right: 10px;
        max-width: 80vw;
        padding: 8px 10px;
    }

    #cschat-popup .cschat-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: -30px;
    }

    .cschat-text {
        font-size: 14px;
    }
}

/* ===== Unique Buttons ===== */
.cschat-btn1{
    position: relative;
    left:-50px;
}
.cschat-btn-end {
    background: none;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    position: relative;
    overflow: hidden;
    transition: color .3s;
  
     padding: 4px 9px;
}

.cschat-btn-end::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(231, 76, 60, 0.1);
    transform: translateX(-100%);
    transition: transform .4s ease-in-out;
}

.cschat-btn-end:hover {
    color: #fff;
}

.cschat-btn-end:hover::before {
    transform: translateX(0);
    background: #e74c3c;
}
.cschat-btn-repeat {
    background: none;
    border: 2px solid green;
    color:green;
    position: relative;
    overflow: hidden;
    transition: color .3s;
    padding: 4px 9px;
}

.cschat-btn-repeat::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(231, 76, 60, 0.1);
    transform: translateX(-100%);
    transition: transform .4s ease-in-out;
}

.cschat-btn-repeat:hover {
    color: #fff;
}

.cschat-btn-repeat:hover::before {
    transform: translateX(0);
    background: green;
}
