/* /styles/css/chat-bot.css */

/* ===== NEW GRADIENT ICON CSS ===== */
.chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    cursor: pointer;
    transition: transform 0.3s;

    /* Controls the size of the icon directly */
    font-size: 72px;

    /* The gradient magic! */
    background: linear-gradient(45deg, var(--dramatic-red), var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text; /* Clips the background to the text/icon shape */
    background-clip: text;
    -webkit-text-fill-color: transparent; /* Makes the icon color transparent to show the gradient */

    /* Adds a subtle shadow to make the icon pop from the page */
    filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.3));
}
/* =================================== */

.chat-icon:hover {
    transform: scale(1.1);
}

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    background-color: var(--card-bg-color);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.chat-header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-family: var(--heading-font);
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close-chat:hover {
    opacity: 1;
}

.chat-body {
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-messages .message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 85%;
    line-height: 1.4;
}

.bot-message {
    background-color: #f1f0f0;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

body.dark-mode .bot-message {
    background-color: #3e3e3e;
    color: var(--text-color);
}

.user-message {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

#user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
}

#user-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

#send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#send-btn:hover {
    background-color: #d35400;
}
chat-body .bot-message a {
    color: #E74C3C; /* Uses the site's dramatic red for high contrast */
    text-decoration: underline;
    font-weight: bold;
}

/* Change link color on hover for interactivity */
.chat-body .bot-message a:hover {
    color: var(--primary-color); /* Changes to the site's primary orange on hover */
}
/* /styles/css/chat-bot.css */

/* --- Add this new code for smooth and invisible scrolling --- */

/* Add smooth scrolling behavior to the chat body */
.chat-body {
  scroll-behavior: smooth;
}

/* Hide the scrollbar for modern browsers like Chrome, Safari, and Edge */
.chat-body::-webkit-scrollbar {
  display: none;
}

/* Hide the scrollbar for Firefox */
.chat-body {
  scrollbar-width: none; /* For Firefox */
  -ms-overflow-style: none;  /* For Internet Explorer and Edge */
}
/* /styles/css/chat-bot.css */

/* --- Add this new code for the typing indicator --- */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #aaa;
    border-radius: 50%;
    display: inline-block;
    
    /* Apply the animation */
    animation-name: bounce;
    animation-duration: 1.4s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

body.dark-mode .typing-indicator span {
    background-color: #777;
}

/* Add a delay to each dot for the sequential effect */
.typing-indicator span:nth-of-type(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-of-type(3) {
    animation-delay: 0.4s;
}

/* Define the bouncing keyframe animation */
@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}
body.dark-mode .chat-body .bot-message a {
    color: var(--secondary-color); /* Bright yellow for high contrast on dark backgrounds */
}

/* Optional: Make the hover effect in dark mode stand out more */
body.dark-mode .chat-body .bot-message a:hover {
    color: #ffffff; /* Changes to pure white on hover */
}
