:root {
    --chat-input-height: 80px;
}

#sidebarChat {
    flex-shrink: 0;
    width: 100%;
    /* height: 99%; */
    background-color: var(--primary-bg);
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure it fills parent */
    /* margin-left: auto;  */
    display: flex; 
    flex-direction: column; 
    /* margin-left: 1rem; */
}

/* Chat message bubbles */
.message-bubble {
    max-width: 100%;
    margin-top: 1rem;
    /* margin: 1rem 1rem;  */
    /* padding: 0.8rem 1rem; */
    /* border-radius: 12px; */
    /* margin: 0.5rem 0; */
    /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); */
}

.user-bubble {
    background-color:  white;/* #1a73e8;*/
    color: var(--text-color-regular);
    /* align-self: flex-end; */
    /* margin-right: 1px; */
    border: 1px solid var(--border-color); 
    border-radius: 12px;
    border-bottom-right-radius: 4px;
    padding: 0.8rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

    width: fit-content; 
    margin-left: auto;       /* pushes it to the right */
    margin-right: 1px;
}

/* Update the system-bubble style to ensure it has padding on the right */
.system-bubble {
    color: var(--text-color-special);
    align-self: flex-start;
    position: relative;
    max-width: 90%;
    word-wrap: break-word;
    /* padding-right: 10px;  */
}

/* Update the speaker-icon style to position it outside the text area */
.system-bubble .speaker-icon {
    position: absolute;
    /* top: 50%;
    right: 5px;  Position closer to the edge 
    transform: translateY(-50%); Center vertically */
    cursor: pointer;
    color: var(--text-color);
    font-size: 22px;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    /* padding: 8px; */
    z-index: 10;
    transition: all 0.2s ease;
}

/* Add styles for the hover effect */
.system-bubble:hover {
    opacity: 0.8; /* Dim the text slightly */
}

.system-bubble:hover .speaker-icon {
    display: flex; /* Show on hover */
}


/* Chat input area */
.chat-input-container {
    flex-shrink: 0;
    padding: 10px;
    background: var(--primary-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 0;
    /* padding: 1rem; */
    background-color: var(--primary-bg);
    display: flex;
    /* gap: 0.5rem  ; */
    /* Remove absolute positioning so it stays in flow */
    /* position: absolute; */
    /* bottom: 0; */
    height: var(--chat-input-height);
    width: 100%; /* Use full width */
    margin-left: 0;
    margin-bottom: 0;
    margin-right: 0;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin-left: 0px;
    margin-bottom: 10px;
}

#powered-by-ai {
  font-size: 0.8rem;      /* smaller than normal text */
  font-style: italic;     /* italic look */
  color: #666;            /* softer gray tone */
  text-align: center;     /* centered under chatbox */
  margin-top: 6px;        /* little breathing room */
  display: block;         /* make sure it takes its own line */
}


#sidebar-chat-input {
    flex: 1;
    /* padding: 0.8rem 1rem; */
    padding: 10px 40px 10px 10px; /* Add right padding for microphone */
    border: 1px solid var(--border-color);
    border-radius: 24px;
    outline: none;
    background-color: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left; /* Align text normally */
    overflow-x: auto; /* Add horizontal scrollbar when needed */
    white-space: nowrap; /* Prevent text wrapping */
    -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    scrollbar-width: none;  /* Hide scrollbar for Firefox */
    width: 100%;
    margin-left: 0px;
}

#sidebar-chat-input::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

#sidebar-chat-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.speak-button {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.speak-button:hover {
    color: #0056b3;
}


.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
    display: flex;
    align-items: center; /* Align icon and text in the same line */
    gap: 0.25rem; /* Reduces space between icon and text */
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.icon-button:hover {
    background-color: rgba(26, 115, 232, 0.1);
}

.icon-button svg {
    width: 24px;
    height: 24px;
}

  
/* Microphone recording styles */
#toggleCaption {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.microphone-button svg {
    width: 20px;
    height: 20px;
    color: var(--text-color-regular);
}

.microphone-button:hover svg {
    color: var(--text-color-regular);
    transform: scale(1.1);
    opacity: 0.8;    
    cursor: pointer;
}
.microphone-icon,
.ready-to-send {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;  
    font-size: 40px;
    z-index: 10;
    position: absolute; /* Make them overlap */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the icons */
    display: none; /* Initially hidden */
    background: none;
    border: none;
    cursor: pointer;
    color: #4CAF50; /* Shared green color */
}

/* Show one icon at a time */
.microphone-icon.active {
    display: block;
}

.ready-to-send.active {
    display: block;
}


.recording-circle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.575);
    animation: pulse 1.5s infinite;
    z-index: 1;
}
.recording-circle-1 {
    width: 60px;
    height: 60px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.recording-circle-2 {
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 0.5s;
}
@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(0.7); opacity: 0.2; }
    100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

/* Memory card styles */

/* Memory cards */
.memory-cards img {
    width: 50%; /* Adjust as necessary */
    height: auto; /* Maintain aspect ratio */
    margin-top: 1rem; /* Add spacing between images */
    margin-bottom: 1rem; /* Add spacing between images */
    margin-left: 2rem;
    border-radius: 8px; /* Optional: Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional: Add a shadow */
    cursor: pointer; /* Optional: Add a pointer effect if clickable */
    transition: transform 0.2s; /* Optional: Add a hover effect */
}

.memory-cards img:hover {
    transform: scale(1.25); /* Optional: Slightly enlarge on hover */
}

#MemoryCards {
    overflow-y: scroll;
    height: 90%;
}

/* AUDIO button */
.audio-dropdown {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: var(--text-color-regular);
    transition: color 0.2s ease-in-out;
}

.icon-button svg {
    width: 24px;
    height: 24px;
}

.icon-button:hover {
    color: #1a73e8;
}

/* Handle dynamic scrolling */

/* Messages area with fixed height and scrolling */


.chat-messages {
    flex: 1 1 auto;
    /* overflow-y: auto; */
    /* padding: 1rem; */
    /* display: flex; */
    flex-direction: column;
    gap: 1rem;
    background-color: var(--primary-bg);
    border: none;
    /* max-height: calc(100vh - 150px);  */
    padding-bottom: calc(var(--chat-input-height) + 10px);
    padding-top: 10px;
    /* padding-right: 10px; */

    overflow-y: auto; /* Always show vertical scrollbar when needed */
    /* padding: 10px; */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
  }

  /* Hide scrollbar for WebKit browsers */
  .chat-messages::-webkit-scrollbar {
    display: none;
  }

  #dummy {
    height: 100%; /* Matches #messages height */
  }