/* AI Chat Page Styles */

.ai-chat-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

.chat-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  border-radius: 15px;
  color: white;
}

.chat-header h1 {
  margin: 0 0 10px 0;
  font-size: 2rem;
}

.chat-header p {
  margin: 0 0 15px 0;
  opacity: 0.9;
}

.manage-keys-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.manage-keys-btn:hover {
  background: white;
  color: #0984e3;
}

.chat-interface {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.chat-messages {
  height: 500px;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
}

.message {
  margin-bottom: 15px;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-content {
  padding: 12px 16px;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
}

.user-message .message-content {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
  margin-left: auto;
  text-align: right;
}

.ai-message .message-content {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
}

.chat-input-container {
  padding: 20px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.model-selector {
  margin-bottom: 15px;
}

.model-selector select {
  width: 100%;
  padding: 10px;
  border: 2px solid #74b9ff;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.model-selector select:hover {
  border-color: #0984e3;
}

.model-selector select:focus {
  outline: none;
  border-color: #0984e3;
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #74b9ff;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #0984e3;
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.input-group button {
  padding: 12px 30px;
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.input-group button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

.input-group button:active {
  transform: translateY(0);
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #74b9ff;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #0984e3;
}

/* API Key Modal */
.api-key-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 50px 20px;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-content h3 {
  margin: 0 0 20px 0;
  color: #0984e3;
}

.modal-content input {
  width: 100%;
  padding: 12px;
  border: 2px solid #74b9ff;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.modal-content input:focus {
  outline: none;
  border-color: #0984e3;
}

.modal-buttons {
  display: flex;
  gap: 10px;
}

.modal-buttons button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-buttons button:first-child {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
}

.modal-buttons button:last-child {
  background: #e0e0e0;
  color: #333;
}

.modal-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.key-list {
  margin-bottom: 20px;
}

.key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
}

.key-item span {
  font-size: 0.95rem;
}

.key-item button {
  padding: 6px 16px;
  background: #0984e3;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.key-item button:hover {
  background: #74b9ff;
  transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 768px) {
  .ai-chat-container {
    margin: 20px auto;
    padding: 10px;
  }

  .chat-header h1 {
    font-size: 1.5rem;
  }

  .chat-messages {
    height: 400px;
  }

  .message-content {
    max-width: 90%;
  }

  .input-group button {
    padding: 12px 20px;
  }
}
