/* 1. The Floating Toggle Button */
.chat-open-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999; /* High z-index to stay above Master Page content */
    background: linear-gradient(45deg, red, red);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 4px 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

    .chat-open-btn:hover {
        transform: scale(1.05);
    }

/* 2. The Main Chat Container */
.chat-container {
    display: none; /* Toggled to 'flex' by JavaScript */
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 330px;
    height: 450px;
    background-color: #ffffff;
    border-radius: 15px;
    border: 1px solid black;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    flex-direction: column; /* Stack header, messages, and input */
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* 3. Header */
.chat-header {
    background-color: #222;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 4. Message Display Area */
.chat-messages {
    flex: 1; /* Grows to fill available space */
    padding: 15px;
    overflow-y: auto;
    color:white;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    /* 5. Message Bubbles */
    .chat-messages p {
        margin: 0;
        color:black;
        padding: 8px 12px;
        border-radius: 10px;
        max-width: 85%;
        line-height: 1.4;
    }

.bot-msg {
    align-self: flex-start;
}

.user-msg {
    background-color: #d32f2f;
    color: white;
    align-self: flex-end;
}

.user-msg p {
    color: white;
}

/* 6. Input Area */
.chat-input-area {
    padding: 10px;
    display: flex;
    gap: 5px;
    border-top: 1px solid #eee;
}

    .chat-input-area input {
        flex: 1;
        padding: 8px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }

    .chat-input-area button {
        background: #d32f2f;
        color: white;
        border: none;
        padding: 0 15px;
        border-radius: 5px;
        cursor: pointer;
    }

/* 7. Fallback Suggestion Buttons */
.topic-btn {
    display: inline-block;
    background: #fff;
    border: 1px solid #d32f2f;
    color: #d32f2f;
    padding: 5px 10px;
    margin: 3px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

    .topic-btn:hover {
        background: #d32f2f;
        color: #fff;
    }

.chat-footer {
    background: linear-gradient(45deg, black, red, black);
    padding: 8px 15px;
    font-size: 11px;
    color: #666;
    display: flex;
    justify-content: space-between; /* Puts name on left, phone on right */
    align-items: center;
    border-top: 1px solid #eee;
}

    .chat-footer a {
        background: linear-gradient(45deg, white, #ffffff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        text-decoration: none;
        font-weight: bold;
    }

        .chat-footer a:hover {
            text-decoration: underline;
        }

    .chat-footer span {
        background: linear-gradient(45deg, #ffffff, #ffffff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        text-decoration: none;
        font-weight: bold;
    }

/*css for the logo overlay*/


.chat-messages {
    position: relative; /* Required so the overlay stays inside */
}

.logo-fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Matches chat background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    /* Animation: Name, Duration, Timing, Fill-Mode */
    animation: logoIntro 4s ease-in-out forwards;
}

    .logo-fade-overlay img {
        width: 240px; /* Adjust size as needed */
        height: auto;
    }

@keyframes logoIntro {
    0% {
        opacity: 0;
    }
    /* Start invisible */
    40% {
        opacity: 1;
    }
    /* Fade in (0.5s) */
    60% {
        opacity: 1;
    }
    /* Stay visible until 2s */
    100% {
        opacity: 0; /* Fade out */
        visibility: hidden; /* Remove from view */
        pointer-events: none; /* Allow clicks to pass through */
    }
}


/* This class will be applied to the welcome text */
.welcome-text {
    opacity: 0; /* Start invisible */
}

.animate-welcome {
    /* 0.5s duration, but waits 2 seconds to start */
    animation: fadeInText 0.5s ease-in forwards;
    animation-delay: 2s;
}

@keyframes fadeInText {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/*type writer effect*/

.cursor {
    font-weight: bold;
    color: #d32f2f;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Ensure the overlay is truly hidden after use */
.hidden-overlay {
    display: none !important;
}

.cursor {
    font-weight: bold;
    color: #d32f2f;
    animation: blink 0.8s infinite;
    display: none; /* Keep it hidden until the logo is gone */
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}
