/* --- Global Styles --- */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background-color: white;
  color: #333;
}

/* --- Main Container --- */
.container {
  min-height: 100vh;
  width: 80%;
  margin: 24px auto;
  padding: 24px;
  background-color: white;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* --- Header --- */
.app-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  background-color: white;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  
  /* Make header extend full width */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.logo-area {
  text-align: center;
  margin: 12px 0; /* Reduce spacing */
  cursor: pointer;
}

.app-logo {
  height: 88px;
  max-width: 100%;
  display: inline-block;
}

/* --- Controls --- */
#controls,
#uploadSection {
  text-align: center;
  margin-bottom: 20px;
}

#queryInput {
  width: 60%;
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid #ccc;
  background-color: #fdfdfd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

#queryInput:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.2);
}

.controls-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.controls-area input[type="text"] {
  padding: 6px 8px;
  font-size: 14px;
}

.controls-area button {
  padding: 6px 12px;
  margin-left: 6px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
}

.controls-area button:hover {
  background-color: #0056b3;
}

#controls {
  margin-top: 16px;
  margin-bottom: 16px; /* Create space below input */
}

#entityPills {
  margin-bottom: 20px;
}


/* --- Search Results Layout --- */
.results-layout {
  flex-grow: 1;
  display: flex;
  gap: 20px;
}

.results {
  flex: 2;
}

.right-column {
  flex: 2;
  background-color: #f3f2ef;
  padding: 12px;
  border-radius: 8px;
  display: none;
  align-self: flex-start;
}

.right-column.visible {
  display: block;
}

.pdf-box {
  background-color: #f3f2ef;
  padding: 20px;
  border-radius: 8px;
  display: none;
}

.pdf-box.visible {
  display: block;
}

/* --- Search Results Styling --- */
.result {
  background-color: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease;
}

.result:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.result a {
  font-size: 14px;
  font-weight: normal;
  color: #1a0dab;
  text-decoration: none;
  margin-right: 10px;
  line-height: 1.4;
}

.result a:hover {
  text-decoration: underline;
}

.result-snippet {
  font-size: 14px;
  color: #4d5156;
  line-height: 1.4;
  margin-bottom: 4px;
}

.result a[style*="color:red"] {
  color: #d93025 !important;
  font-weight: normal;
  font-size: 14px;
}

.result-full {
  font-size: 14px;
  font-family: Arial, sans-serif;
  color: #4d5156;
  line-height: 1.5;
  margin-top: 4px;
}

/* --- Highlighting & Entities --- */
.highlight {
  background-color: yellow;
  font-weight: bold;
}

.entity-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 13px;
  margin-right: 8px;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.2s;
}

.entity-pill:hover {
  opacity: 0.85;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
}

/* --- Drag & Drop Upload --- */
#drop-zone {
  border: 2px dashed #d0d7de;
  padding: 30px;
  margin: 16px auto;
  border-radius: 6px;
  text-align: center;
  background-color: #f9fafb;
  color: #444;
  font-size: 16px;
  transition: background-color 0.3s;
}

#drop-zone.dragover {
  background-color: #e6f2ff;
  border-color: #0a66c2;
}

.container.drag-active {
  background-color: #eef6ff;
  transition: background-color 0.3s ease;
}

.drop-icon {
  font-size: 32px;
}

.drop-text {
  display: block;
  margin-top: 8px;
  font-weight: 500;
}

/* --- Pagination --- */
.pagination {
  text-align: center;
  margin-top: 20px;
}

.pagination button {
  background-color: #edf3f8;
  color: #0a66c2;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  margin: 0 4px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.pagination button:disabled {
  background-color: #e0e0e0;
  color: #888;
  cursor: default;
}

/* --- Footer --- */
.app-footer {
  margin-top: auto;
  background-color: #f8f9fa;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: #666;
  border-top: 1px solid #ddd;
  
  /* Make footer extend full width */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* --- Dark Mode (Optional) --- */
.dark #drop-zone {
  color: #ccc;
  border-color: #555;
}
