/* --- CSS STYLES --- */
:root {
    --primary-color: #003366; /* School Blue */
    --secondary-color: #f4f4f4;
    --accent-color: #ffcc00;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@keyframes chatheadshake {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(-5deg); }
    20% { transform: rotate(5deg); }
    30% { transform: rotate(-4deg); }
    40% { transform: rotate(4deg); }
    50% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Chat Button (Floating) */
.chat-toggler {
    position: fixed;
    bottom: 170px;
    right: 3.6%;
    background-color: transparent;
    background: none;
    outline: none;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    z-index: 1;
}

    .chat-toggler img {
        height: auto;
        width: 6rem;
        display: block;
        animation: chatheadshake 3s infinite ease-in-out;
        z-index: 1;
    }

.chat-toggler:hover {
    transform: scale(1.1);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.chat-window.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* Header */
.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Chat Body (Messages) */
.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.bot-message {
    background-color: white;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

/* Chat Footer (Input) */
.chat-footer {
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.chat-footer input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.chat-footer button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
}

.message a {
    color: #0056b3; /* Darker blue for bot messages */
    text-decoration: underline;
    font-weight: bold;
}

.user-message a {
    color: #ffcc00; /* Yellow accent for user messages so it stands out against school blue */
}

.message a:hover {
    opacity: 0.8;
}

@media (max-width: 425px) {
    .chat-toggler {
        position: fixed;
        bottom: 180px;
        right: 10%;
        background-color: transparent;
        background: none;
        outline: none;
        color: white;
        border: none;
        width: 20px;
        height: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s;
        z-index: 1000;
    }

        .chat-toggler img {
            height: auto;
            width: 5rem;
            display: block;
            animation: chatheadshake 3s infinite ease-in-out;
        }


}


@media (max-width: 480px) {
    .chat-window {
        width: 90%;
        right: 5%;
        bottom: 90px;
    }
}




/* Typing Indicator */

.typing {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
}

    .typing span {
        width: 6px;
        height: 6px;
        background: #999;
        border-radius: 50%;
        animation: typing 1.4s infinite;
    }

        .typing span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typing {
    0% {
        opacity: .2;
        transform: translateY(0px);
    }

    20% {
        opacity: 1;
        transform: translateY(-3px);
    }

    40% {
        opacity: .2;
        transform: translateY(0px);
    }
}

.suggested-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.suggested-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 10px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

    .suggested-btn:hover {
        background: #f4f4f4;
    }