@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap");

:root {
  --primary-color: #275d38;
}

body,
html {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Montserrat", sans-serif;
  padding: 0;
  background-color: #fff;
}

.btn-primary {
  width: 100%;
  background-color: var(--primary-color);
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: #1e4a2c;
}

button {
  cursor: pointer;
}

#app {
  flex-grow: 1;
  width: 100%;
  margin: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Nav ── */

#nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  margin-bottom: 20px;
  border-bottom: solid var(--primary-color) 4px;
}

#nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-button {
  border: 2px solid var(--primary-color);
  padding: 3px 10px;
  font-weight: bold;
  border-radius: 30px;
  color: black;
  text-decoration: none;
  font-size: 0.8em;
  white-space: nowrap;
}

.nav-button:hover {
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
}

#nav-title {
  font-size: 1.6em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

#nav-logo {
  max-height: 44px;
}

#nav-site-name {
  flex: 1 0 auto;
}

.sw-title {
  color: var(--primary-color);
  font-weight: 700;
}

/* ── Footer ── */

#footer {
  margin-top: auto;
  border-top: solid var(--primary-color) 4px;
  width: 90%;
  padding: 10px 0;
}

#footer-text p {
  margin: 0;
  font-size: 0.85em;
}

/* ── Links ── */

a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
}

a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* ── Page content ── */

.content-container {
  width: 90%;
  max-width: 900px;
}

.header-container {
  width: 100%;
  margin-bottom: 20px;
}

/* ── Controls bar ── */

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

/* Segmented mode picker */
.view-switcher {
  display: inline-flex;
  background: #efefef;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 7px 18px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #555;
  font-family: "Montserrat", sans-serif;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.view-btn:hover {
  background: #e0e0e0;
  color: #111;
}

.view-btn.active {
  background: #fff;
  color: var(--primary-color);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* View help text */
.view-help {
  font-size: 0.8em;
  color: #888;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

/* Relevance slider */
.slider-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.slider-label {
  font-size: 0.75em;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.relevance-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 4px;
  border-radius: 2px;
  background: #d0d0d0;
  outline: none;
  cursor: pointer;
}

.relevance-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: box-shadow 0.15s ease;
}

.relevance-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px rgba(39, 93, 56, 0.15);
}

.relevance-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.score-value {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--primary-color);
  min-width: 24px;
  text-align: right;
}

/* ── Viz + panel side-by-side ── */

.viz-and-panel {
  display: flex;
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

/* ── Result panel ── */

.result-panel {
  flex: 1 1 0;
  min-width: 0;
  height: 600px;
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.panel-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  font-size: 0.85em;
  font-weight: 700;
  color: #333;
}

.panel-header.empty {
  color: #aaa;
  font-weight: 400;
}

/* Tab bar */
.panel-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 2px solid #e8e8e8;
  background: #fafafa;
}

.panel-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72em;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-align: center;
}

.panel-tab:hover {
  color: #555;
}

.panel-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: #fff;
}

.panel-items {
  overflow-y: auto;
  flex: 1 1 0;
  padding: 8px 0;
}

/* Paper card */
.paper-card {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: default;
  transition: background 0.1s ease;
}

.paper-card:last-child {
  border-bottom: none;
}

.paper-card:hover {
  background: #fafafa;
}

.paper-card-name {
  font-size: 0.75em;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.paper-card-cluster {
  font-size: 0.7em;
  font-weight: 400;
  color: #888;
}

.paper-card-similarity {
  font-size: 0.85em;
  font-weight: 700;
  color: #555;
}

.paper-card-text {
  font-size: 0.78em;
  color: #444;
  line-height: 1.45;
}

.paper-card-excerpt {
  display: inline;
}

.paper-card-full {
  display: none;
}

.paper-card-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  font-size: 0.75em;
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  font-family: inherit;
}

/* Detail block (clicked item shown at top of panel) */
.panel-detail {
  padding: 12px 16px;
  background: #f8f8f8;
  border-bottom: 2px solid #e8e8e8;
}

.panel-detail-name {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.panel-detail-text {
  font-size: 0.78em;
  color: #333;
  line-height: 1.5;
}

/* Section divider label */
.panel-section-label {
  padding: 6px 16px;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  border-top: 1px solid #eee;
  margin-top: 4px;
}

.panel-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #bbb;
  font-size: 0.82em;
  text-align: center;
  padding: 2rem;
}

/* ── Professor dropdown ── */

#prof-dropdown {
  margin-bottom: 8px;
}

#prof-dropdown-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23275d38' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1.5px solid #c8c8c8;
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.82em;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

#prof-dropdown-select:hover {
  border-color: var(--primary-color);
}

#prof-dropdown-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(39, 93, 56, 0.12);
}

/* ── Tables rendered by great_tables ── */

.gt_table {
  font-size: 0.85em;
}
