@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --primary-color: #673ab7;
    --secondary-color: #512da8;
    --user-msg-bg: #e3f2fd;
    /* --- CHANGE: Make bot message background slightly transparent --- */
    --bot-msg-bg: rgba(241, 241, 241, 0.9); 
    --text-color: #333;
    --light-text-color: #fff;
    --border-color: #e0e0e0;
}

/* --- ADDED: Styles for the particle canvas --- */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1; /* This is crucial to keep it in the background */
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    /* --- REMOVED: background-color: var(--body-bg); --- */
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* This ensures content is on top of the new animated background */
    position: relative; 
    z-index: 1;
}

.navbar {
    background-color: var(--primary-color);
    padding: 15px 20px;
    color: var(--light-text-color);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.navbar a {
    color: var(--light-text-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.navbar a:hover {
    transform: scale(1.1);
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0 auto;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 20px auto; /* Added top/bottom margin */
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
    overflow: hidden;
    /* --- ADDED: A subtle background to make it stand out --- */
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    border: none; /* --- REMOVED: border: 1px solid var(--border-color); --- */
    /* --- CHANGED: Make the chatbox background slightly see-through --- */
    background-color: rgba(255, 255, 255, 0.85); 
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    scroll-behavior: smooth;
}

/* All other styles below remain the same */

.message {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    max-width: 85%;
    align-items: flex-end;
    animation: fadeIn 0.5s ease-in-out;
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-icon {
    font-size: 1.5rem;
    padding: 10px;
    border-radius: 50%;
    color: var(--light-text-color);
    flex-shrink: 0;
}

.message.user .message-icon {
    background-color: #1e88e5;
}

.message.bot .message-icon {
    background-color: var(--primary-color);
}

.message-content {
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
}

.message.user .message-content {
    background-color: var(--user-msg-bg);
    color: #0d47a1;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background-color: var(--bot-msg-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

textarea {
    flex-grow: 1;
    padding: 12px 18px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: box-shadow 0.2s;
    background-color: rgba(255, 255, 255, 0.9); /* Slight transparency */
}

textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.2);
}

button {
    padding: 12px;
    font-size: 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-indicator span {
    height: 10px;
    width: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}