/* Base layout */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: #f5f5f7; /* Apple-like soft gray */
  color: #1d1d1f;
}

/* Headings */
h1 {
  text-align: center;
  color: #111;
  font-weight: 600;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: #333;
}

/* Section cards */
section {
  background: #fff;
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease-in-out;
}

section:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Labels & inputs */
label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

input[type="file"],
input[type="text"],
select,
button {
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #d2d2d7;
  background-color: #fefefe;
  transition: border 0.2s;
}

input[type="file"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: #0071e3;
  outline: none;
}

/* Buttons (default = blue) */
button {
  background-color: #0071e3;
  color: #fff;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #005bb5;
}

/* Admin buttons = purple */
button.admin {
  background-color: #6f42c1; /* purple */
}

button.admin:hover {
  background-color: #59359a; /* darker purple */
}

/* Status + Response */
#response, #upload-status {
  white-space: pre-wrap;
  background: #f5f5f7;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

#upload-status.success { color: green; }
#upload-status.error { color: red; }

/* File list */
#file-list-container {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 10px;
  max-height: 150px;
  overflow-y: auto;
}

#file-list-container select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #d2d2d7;
  background: #fff;
}

/* History */
#ask-history-container {
  background: #fafafa;
  padding: 1rem;
  border-radius: 10px;
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

#ask-history-container div {
  margin-bottom: 0.5rem;     /* reduced */
  border-bottom: 1px solid #e0e0e0;
  padding: 0.3rem 0;         /* reduced */
  white-space: pre-line;     /* trims blank lines */
}

/* Sources highlight */
.sources {
  background: #fffbe6;
  border-left: 4px solid #ffd60a;
  padding: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
