/* Conversation Memory UI Styles */

/* Conversation controls */
.conversation-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.conversation-selector {
  display: flex;
  gap: 10px;
  align-items: center;
}

#conversation-select, #text-conversation-select {
  min-width: 200px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.memory-status {
  font-size: 0.8em;
  color: #666;
}

/* Buttons for conversation management */
#new-conversation, #delete-conversation {
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

#new-conversation {
  background-color: #4CAF50;
  color: white;
  border: none;
}

#new-conversation:hover {
  background-color: #388E3C;
}

#delete-conversation {
  background-color: #F44336;
  color: white;
  border: none;
}

#delete-conversation:hover {
  background-color: #D32F2F;
}

/* Export/import buttons */
#export-conversations, #import-conversations, #clear-all-conversations {
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  margin-right: 10px;
}

#export-conversations {
  background-color: #2196F3;
  color: white;
  border: none;
}

#export-conversations:hover {
  background-color: #1976D2;
}

#import-conversations {
  background-color: #9E9E9E;
  color: white;
  border: none;
}

#import-conversations:hover {
  background-color: #757575;
}

#clear-all-conversations {
  background-color: #F44336;
  color: white;
  border: none;
}

#clear-all-conversations:hover {
  background-color: #D32F2F;
}

/* Message history styling enhancements */
.message {
  position: relative;
}

.message:hover {
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message .timestamp {
  position: absolute;
  right: 10px;
  bottom: 5px;
  font-size: 0.7em;
  color: #999;
}

/* Enhanced conversation history */
.message-container {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 20px;
}

.message-group {
  margin: 0;
  padding: 0;
}

.message-date-divider {
  text-align: center;
  margin: 15px 0;
  position: relative;
}

.message-date-divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e0e0e0;
  z-index: 1;
}

.message-date-divider span {
  background: #fff;
  padding: 0 15px;
  position: relative;
  z-index: 2;
  font-size: 0.8em;
  color: #999;
}

/* No conversations placeholder */
.no-conversations {
  text-align: center;
  padding: 30px;
  color: #666;
}

.no-conversations .icon {
  font-size: 40px;
  color: #ddd;
  margin-bottom: 15px;
}

/* Conversation list in sidebar */
.conversations-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 10px;
}

.conversation-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.conversation-item:hover {
  background-color: #f5f5f5;
}

.conversation-item.active {
  background-color: #e3f2fd;
  border-left: 3px solid #2196F3;
}

.conversation-item .title {
  font-weight: bold;
  margin-bottom: 5px;
}

.conversation-item .date {
  font-size: 0.8em;
  color: #999;
}

.conversation-item .preview {
  font-size: 0.9em;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive design for conversation controls */
@media (max-width: 600px) {
  .conversation-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .conversation-selector {
    margin-bottom: 10px;
  }
  
  #conversation-select, #text-conversation-select {
    width: 100%;
  }
}