/* AI Assistant Styles */

@keyframes pulse-shadow {
    0% {
        filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.3));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.4));
        transform: scale(1.05);
    }
    100% {
        filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.3));
        transform: scale(1);
    }
}

#ai-chat-bubble {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 90px;
    height: 90px;
    background: url('Images/Chat_Icon.png') no-repeat center center;
    background-size: contain;
    cursor: pointer;
    z-index: 990; /* Lowered z-index */
    animation: pulse-shadow 1.5s infinite;
    border-radius: 0;
}

/* Chat Window */
#ai-chat-window {
    position: fixed;
    bottom: 190px; /* Position above the icon */
    right: 2rem;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex; /* Always flex */
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    z-index: 991; /* Lowered z-index */
    /* --- Visibility & Animation --- */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s ease-out;
}

#ai-chat-window.visible {
    /* --- Make it visible and interactive --- */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #1A2238; /* Using site's primary color */
    color: white;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

#close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

/* Chat Body */
.chat-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f4f7f9;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user {
    background-color: #FF6A3D;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-message.ai {
    background-color: #E9ECEF;
    color: #333;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.chat-message a {
    color: #1A2238;
    text-decoration: underline;
}

/* Chat Footer */
.chat-footer {
    display: flex;
    align-items: center; /* Align items vertically */
    padding: 0.75rem;
    border-top: 1px solid #ddd;
    background-color: #fff;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0.7rem 1.1rem;
    font-size: 0.95rem;
    margin-right: 0.75rem; /* Increased margin */
    transition: border-color 0.2s;
}

#chat-input:focus {
    outline: none;
    border-color: #FF6A3D;
}

#send-chat {
    background-color: #1A2238;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    flex-shrink: 0; /* Prevent button from shrinking */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 0; /* Hide the "Send" text */
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-send"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px;
}

#send-chat:hover {
    background-color: #FF6A3D;
    transform: scale(1.1);
}
