
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Background Overlay (Wallpaper) */
.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    filter: blur(8px);
    z-index: -1;
}

/* Chat Icon */
.chat-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--first-color);
    color: white;
    width: 53px; 
    height: 53px;
    border-radius: 50%; /* Makes it round */
    cursor: pointer;
    font-size: 20px; /* Adjust font size */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: transform 0.3s ease-in-out;
}

.chat-icon:hover {
    transform: scale(1.05);
}

/* Tooltip for hover text on the right */
.chat-icon::after {
    content: "Chatbot";
    position: absolute;
    bottom: 50%;
    left: 105%;
    transform: translateY(50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px;
    font-size: 14px;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

/* On Hover */
.chat-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Chatbot Container */
.chat-container {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 350px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    display: none; /* Initially hidden */
    z-index: 9998;
    display: flex;
    flex-direction: column;
    height: 450px;
    animation: fadeIn 0.4s ease-out;
}

/* Chat Header */
.chat-header {
    background-color: var(--first-color);
    color: white;
    padding: 18px;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 25px;
    cursor: pointer;
}

.close-btn:hover {
    color: black;
    cursor: pointer;
}

/* Chat Box */
.chat-box {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    max-height: 350px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Chat Input */
.chat-input {
    display: flex;
    padding: 12px;
    background-color: #f1f1f1;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.chat-input input {
    width: 80%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
}

.chat-input button {
    padding: 10px 16px;
    border: none;
    background-color: var(--first-color);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: black;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    word-wrap: break-word; /* Ensure long words break and do not overflow */
    max-width: 70%;
}

/* User Message */
.message.user {
    background-color: var(--first-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

/* Bot Message */
.message.bot {
    background-color: #e1f5fe;
    color: #007bff;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

/* Link styling inside messages */
.message a {
    color: #007bff; /* Color of links */
    text-decoration: none; /* Remove underline */
    word-wrap: break-word; /* Ensure links break across lines */
    word-break: break-word; /* Handle long links */
}

.message a:hover {
    text-decoration: underline; /* Underline links on hover */
}

/* Handling large messages */
.message.large-message {
    max-width: 90%; /* Allow larger messages to take up more space */
    white-space: normal; /* Allow text to wrap */
    overflow-wrap: break-word; /* Ensure no overflow */
}

/* Chat Close Message */
.chat-close-message {
    font-size: 14px;
    color: #ff6347; /* Close message color */
    text-align: center;
    padding: 10px;
    font-weight: bold;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

/* Typing Animation */
.typing {
    font-style: italic;
    color: #007bff;
    margin-top: 5px;
    animation: typingAnimation 1.5s steps(5) infinite;
}

@keyframes typingAnimation {
    0% { opacity: 0; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .chat-container {
        width: 90%; 
        bottom: 80px; 
        left: 5%; /* Center the chat container */
    }

    .chat-icon {
        bottom: 775px; /* Position the icon relative to the bottom */
        left: 5%; /* Align the icon with the chat container */
        padding: 12px;
        font-size: 18px;
        z-index: 2; /* Ensure it's above the chat container */
    }

    .chat-header {
        font-size: 17px;
    }
}

@media (max-width: 450px) {
    .chat-icon {
        bottom: 770px; /* Position the icon relative to the bottom */
        left: 4.5%; /* Align the icon with the chat container */
        padding: 10px;
        font-size: 21px;
        z-index: 2; /* Ensure it's above the chat container */
        position: absolute;
        width: 51px; 
        height: 51px;
    }
}

/* Animation for Opening Chat (No changes needed) */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
