/* Main Layout Styles */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  max-width: 900px;
  margin: 50px auto;
  padding: 20px;
  background: #f5f5f5;
}

.container {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.subtitle {
  color: #7f8c8d;
  margin-bottom: 20px;
}

/* Database Switcher Styles */
.database-switcher {
  background: #e8f4f8;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 2px solid #3498db;
  display: flex;
  align-items: center;
  gap: 15px;
}

.database-switcher label {
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
}

.database-switcher select {
  padding: 8px 15px;
  font-size: 14px;
  border: 2px solid #3498db;
  border-radius: 5px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s;
  min-width: 150px;
}

.database-switcher select:hover {
  border-color: #2980b9;
}

.database-switcher select:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.database-switcher select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.db-status {
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s;
}

.db-status.active {
  background: #d5f4e6;
  color: #27ae60;
}

.db-status.warning {
  background: #fff4e6;
  color: #e67e22;
}

.db-status.error {
  background: #fadbd8;
  color: #e74c3c;
}

.db-status.loading {
  background: #e8f4f8;
  color: #3498db;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.form-group {
  margin: 20px 0;
}

/* Input Styles */
input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
}

input[type="text"]:focus {
  border-color: #3498db;
  outline: none;
}

input[type="file"] {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: white;
  width: 70%;
}

/* Button Styles */
button {
  padding: 12px 30px;
  font-size: 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #2980b9;
}

#uploadBtn {
  background: #27ae60;
  margin-left: 10px;
}

#uploadBtn:hover {
  background: #229954;
}

#uploadBtn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

/* Section Styles */
.upload-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 2px dashed #3498db;
}

.upload-section h2 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 18px;
}

.section-divider {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  margin: 30px 0;
  border-radius: 2px;
}

.query-section h2 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 18px;
}

/* Result Display Styles */
#result {
  margin-top: 30px;
  padding: 20px;
  background: #ecf0f1;
  border-radius: 5px;
  display: none;
}

.answer-section {
  background: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  white-space: pre-wrap;
}

.answer-label {
  color: #27ae60;
  font-weight: bold;
  margin-bottom: 10px;
}

.sources {
  margin-top: 15px;
}

.sources-title {
  font-weight: bold;
  color: #34495e;
  margin-bottom: 10px;
}

.source-item {
  padding: 8px;
  background: #fff;
  margin: 5px 0;
  border-left: 3px solid #3498db;
  border-radius: 3px;
  font-size: 14px;
}

/* Status Message Styles */
.loading {
  color: #7f8c8d;
  font-style: italic;
}

.error {
  color: #e74c3c;
}

.upload-status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 5px;
}

.upload-success {
  background: #d5f4e6;
  color: #27ae60;
  border: 1px solid #27ae60;
  position: relative;
}

.upload-error {
  background: #fadbd8;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

/* Close Button Styles */
.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  font-weight: bold;
  color: #27ae60;
  cursor: pointer;
  padding: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: rgba(39, 174, 96, 0.2);
}

/* File List Styles */
.file-list {
  margin-top: 10px;
  font-size: 14px;
}

.file-item {
  padding: 5px 10px;
  background: white;
  margin: 3px 0;
  border-radius: 3px;
  border-left: 3px solid #3498db;
}
