/* ============================================================
   glossary.css — Glossary page styles
   ============================================================ */

/* --- Search Bar --- */
.glossary-search-section {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 40px 0 32px;
}

.glossary-search-wrap {
  position: relative;
  max-width: 600px;
  margin-bottom: 16px;
}

.glossary-search-wrap i.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  font-size: 1rem;
}

.glossary-search-wrap input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.glossary-search-wrap input:focus {
  border-color: var(--color-highlight);
  box-shadow: 0 0 0 3px rgba(22,158,217,0.15);
}

.glossary-filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  transition: all var(--transition);
}

.filter-chip:hover {
  border-color: var(--color-highlight);
  color: var(--color-highlight);
}

.filter-chip.active {
  background: rgba(22,158,217,0.15);
  border-color: var(--color-highlight);
  color: var(--color-highlight);
}

.glossary-results-count {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-left: auto;
}

/* --- Alpha Index --- */
.alpha-index-section {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
}

.alpha-index {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.alpha-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.alpha-btn:hover:not(.dimmed) {
  border-color: var(--color-highlight);
  color: var(--color-highlight);
}

.alpha-btn.dimmed {
  opacity: 0.2;
  cursor: default;
}

/* --- Glossary Entries --- */
.glossary-section {
  padding: 40px 0;
}

.glossary-content {
  max-width: 800px;
}

.letter-group {
  margin-bottom: 40px;
}

.letter-header {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-highlight);
  border-bottom: 2px solid rgba(22,158,217,0.2);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.glossary-entry {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.glossary-entry:last-child {
  border-bottom: none;
}

.entry-term {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-highlight);
  margin-bottom: 4px;
}

.entry-full-name {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.entry-definition {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.entry-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.related-term-link {
  padding: 2px 10px;
  background: rgba(30,64,175,0.1);
  border: 1px solid rgba(22,158,217,0.2);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--color-highlight);
  text-decoration: none;
  transition: all var(--transition);
}

.related-term-link:hover {
  background: rgba(22,158,217,0.15);
  color: var(--color-text-primary);
}

/* --- FAB Add Button --- */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(30,64,175,0.5);
  z-index: 500;
  transition: all var(--transition);
}

.fab:hover {
  background: var(--color-highlight);
  transform: scale(1.08);
}

/* --- Add Term Modal --- */
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .alpha-index {
    gap: 2px;
  }

  .alpha-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .glossary-filter-row {
    gap: 8px;
  }

  .filter-chip {
    padding: 5px 12px;
  }
}
