pre {
  white-space: pre-wrap;       /* Since CSS 2.1 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
  overflow-wrap: break-word;   /* CSS3 */
  overflow-x: auto;            /* Horizontal scrollbar if needed */
  max-width: 800px;
  width: 90vw;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}




body {
  background-image: url("images/BG.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
color: white;
font-size: 15px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
margin: 0;
padding: 20px;
box-sizing: border-box;
position: fixed;
}


.icon-container {
    position: fixed;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 90vw;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
}

.icon-container button {
    background-color: transparent;
    border: none;
}

.icon-container i {
    color: lime;
    font-size: 16px;
    cursor: pointer;
}

.icon-container i:hover {
    color: white;
    font-size: 18px;
    transition: color 0.3s ease;
}
.main-container {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    width: 100%;
    margin-bottom: 100px;
    padding: 20px;
    background-color: #141414;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
}


/* Conversation Container */
.conversation-container {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.message {
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in-out;
    white-space: pre-wrap;
}

.message i {
    margin-right: 8px;
}

.user-message i {
    color: #ffffff;
}

.bot-message i {
    color: #ffffff;
}

.user-message {
    background-color: #388e3c;
    align-self: flex-end;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.2);
}

.bot-message {
    background-color: #013d79;
    align-self: flex-start;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 255, 0.2);
}

/* Input Container */
#input-container {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

/* Input Container */
#input-container button {
     background-color: transparent;
}

/* Input Container */
#input-container i {
    color: lime;
}

#input-container i:hover {
    color: #028802;
}
#userInput {
    flex: 1 1 auto;
    max-width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: black;
    color: #ffffff;
    outline: none;
    transition: border 0.2s;
    font-size: 16px;
    box-sizing: border-box;
}

#userInput:focus {
    border-color: #4caf50;
}

#submitMessage, #toggle-button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

#submitMessage {
    background-color: #4caf50;
    color: #ffffff;
    flex-shrink: 0;
}


#toggle-button {
    background-color: #1e88e5;
    color: #ffffff;
}

#toggle-button.active {
    background-color: #e53935;
}

#toggle-button i, #submitMessage i {
    font-size: 18px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar Controls */
.avatar-controls {
    position: fixed;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    top: 50px;
    width: 90vw;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
}

.avatar-dropdown {
    padding: 8px;
    border-radius: 8px;
    background-color: #2e2e2e;
    color: #ffffff;
    border: 1px solid #444;
    text-align: center;
}

/* Avatar Container */
.avatar-container {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1000;
}

.avatar-wrapper {
    position: fixed;
    cursor: move;
    width: 200px;
    height: 200px;
    user-select: none;
    touch-action: none;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    bottom: -10px;
    right: 120px;
    width: 20px;
    height: 20px;
    background-color: #4caf50;
    border-radius: 50%;
    cursor: se-resize;
}

/* Style for controls container */
.controls-container {
    display: flex;
    gap: 10px;
    margin: 20px;
}

/* Style for the voice dropdown */
.voice-dropdown {
    padding: 8px;
    border-radius: 8px;
    background-color: #2e2e2e;
    color: #ffffff;
    border: 1px solid #444;
    text-align: center;
}

.accent-dropdown {
    padding: 8px;
    border-radius: 8px;
    background-color: #2e2e2e;
    color: #ffffff;
    border: 1px solid #444;
    text-align: center;
}

.expression-dropdown {
    padding: 8px;
    border-radius: 8px;
    background-color: #2e2e2e;
    color: #ffffff;
    border: 1px solid #444;
    text-align: center;
}
footer {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
}

footer p {
  font-size: 14px;
  color: white;
}

/* Style for message wrapper */
.message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
}

.message-wrapper .action-icons {
    display: flex;
    justify-content: space-evenly;
    width: 100%;
    margin-top: 5px;
}

.action-icons i {
    font-size: 20px;
    color: #fff;
    cursor: pointer;
}

.action-icons i:hover {
    color: #ccc;
}

#top-mic-button {
    background-color: transparent;
    border: none;
}

#top-mic-button i {
    color: lime;
    font-size: 16px;
}

#top-mic-button:hover i {
    color: white;
    font-size: 18px;
    transition: color 0.3s ease;
}

#top-mic-button.active i {
    color: #e53935;
}

/* Adjusted style for the listening status text */
#listening-status {
    font-size: 14px; /* Reduced font size */
    font-weight: bold;
    display: none; /* Hidden by default */
}

#listening-status.active {
    display: inline-block;
    animation: flash 0.5s infinite; /* Faster animation */
}

@keyframes flash {
    0% { color: lime; }
    25% { color: white; }
    50% { color: orange; }
    75% { color: blue; }
    100% { color: lime; }
}

@media (max-width: 768px) {
    .main-container {
        max-width: 100%;
        padding: 10px;
    }

    .conversation-container {
        max-height: none;
    }

    .icon-container {
        position: fixed;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 90vw;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
    }

    .avatar-controls {
        position: fixed;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        top: 50px;
        width: 90vw;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
    }

    .avatar-container {
        position: fixed;
        top: 80px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }


    
    #avatarSelect,
    #voiceSelect,
    #accentSelect,
    #expressionSelect {
        width: calc(25% - 8px); /* Account for gap */
        min-width: 70px; /* Prevent too narrow selects */
        font-size: 14px; /* Slightly smaller font for mobile */
    }

    #input-container {
        flex-direction: column;
        align-items: flex-start;
    }

    #userInput {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 600px) {
    #input-container {
        flex-direction: column;
        align-items: stretch;
    }
    #submitMessage {
        width: 100%;
    }
}