/* General styling */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #000000a8;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-mode {
    background-color: #ffffff;
    color: #000000;
}

.chat-container {
    width: 400px;
    max-width: 90%;
    background-color: #02337b;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.chat-box {
    padding: 20px;
    height: 400px;
    overflow-y: scroll;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
}

.chat-box::-webkit-scrollbar {
    display: none;
}

.message {
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    width: fit-content;
    max-width: 80%;
}

.message.bot {
    background-color: #ffffff;
    align-self: flex-start;
}

.message.user {
    background-color: #31c8e7;
    color: #fff;
    align-self: flex-end;
}

.input-container {
    display: flex;
    border-top: 1px solid #ffffff;
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    border: none;
    outline: none;
    color: rgb(255, 255, 255);
    background-color: black;
}

button {
    background-color: #42da3c;
    
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
}
button:hover {
    background-color: #ff5722;
    color: #fff;
}

button#voice-button {
    background-color: #ff5722;
    margin-left: 5px;
}
button#voice-button:hover {
    background-color: #42da3c;
    color: #fff;
}

button#dark-mode-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 18px;
}
button#dark-mode-btn:hover {
    background-color: #c6f8c4;
    color: #fff;
}

/* Voice listening animation */
.voice-animation {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 87, 34, 0.5);
    border-radius: 50%;
    display: none;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(1.5);
        opacity: 0;
    }
}

/* Dark mode styling */
body.dark-mode {
    background-color: #f4f4f4;
    color: #1a1a1a;
}

body.dark-mode .chat-container {
    background-color: #e0e0e0;
}

body.dark-mode button {
    background-color: #7de778c9;
    color: #fff;
}
body.dark-mode button#dark-mode-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffffff;
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 18px;
}
body.dark-mode button:hover {
    background-color: #42da3c;
    color: #fff;
}
body.dark-mode button#dark-mode-btn:hover {
    background-color: #000000;
    color: #fff;
}
body.dark-mode button#voice-button {
    background-color: #f48b6c;
    margin-left: 5px;
}
body.dark-mode button#voice-button:hover {
    background-color: #7ee778;
    color: #fff;
}
body.dark-mode input[type="text"] {
    flex: 1;
    padding: 15px;
    border: none;
    outline: none;
    color: rgb(0, 0, 0);
    background-color: #b0aeaeb2;
}
body.dark-mode .message.user {
    background-color: #45cfea97;
    color: #fff;
    align-self: flex-end;
}

/* Initially hide speaker icon */
.speaker-icon {
    margin-left: 8px;
    cursor: pointer;
    font-size: 18px;
    display: none; /* Initially hidden */
}
/* Show speaker icon when hovering over the bot message */
.bot:hover .speaker-icon {
    display: inline; /* Show on hover */
}
