/* 
  CartaNova Chat Styling
  This stylesheet contains all chat-related styling including
  message appearance and component positioning
*/

/* --------------------
   CHAT LAYOUT & POSITIONING
   -------------------- */

.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.system-prompt-panel {
    flex: 0 0 auto;
}

.chat-messages-container {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: none !important; /* Adjust the default max-height to use available space */
    transition: all 0.3s ease;
}

/* DISABLED: Expand chat area when input is hidden during processing */
/* .chat-window:has(.speech-to-text-container.hidden-during-processing) .chat-messages-container {
    /* Give more height when input is hidden */
    /* min-height: calc(100vh - 180px);
} */

.speech-to-text-container {
    flex: 0 0 auto;
    position: relative;
    bottom: 0;
    width: 100%;
    margin-top: auto;
    transition: all 0.3s ease;
}

/* DISABLED: Smooth hiding animation */
/* .speech-to-text-container.hidden-during-processing {
    opacity: 0;
    transform: translateY(20px);
    height: 0 !important;
    overflow: hidden;
    margin: 0;
    padding: 0;
} */

/* Ensure chat window takes full available height */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.action-buttons-container {
    flex: 0 0 auto;
}

.chat-message {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 1.6px;
    position: relative;
    max-width: 100%;
}

/* Add extra spacing before user messages (follow-up messages) */
.chat-message.user {
    margin-top: 3.2px;
}

/* Remove extra spacing for the first message in chat */
.chat-message:first-child {
    margin-top: 0;
}

/* Dark theme message styles */
html[data-theme='dark'] .chat-message.system {
    background-color: #333;
    border-left: 4px solid #666;
    color: #e1e1e1;
}
