* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f4f6fa;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.message {
  white-space: normal;
}

header {
  position: relative;
  background-color: #4c5451;
  color: white;
  padding: 20px 35px;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.3s ease;
}

header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 7px; /* bottom bar height */
  background-color: #afb1af;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo {
  width: auto;
  height: 40px;
  object-fit: contain;
  transition: transform 0.3s ease;
  border-radius: 0; /* square */
  position: relative;
  top: -4px;
  left: 0;
  max-width: 260px; 
}

.knowledge-link {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  margin-left: 1rem;
  padding: 0.2rem 0.8rem; /* extra padding for the sidebars */
  border-radius: 4px;
  position: relative;
  top: -7px;
  left: 15px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.knowledge-link:hover {
  background-color: #ffffff;
  color: #4f4f4f;
  cursor: pointer;
  border-left-color: #4f4f4f;
  border-right-color: #4f4f4f;
}

.main-content {
  display: flex;
  flex: 1;
  height: calc(100vh - 70px);
}

.new-chat-btn {
  background-color: #343541;
  color: white;
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  margin-bottom: 1rem;
  transition: background-color 0.3s ease;
}

.new-chat-btn:hover {
  background-color: #4e4f55;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.chat-item {
  background-color: #343541;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.chat-item:hover {
  background-color: #4e4f55;
}

.chat-item.active {
  background-color: #5a5b63;
}

.chat-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chat-box {
  background: white;
  width: 90%;
  max-width: 1000px;
  height: 80vh;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.chat-box:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message {
  max-width: 70%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  line-height: 1.4;
  word-wrap: break-word;
  transition: transform 0.2s ease, background-color 0.3s ease;
  animation: fadeIn 0.3s ease;
}

.message:hover {
  transform: scale(1.02);
  background-color: #f1f1f1;
}

.bot {
  background: #e3f2fd;
  align-self: flex-start;
}

.user {
  background: #0d47a1;
  color: white;
  align-self: flex-end;
}

.thought-time {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12px;
  color: #7a7a7a;
}

.input-area {
  display: flex;
  border-top: 1px solid #ddd;
}

input, textarea {
  flex: 1;
  padding: 1rem;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  resize: none;
  overflow-y: hidden;
  transition: background-color 0.3s ease;
}

input:focus, textarea:focus {
  background-color: #f0f8ff;
}

button {
  background: #afb1af;
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: #4f4f4f;
  transform: scale(1.05);
}

.chatbot-link {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  margin-left: 1rem;
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
  position: relative;
  top: -7px;
  left: 15px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.chatbot-link:hover {
  background-color: #ffffff;
  color: #4f4f4f;
  cursor: pointer;
  border-left-color: #4f4f4f;
  border-right-color: #4f4f4f;
}

.file-link {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  margin-left: 1rem;
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
  position: relative;
  top: -7px;
  left: 15px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.file-link:hover {
  background-color: #ffffff;
  color: #4f4f4f;
  cursor: pointer;
  border-left-color: #4f4f4f;
  border-right-color: #4f4f4f;
}


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

main {
  padding: 40px;
  display: flex;
  justify-content: center;
}

.upload-section {
  width: 1300px;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Title */
.upload-section h2 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

/* Drag & Drop Area */
.upload-area {
  border: 2px dashed #4c5451;
  border-radius: 14px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  margin-bottom: 20px;
}

.upload-area {
  position: relative; /* needed for absolute positioning inside */
  border: 2px dashed #4c5451;
  border-radius: 14px;
  padding: 30px 20px 50px 20px; /* add extra bottom padding to fit the text */
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  margin-bottom: 20px;
}

.supported-types {
  font-size: 0.85rem;
  color: #777;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

/* Hide default file input */
.upload-area input[type="file"] {
  display: none;
}

/* Drag hover state */
.upload-area.dragover {
  background: #fff0f5;
  border-color: #4c5451;
}

/* File list container */
.file-list {
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 20px;
}

/* Individual file item */
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8f8f8;
  margin-bottom: 8px;
  font-size: 14px;
}

.file-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

/* Remove button */
.file-item button {
  background: none;
  border: none;
  color: #4c5451;
  font-weight: 600;
  cursor: pointer;
}

.file-item button:hover {
  text-decoration: underline;
}

/* Buttons row */
.buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Sync button */
.sync-btn {
  flex: 1;
  background: #eaeaea;
  color: #333;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sync-btn:hover {
  background: #dcdcdc;
}

/* Upload button */
.upload-btn {
  flex: 1;
  background-color: #4c5451; /* same as header */
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.upload-btn:hover {
  background-color: #4f4f4f; /* same hover as header */
  transform: scale(1.05);
}

.upload-icon {
  width: 64px;
  height: auto;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.upload-area:hover .upload-icon {
  opacity: 1;
  transform: translateY(-2px);
}

.supported-types {
  font-size: 0.85rem;
  color: #777;
  margin-top: 1px;
}


/* LOGIN PAGES */

.login-page {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.login-card {
  min-height: 40px;
  margin-bottom: 4px;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  margin-top: -20px;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: box-shadow 0.3s ease;
}

.login-card:hover {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

.login-card h2 {
  margin-bottom: 24px;
  font-size: 22px;
  font-weight: 600;
  color: #333;
}

/* Form */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.form-group label {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #555;
}

.form-group input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #4c5451;
  background-color: #f0f8ff;
}

/* Login Button */

.login-btn {
  margin-top: 10px;
  background-color: #4c5451;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.login-btn:hover {
  background-color: #4f4f4f;
  transform: scale(1.05);
}

.login-links {
  margin-top: 20px;
  font-size: 0.85rem;
  color: #777;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.login-links a {
  color: #4c5451;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.login-links a:hover {
  color: #000;
  text-decoration: underline;
}

.user-info {
  position: absolute;
  right: 128px;
  top: 50%;                 /* center relative to header */
  transform: translateY(-80%);
  color: #ffffff;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}
.header-link {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
  position: absolute; 
  top: 50%;           
  right: 25px;        
  transform: translateY(-78%); 
  transition: background-color 0.3s ease, color 0.3s ease;
}

.header-link:hover {
  background-color: #ffffff;
  color: #4f4f4f;
  cursor: pointer;
  border-left-color: #4f4f4f;
  border-right-color: #4f4f4f;
}

.resend-text {
  margin-top: 12px;
  font-size: 0.9rem;
  text-align: center;
}

.resend-text a {
  color: #0066cc;
  text-decoration: underline;
  cursor: pointer;
}

.helper-text {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.button-center {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.button-center .upload-btn {
  flex: unset;        /* override flex: 1 */
  width: auto;
  min-width: 220px;   /* optional, nice balance */
}

.upload-section .helper-text {
  text-align: center;
}

.download-btn {
  display: inline-block;
  background-color: #4c5451;  /* green, can change to match theme */
  color: white;
  text-decoration: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  margin: -5px auto 15px auto;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.download-btn:hover {
  background-color: #4c5451;
  transform: scale(1.05);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;          /* spacing between buttons */
  margin-left: 30px;  /* spacing from logo */
}

.nav-btn {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-btn:hover {
  background-color: #ffffff;
  color: #4f4f4f;
}

.logout-btn {
  margin-left: auto;   /* push Sign Out to the far right */
}


/* NAV LINKS – default state (white navbar) 
.chatbot-link,
.file-link,
.knowledge-link,
.header-link {
  color: #222;            
}
*/

/* =========================
   File Metadata Table
   ========================= */

.metadata-section {
  margin-top: 30px;
}

.metadata-section h3 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: #333;
}

.metadata-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px; /* space between rows */
}

.metadata-table thead th {
  text-align: left;
  font-size: 0.85rem;
  color: #555;
  padding: 0 10px 6px 10px;
}

.metadata-table tbody tr {
  background: #f8f8f8;
  border-radius: 10px;
}

.metadata-table tbody td {
  padding: 10px;
}

.metadata-table tbody tr td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.metadata-table tbody tr td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Inputs inside table */


.metadata-table input:focus,
.metadata-table select.author-input:focus {
  outline: none;
  border-color: #4c5451;
  background-color: #f0f8ff;
}

.metadata-table th:first-child,
.metadata-table td:first-child {
  width: 40%;
}

/* Make all cells align their contents to the middle vertically */
.metadata-table tbody td {
  vertical-align: middle;
}
.metadata-table input,
.metadata-table select.author-input {
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 0.9rem;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  line-height: 40px;
  box-sizing: border-box;
  background-color: #fff;
  vertical-align: middle;
}

.metadata-table input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  line-height: normal;
}

/*Custom arrow link (downwards) */
.metadata-table select.author-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><polygon points='0,0 10,0 5,6' fill='%234c5451'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
}

.required {
  color: red;
  margin-left: 2px;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

.status-waiting {
  background: #eaeaea;
  color: #555;
}

.status-uploading {
  background: #fff3cd;
  color: #856404;
}

.status-success {
  background: #d4edda;
  color: #155724;
}

.status-failed {
  background: #f8d7da;
  color: #721c24;
}

.author-dropdown-wrapper {
  position: relative;
}

.author-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 150px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

.suggestion-item {
  padding: 8px;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: #f0f0f0;
}

.login-message {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.login-message.error {
  background: #fdeaea;
  color: #a61b1b;
  border: 1px solid #f5c2c2;
}
 
.login-message.success {
  background: #eaf7ea;
  color: #1f7a1f;
  border: 1px solid #bfe3bf;
}

.required-star {
  color: red;
  font-weight: bold;
}

.required-note {
  margin-top: 6px;
  font-size: 0.9rem;
}

.ai-disclaimer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  padding: 8px 16px;
  text-align: center;
  color: #4c5451;
  font-family: 'Segoe UI';
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

