/* Base styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f4f9;
  margin: 0;
  padding: 20px 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

h1 { 
  color: #333;
  margin: 0 0 25px 0;
  font-size: 2.2em;
  font-weight: 600;
}

/* Expert list styles */
#expert-list-container {
  width: 90%;
  max-width: 700px;
  margin: 20px auto;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.expert-list-title {
  margin: 0 0 25px 0;
  color: #333;
  font-size: 1.8em;
  font-weight: 600;
}

.expert-list-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  width: 100%;
}

.expert-list-actions button {
  background-color: #007bff;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.expert-list-actions button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.expert-list-members {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.expert-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background-color: #f8f9fa;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.expert-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.expert-info {
  flex-grow: 1;
}

.expert-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  font-size: 1.1em;
}

.expert-details {
  color: #666;
  font-size: 0.9em;
  line-height: 1.5;
}

.expert-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #666;
}

.icon-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #333;
}

/* Chat container */
#chat {
  width: 90%;
  max-width: 700px;
  height: calc(100vh - 320px);
  overflow-y: auto;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 20px auto;
  box-sizing: border-box;
  line-height: 1.6;
}

#chat p {
  margin: 0 0 15px 0;
  color: #444;
}

#chat p:last-child {
  margin-bottom: 0;
}

/* Input field */
#input {
  width: 90%;
  max-width: 700px;
  height: 50px;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 15px 20px;
  font-size: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15);
}

/* Button styles */
.button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 15px auto;
  padding: 0 25px;
  max-width: 700px;
  width: 90%;
}

button {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background-color: #007bff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

a {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

a:hover {
  color: #0056b3;
}

button#apiKeyButton, 
button#anthropicApiKeyButton,
button#switchProviderButton {
  background-color: #6c757d;
  font-weight: 500;
}

button#apiKeyButton.active-provider,
button#anthropicApiKeyButton.active-provider {
  background-color: #007bff;
}

button#switchProviderButton.needs-key {
  background-color: #6c757d;
}

/* Expert selection dialog */
.dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(3px);
}

.expert-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 30px;
  border: 1px solid #ddd;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 300px;
  max-width: 90%;
  z-index: 1000;
}

.expert-dialog h3 {
  margin-top: 0;
  margin-bottom: 25px;
  color: #333;
  font-size: 1.4em;
  font-weight: 600;
}

.expert-list {
  margin-bottom: 25px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 15px;
}

.expert-checkbox {
  display: block;
  margin: 12px 0;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.expert-checkbox:hover {
  background-color: #f8f9fa;
}

.expert-checkbox input[type="checkbox"] {
  margin-right: 12px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.primary-button, .secondary-button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.primary-button {
  background-color: #007bff;
  color: white;
}

.primary-button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.secondary-button {
  background-color: #6c757d;
  color: white;
}

.secondary-button:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 123, 255, 0.3);
  border-radius: 50%;
  border-top-color: #007bff;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loading, #waiting {
  display: none;
  color: #6c757d;
  text-align: center;
  padding: 15px;
  font-style: italic;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  margin: 15px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#loading .spinner-text, 
#waiting .spinner-text {
  margin-left: 10px;
  vertical-align: middle;
  font-weight: 500;
}
