/* components.css */
/* Version: 0.7.5.w2 */

/* Dropdown styles */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  font-size: 16px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  right: 0;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.version {
  display: block;
  padding: 8px 16px;
  font-size: 12px;
}

.dropdown-item {
  padding: 8px 16px;
  cursor: pointer;
  position: relative;
}

/* Appearance toggle styles */
.appearance-toggle {
  display: none;
  flex-direction: column;
  margin-top: 8px;
}

.dropdown-item:hover .appearance-toggle {
  display: flex;
}

.appearance-option {
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.appearance-option.active {
  background-color: #444;
  color: #fff;
}

body.light-mode .appearance-option.active {
  background-color: #ddd;
  color: #000;
}

/* Button container styles */
#button-container button {
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

/* Chat input styles */
#chat-input {
  padding: 20px;
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.input-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  border-radius: 8px;
  gap: 8px;
  position: relative;
}

/* Common button styles */
#recent-conversations-button,
#new-chat-button,
#submit-button,
#copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease, opacity 0.3s ease, color 0.3s ease;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

#recent-conversations-button,
#submit-button,
#copy-button,
#new-chat-button {
  background-color: transparent;
  color: #4CAF50;
  opacity: 0.7;
}

#recent-conversations-button svg,
#new-chat-button svg,
#submit-button svg,
#copy-button svg {
  width: 24px;
  height: 24px;
}

/* Button hover effects */
#recent-conversations-button:hover,
#copy-button:hover,
#new-chat-button:hover {
  opacity: 1;
  background-color: #4CAF50;
  color: white;
}

#recent-conversations-button:hover svg,
#copy-button:hover svg,
#new-chat-button:hover svg {
  stroke: white;
}

#submit-button:hover {
  opacity: 0.8;
}

/* Question input styles */
#question-input {
  flex-grow: 1;
  margin: 0 8px;
  min-height: 40px;
  position: relative;
  z-index: 1;
}

/* Loading indicator styles */
#loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px;
  border-radius: 4px;
  z-index: 9999;
}

/* Dropup styles */
.dropup {
  position: relative;
  display: inline-block;
}

.dropup::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  height: 20px;
}

.dropup-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 5px);
  left: 0;
  background-color: #222;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0px -8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1000;
  border-radius: 8px;
  padding: 10px;
}

.dropup:hover .dropup-menu,
.dropup:hover::after,
.dropup-menu:hover {
  display: block;
}

/* Conversation list styles */
#conversation-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.conversation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #444;
  cursor: pointer;
}

.conversation-item + .conversation-item {
  margin-top: 4px;
}

.conversation-item:last-child {
  border-bottom: none;
}

.conversation-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.conversation-preview {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 10px;
  font-weight: 300;
  max-width: 80%;
  color: #999;
}

.conversation-date {
  font-size: 0.8em;
  color: #999;
  white-space: nowrap;
  font-weight: 300;
}

/* Specific styles for drop-up conversations */
.dropup-menu .conversation-item,
.dropup-menu .conversation-preview,
.dropup-menu .conversation-date {
  font-weight: normal !important;
}

.dropup-menu .conversation-preview {
  font-size: 14px;
}

.dropup-menu .conversation-date {
  font-size: 12px;
}

/* Dark mode specific styles */
body.dark-mode .dropdown-menu {
  background-color: #333;
  color: #f9f9f9;
}

body.dark-mode .dropdown-menu a {
  color: #f9f9f9;
}

body.dark-mode .dropdown-menu a:hover {
  background-color: #444;
}

body.dark-mode .dropup-menu {
  background-color: #222;
  color: #f9f9f9;
}

body.dark-mode .conversation-item {
  border-bottom-color: #444;
}

body.dark-mode .conversation-date {
  color: #999;
}

/* Ensure the SVG icons are visible in dark mode */
body.dark-mode #recent-conversations-button,
body.dark-mode #submit-button,
body.dark-mode #copy-button,
body.dark-mode #new-chat-button {
  color: #4CAF50;
}

/* Media queries */
@media (max-width: 600px) {
  .input-container {
    gap: 4px;
  }
  
  #question-input {
    margin: 0 4px;
  }
}
