/* General Styling */
body {
    font-family: 'Arial', sans-serif;
    background-color: #4D55CC;
    color: #B5A8D5;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
header {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #4D55CC;
    z-index: -1;
    top: 0;
    left: 0;
}

header h1 {
    font-size: 32px;
    margin: 0;
}

/* Main container */
.main-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 90%;
    padding: 20px;
    margin: 0 auto;
    grid-template-rows: repeat(2, 1fr);
}

/* Grid box styling */
.grid-box {
    background: #211C84;
    border-radius: 25px;
    padding: 50px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Buttons */
button {
    background: #B5A8D5;
    color: #2B303A;
    border: none;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 75px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.3s;
}

/* Remove bullets from the search history list */
#history-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Style the history list items */
#history-list li {
    cursor: pointer;
    padding: 10px 15px;
    background: #B5A8D5;
    color: #2B303A;
    margin: 5px 0;
    border-radius: 75px;
    text-align: center;
    transition: background 0.3s ease;
}

/* Change background color when hovered */
#history-list li:hover {
    background: #4D55CC;
}

/* Grayscale Mode */
.grayscale {
    filter: grayscale(100%);
    transition: filter 0.3s ease-in-out;
}

/* Chatbox Styling */
.chatbox {
    display: none;
    width: 100%;
    height: 200px;
    background-color: #211C84;
    border: 1px solid #211C84;
    position: relative;
    overflow: hidden;
}

/* Show the chatbox when it's active */
.chatbox.visible {
    display: flex;
}

#drug-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border-radius: 75px;
    border: none;
    outline: none;
    text-align: center;
}

/* Chat header with X button on the left and title centered */
.chat-header {
    background-color: #211C84;
    color: #B5A8D5;
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    align-items: center;
}

/* Close button on the left */
.chat-header .close-btn {
    background: none;
    border: none;
    color: #B5A8D5;
    font-size: 18px;
    display: flex;
    cursor: pointer;
}

/* Title centered */
.chat-header .title {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

/* Chat messages container */
.chat-messages {
    padding: 10px;
    height: calc(100% - 80px); /* Adjust height to fit within the chatbox */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align messages to the right */
}

/* Chat input container centered */
.chat-input {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    width: 100%;
    background-color: #211C84;
}

/* Input field styling */
.chat-input input {
    width: 90%;
    font-size: 18px;
    border-radius: 75px;
    border: none;
    outline: none;
    text-align: center;
}

/* Button styling */
.chat-input button {
    padding: 10px;
}

/* Individual message styling */
.message {
    background-color: #B5A8D5;
    color: #211C84;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 75px;
    max-width: 70%; /* Prevents excessively wide messages */
    word-wrap: break-word;
    align-self: flex-end; /* Aligns messages to the right */
}

/* Styling for the barcode overlay */
.barcode-overlay {
    position: center;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    color: white;
    font-size: 18px;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
}

/* Reminder List Styling */
#reminder-list {
    max-height: 200px;  /* Set the height to allow scrolling */
    overflow-y: auto;    /* Make sure vertical scrolling is enabled */
    padding-right: 10px; /* Space for scrollbar */
    margin-top: 10px;    /* Add some space at the top for aesthetics */
}

/* Styling for the Reminder Box */
#reminder-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Add scroll to the drug info box */
#drug-info-box {
    overflow-y: auto;
    max-height: 300px; /* Set max height for scroll */
    padding-right: 15px; /* For scrollbar spacing */
}
