* {
  box-sizing: border-box;
}

:root {
  --primary-color: #517860; /* Sage Green */
  --secondary-color: #ffdb70; /* Warm Yellow */
  --accent-color: #1d4ed8;
  --text-color: #0f172a;
  --light-text: #475569;
  --border-color: #cbd5e1;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --sidebar-width: 250px;
}

/* Utility Classes for Responsive Visibility */
.mobile-only { display: none !important; }
.desktop-only { display: block !important; }

@media (max-width: 900px) {
  .mobile-only { display: block !important; }
  .desktop-only { display: none !important; }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main Header */
.main-header {
  background-color: var(--primary-color);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-top-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-branding { cursor: pointer; }
.header-branding h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.025em;
  color: white;
  white-space: nowrap;
}

.main-nav { display: flex; gap: 1.5rem; }
.nav-link {
  background: none; border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem; font-weight: 600;
  cursor: pointer; padding: 0.5rem 0;
  position: relative; transition: color 0.2s;
}
.nav-link:hover { color: white; }
.nav-link.active { color: white; }
.nav-link.active::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 2px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

/* Header Controls (Bubble UI) */
.header-controls { display: flex; align-items: center; gap: 0.75rem; }
.dropdown-control-wrapper { position: relative; }
.dropdown-control-btn {
  display: flex; align-items: center; gap: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px; border-radius: 100px;
  color: white; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.dropdown-control-btn:hover, .dropdown-control-btn.active {
  background-color: rgba(255, 255, 255, 0.2); border-color: white;
}
.dropdown-control-btn .chevron { transition: transform 0.2s; opacity: 0.7; }
.dropdown-control-btn .chevron.up { transform: rotate(180deg); }

.bubble-dropdown {
  position: absolute; top: calc(100% + 12px); right: 0;
  background-color: white; padding: 8px; border-radius: 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  z-index: 2000; min-width: 180px;
  /* animation removed */
  transform-origin: top right;
}
@keyframes bubblePop {
  from { opacity: 0; transform: scale(0.8) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.bubble-grid { display: flex; flex-direction: column; gap: 4px; }
.bubble-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border: none; background: none;
  border-radius: 12px; color: var(--text-color);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; text-align: left; transition: all 0.15s;
}
.bubble-option:hover { background-color: #f1f5f9; color: var(--primary-color); }
.bubble-option.selected { background-color: var(--secondary-color); color: var(--primary-color); }

/* Search Bar */
.header-search-container { flex: 1; max-width: 800px; }
.search-bar-group { display: flex; align-items: center; gap: 0.75rem; width: 100%; }

.search-lang-selectors { display: flex; align-items: center; gap: 0.5rem; }
.search-lang-arrow { color: var(--light-text); display: flex; align-items: center; opacity: 0.5; }

.search-lang-pill-wrapper { position: relative; }
.search-lang-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.search-lang-pill:hover, .search-lang-pill.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}
.pill-label { opacity: 0.7; font-weight: 500; margin-right: 2px; }
.pill-value { color: var(--secondary-color); }

.pill-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    min-width: 160px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pill-option {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}
.pill-option:hover { background: #f1f5f9; color: var(--primary-color); }
.pill-option.selected { background: var(--primary-color); color: white; }

.search-lang-arrow { color: white; opacity: 0.5; display: flex; align-items: center; }

.search-bar { position: relative; flex: 1; min-width: 200px; }
.search-bar input {
  width: 100%; padding: 0.7rem 2.5rem 0.7rem 1rem;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 100px;
  font-size: 0.95rem; font-weight: 500; color: white;
  background-color: rgba(255,255,255,0.1); outline: none;
  transition: all 0.2s;
}
.search-bar input::placeholder { color: rgba(255, 255, 255, 0.6); }
.search-bar input:focus { background-color: rgba(255, 255, 255, 0.2); border-color: white; }
.search-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.6); pointer-events: none; }

.search-button {
  height: 42px;
  background-color: white; color: var(--primary-color); border: none;
  padding: 0 1.5rem; border-radius: 100px; font-weight: 800;
  font-size: 0.9rem; cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.search-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.search-suggestions-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background-color: white; border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  z-index: 2000; overflow: hidden; padding: 0.5rem; border: 1px solid var(--border-color);
}
.suggestion-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-radius: 8px; cursor: pointer; color: var(--text-color);
}
.suggestion-item:hover, .suggestion-item.active { background-color: var(--secondary-color); }
.suggestion-content { display: flex; flex-direction: column; gap: 2px; }
.suggestion-primary { font-weight: 700; font-size: 0.95rem; }
.suggestion-secondary { font-size: 0.8rem; color: var(--light-text); font-style: italic; }
.suggestion-dept { font-size: 0.65rem; font-weight: 800; color: var(--primary-color); text-transform: uppercase; }

/* Sub Nav / Breadcrumbs */
.header-sub-nav { background-color: #f1f5f9; border-bottom: 1px solid var(--border-color); }
.header-breadcrumbs-container {
  max-width: 1200px; margin: 0 auto; padding: 0.75rem 1.5rem;
  display: flex; align-items: center;
}
.breadcrumb-links { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--light-text); flex-wrap: wrap; }
.breadcrumb-item { cursor: pointer; transition: color 0.2s; }
.breadcrumb-item:hover { color: var(--primary-color); }
.breadcrumb-item.active { color: var(--primary-color); font-weight: 700; cursor: default; }
.breadcrumb-separator { color: var(--border-color); font-weight: 400; }

/* Layout */
.app-main {
  max-width: 1200px; width: 100%; margin: 0 auto;
  padding: 2rem 1.5rem 0 1.5rem; flex: 1;
}

.content-layout { display: flex; gap: 3rem; }
.left-sidebar { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1rem; }
.main-content { flex: 1; min-width: 0; }
.main-content.full-width { width: 100%; }

/* Custom Dropdown Styles (Mobile Sidebar) */
.custom-dropdown { position: relative; width: 100%; }
.dropdown-trigger {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.25rem; background-color: white;
  border: 1px solid var(--border-color); border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; color: var(--text-color); cursor: pointer;
}
.dropdown-trigger:hover { border-color: var(--primary-color); }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: white; border: 1px solid var(--border-color);
  border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  z-index: 1100; max-height: 350px; overflow-y: auto;
}
.dropdown-item {
  padding: 0.75rem 1.25rem; display: flex; justify-content: space-between;
  align-items: center; cursor: pointer;
}
.dropdown-item:hover { background-color: var(--secondary-color); }
.dropdown-item.selected { font-weight: 700; color: var(--primary-color); }
.dropdown-item.indented { padding-left: 2rem; font-size: 0.85rem; }

/* Sidebar Components */
.category-list-desktop { display: flex; flex-direction: column; gap: 0.25rem; }
.category-list-item {
 /* width: 100%; padding: 0.65rem 1rem; background: none; border: none;
  border-radius: 8px; font-size: 0.875rem; font-weight: 600;
  text-align: left; cursor: pointer; display: flex;*/
  justify-content: space-between; align-items: center; transition: all 0.2s;
  width:100%;  padding: 0.6rem 1rem; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; margin: 0.5rem 0;font-size: 0.85rem; text-align: left; cursor: pointer; display:flex;
}
.category-list-item:hover { background: var(--secondary-color); }
.category-list-item.active { background: var(--primary-color); color: white; }
.category-list-item.indented { padding-left: 2rem; font-size: 0.8rem; }

.recent-searches-container {
  padding: 1.25rem; background: white;
  border: 1px solid var(--border-color); border-radius: 12px;
  margin-bottom: 2.5rem;
}

.share-sidebar-section .a2a_kit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.share-sidebar-section .a2a_kit a {
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-sidebar-section .a2a_svg {
  background-color: var(--primary-color) !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-sidebar-section .a2a_svg svg {
  fill: white !important;
  filter: none !important;
  opacity: 1 !important;
}

.share-sidebar-section a {
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-sidebar-section a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.recent-searches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.recent-label, .filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--light-text);
}

.filter-label {
  margin-bottom: 1rem;
}

.clear-recent-btn {
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--light-text);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s;
}

.clear-recent-btn:hover {
  background-color: #fee2e2;
  color: #ef4444;
  border-color: #fecaca;
}
.recent-terms-list { 
  display: flex; 
  flex-direction: column; 
  gap: 0.5rem; 
}

.recent-term-item {
  padding: 0.4rem 1rem;
  background: #f8fafc;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-term-item:hover {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Breadcrumbs removed from here as they moved to header */

/* Department Landing Page Styles */
.department-landing { /* animation removed */ }
.landing-hero { margin-bottom: 2.5rem; text-align: left; }
.landing-title { font-size: 2.25rem; font-weight: 800; color: var(--text-color); margin: 0 0 0.75rem 0; letter-spacing: -0.025em; }
.landing-subtitle { font-size: 1.125rem; color: var(--light-text); max-width: 700px; line-height: 1.6; }

/* Department Grid */
.department-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.dept-card { background-color: white; border: 1px solid var(--border-color); border-radius: 16px; padding: 1.75rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
.dept-card:hover { transform: translateY(-8px); border-color: var(--primary-color); box-shadow: 0 12px 24px -8px rgba(81, 120, 96, 0.15); }
.dept-card-icon { width: 56px; height: 56px; background-color: var(--secondary-color); color: var(--primary-color); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; transition: all 0.3s; }
.dept-card:hover .dept-card-icon { background-color: var(--primary-color); color: white; transform: scale(1.1); }
.dept-card-title { font-size: 1.25rem; font-weight: 700; color: var(--text-color); margin: 0 0 0.5rem 0; line-height: 1.3; }
.dept-card-footer { margin-top: auto; display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 700; color: var(--primary-color); opacity: 0.8; transition: opacity 0.2s; }
.dept-card:hover .dept-card-footer { opacity: 1; }

/* Glossary List Row View */
.glossary-list {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 20px;
  /* overflow: hidden removed to allow spilling tags */
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 
    0 10px 20px -5px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.glossary-entry { 
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  padding: 0;
  background-color: transparent; 
  border: none; 
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0; 
  margin-bottom: 0; 
  cursor: pointer; 
  transition: background-color 0.2s;
  position: relative; /* Base for spilling tag */
}

.glossary-entry:last-child { border-bottom: none; }
.glossary-entry:hover { background-color: #f8fafc; }

.entry-col-num {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--light-text);
  text-align: center;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.entry-col-term {
  padding: 1rem 1rem;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.headword-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.entry-header.list-row { padding: 0; flex: 1; }
.headword-row { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; flex-wrap: wrap; }
.entry-headword { font-size: 1.1rem; font-weight: 600; color: #354a3f; word-break: break-word; }
.entry-headword-secondary { display: block; font-size: 0.9rem; font-weight: 500; color: var(--light-text); font-style: italic; margin-top: 2px; word-break: break-word; }
.entry-headword-xhosa { font-size: 1rem; font-weight: 700; color: #ebc054; }

.list-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  /* margin-left: 1rem; */
}

.list-pos-tag { font-size: 10px; font-weight: 700; color: var(--primary-color); font-style: italic; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.list-pos-tag svg { width: 16px; height: 16px; flex-shrink: 0; }

.list-cat-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-color);
  background: rgba(81, 120, 96, 0.08);
  padding: 4px 12px;
  width: 180px;
  border-radius: 100px;
  border: 1px solid rgba(81, 120, 96, 0.15);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.list-cat-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.list-cat-tag svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.glossary-list-view .status-message {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* Term Detail */
.term-detail-container {
  /* animation removed */
}

.term-image-container {
  /* margin-top: 1.75rem;
  margin-bottom: 1.75rem; */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  max-width: 480px;
}

.term-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  padding: 1rem;
}

.back-btn {
  display: /*flex*/ none;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--light-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
}

.back-btn:hover {
  color: var(--primary-color);
  /* transform removed */
}

.term-detail-layout { display: flex; gap: 2.5rem; }
.detail-main-content { flex: 1; min-width: 0; }
.detail-header { margin-bottom: 2rem; padding-bottom: 0.5rem; }

.detail-headword-group {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  /*gap: 1rem;*/
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.detail-title-separator {
  font-size: 2rem;
  color: var(--border-color);
  font-weight: 300;
  display:none;
}

.detail-headword { font-size: 2.5rem; font-weight: 800; color: var(--text-color); margin: 0 0 0.5rem 0; }
.detail-headword-xhosa { font-size: 2.125rem; font-weight: 700; color: var(--secondary-color); margin: 0; /*font-style: italic; text-shadow: 1px 1px 0 rgba(0,0,0,0.05);*/}

.detail-meta-row { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; font-size: 16px; font-weight: 600; }
.entry-pos, .entry-related { display: flex; align-items: center; gap: 6px; }
.entry-category-tag { font-size: inherit; font-weight: inherit; color: var(--primary-color); background: rgba(81, 120, 96, 0.1); padding: 4px 10px; border-radius: 100px; display: flex; align-items: center; gap: 4px; border: none; transition: all 0.2s; }
.entry-category-tag.clickable { cursor: pointer; }
.entry-category-tag.clickable:hover { background-color: var(--primary-color); color: white; }
.entry-pos { font-style: italic; color: var(--primary-color); }
.related-label { color: var(--light-text); }
.ref-link-btn-inline {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--primary-color);
  text-decoration: underline;
  cursor: pointer;
}
.ref-link-btn-inline:hover { color: var(--secondary-color); }

.inline-term-ref {
  color: var(--primary-color);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.inline-term-ref:hover {
  text-decoration-style: solid;
}

.entry-definitions.detailed { display: flex; flex-direction: column; gap: 1rem; }

.chosen-definition-wrapper {
  margin-bottom: 0;
}

.primary-definitions-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
  gap: 1.5rem;
  /* margin-bottom: 2rem; */
}

.primary-definitions-pair .definition-headword {
  font-size: 1.3rem;
}

@media (max-width: 900px) {
  .primary-definitions-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .primary-definitions-pair .definition-headword {
    font-size: 1.5rem;
  }
}

.primary-definitions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1rem;
}


.other-definitions-section {
  margin-top: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.other-defs-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--light-text);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  display: block;
}

.definitions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.definitions-grid .definition-block {
  padding: 1.25rem;
}

.definitions-grid .definition-text {
  font-size: 1rem;
}

.definition-block { 
  padding: 1.5rem; 
  background: white; 
  border-radius: 16px; 
  border: 1px solid var(--border-color); 
  border-left: 6px solid var(--lang-color, #e2e8f0); 
}
.definition-block.primary { --lang-color: #639275; background: #f0fdf4; }
.definition-block.english { --lang-color: #56916d; background: #f0fdf4; }
.definition-block.xhosa { --lang-color: #68c2e8; background: #f5fafc; }
.definition-block.zulu { --lang-color: #798dcd; background:#f5f6fa;}
.definition-block.afrikaans { --lang-color: #ffa299; background:#fff8f7;  }
.definition-block.sotho { --lang-color: var(--secondary-color); background: #fffaeb; }
.definition-block.tsonga { --lang-color: #ac7299; background:#fcf7f7; }

.lang-header { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--light-text); margin-bottom: 0.75rem; }
.definition-headword { 
  font-size: 1.3rem; 
  font-weight: 800; 
  color: var(--lang-color, var(--primary-color)); 
  margin: 0 0 0.5rem 0; 
}
.definition-text { font-size: 1.1rem; line-height: 1.6; color: var(--text-color); }
.example-text { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border-color); font-style: italic; color: var(--light-text); }
.detail-footer-nav {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--light-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.nav-btn:active:not(:disabled) { transform: translateY(0); }

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: #f1f5f9;
}

.nav-btn i { transition: transform 0.2s ease; }
.nav-btn.prev:hover i { transform: translateX(-3px); }
.nav-btn.next:hover i { transform: translateX(3px); }
.nav-btn-text strong { display: none; }

/* Pagination */
.pagination-wrapper { 
  margin-top: 2rem; 
  padding-top: 1.5rem; 
  border-top: 1px solid var(--border-color); 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  flex-wrap: wrap;
  gap: 1rem;
}
.results-count-bottom {
  font-size: 0.9rem;
  color: var(--light-text);
  font-weight: 500;
}
.pagination-container { display: flex; align-items: center; gap: 8px; }
.pagination-numbers { display: flex; gap: 4px; }
.pagination-btn { 
  min-width: 36px; 
  height: 36px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background: white; 
  border: 1px solid var(--border-color); 
  border-radius: 8px; 
  cursor: pointer; 
  font-size: 0.9rem;
  font-weight: 600; 
  color: var(--light-text);
  transition: all 0.2s;
}
.pagination-btn:hover:not(:disabled):not(.active) { 
  border-color: var(--primary-color); 
  color: var(--primary-color);
  background-color: #f0fdf4;
}
.pagination-btn.active { 
  background: var(--primary-color); 
  color: white; 
  border-color: var(--primary-color); 
  cursor: default;
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: #f1f5f9;
}
.pagination-btn.arrow {
  padding: 0 8px;
}

.app-footer {
  background-color: var(--primary-color);
  color: rgba(255, 255, 255, 0.8);
  padding: 1.5rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
}

.app-footer p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.footer-link {
  color: var(--secondary-color);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 219, 112, 0.5);
  transition: text-decoration-color 0.2s;
}
.footer-link:hover {
  text-decoration-color: var(--secondary-color);
}

/* About Page */
.about-page {
  max-width: 900px;
  margin: 0 auto;
}

.about-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.about-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.about-tagline {
  font-size: 1.25rem;
  color: var(--light-text);
  max-width: 600px;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}

.about-card {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.about-card h3 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--secondary-color);
  display: inline-block;
  padding-bottom: 4px;
}

.about-card.highlight {
  background-color: #f0fdf4;
  border-color: rgba(81, 120, 96, 0.2);
}

.features-list {
  padding-left: 1.25rem;
  margin: 0;
}

.features-list li {
  margin-bottom: 1rem;
  color: var(--light-text);
}

.dept-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dept-pill {
  background-color: white;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 1rem;
  transition: all 0.2s;
}

.contact-link:hover {
  background-color: #3d5c49;
  transform: translateY(-2px);
}

@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-sidebar-info { order: 2; }
  .about-main { order: 1; }
  .about-title { font-size: 2.5rem; }
}

/* Status & Misc */
.status-message { padding: 3rem; text-align: center; font-size: 1.2rem; color: var(--light-text); }
.hidden { display: none !important; }

@media (max-width: 1024px) {
  .term-detail-layout { flex-direction: column; }
}

@media (max-width: 900px) {
  .header-top-bar { flex-direction: column; gap: 1rem; padding: 1rem; align-items: stretch; }
  .header-breadcrumbs-container { padding: 0.75rem 1rem; }
  .app-main { padding: 2rem 1rem 0 1rem; }
  .header-branding h1 { 
    text-align: center; 
    white-space: normal;
    font-size: 1.25rem;
    line-height: 1.2;
  }
  .main-nav {
    justify-content: center;
    max-height: 48px;
    overflow: hidden;
    opacity: 1;
    margin-top: 0;
    margin-bottom: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  }
  .main-nav.nav-scroll-hidden {
    max-height: 0;
    opacity: 0;
    margin-top: -0.5rem;
    margin-bottom: -0.5rem;
  }
  .header-search-container { max-width: 100%; width: 100%; }
  .search-bar-group { 
    display: flex;
    flex-wrap: wrap; 
    gap: 0.75rem; 
    align-items: center;
  }
  .search-bar { 
    width: 100%; 
    order: -1; 
    flex: none !important;
  }
  .search-lang-selectors { 
    flex: 1;
    display: flex;
    justify-content: center;
  }
  .search-lang-pill-wrapper, .search-lang-pill { 
    width: 100%;
    justify-content: center; 
  }
  .header-controls { justify-content: center; }
  .content-layout { flex-direction: column; gap: 2rem; }
  .left-sidebar { width: 100%; position: static; order: 2; }
  .main-content { order: 1; }
}

/* Results List — iPad (portrait) */
@media (max-width: 768px) {
  .entry-col-term {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .list-meta-row {
    margin-left: 0;
    gap: 10px;
    align-self: flex-start;
  }

  .list-cat-tag {
    width: auto;
    max-width: 100%;
  }
}

/* Results List Mobile Responsiveness */
@media (max-width: 600px) {
  .header-top-bar { padding: 1rem 0.75rem; }
  .header-breadcrumbs-container { padding: 0.75rem 0.75rem; }
  .app-main { padding: 1.5rem 0.75rem 0 0.75rem; }

  .glossary-entry {
    grid-template-columns: 45px 1fr;
  }

  .entry-col-num {
    padding: 1rem 0.25rem;
    font-size: 0.8rem;
    opacity: 0.7;
  }

  .entry-col-term {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.85rem 0.75rem;
    gap: 0.5rem;
  }

  .headword-row {
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
  }

  .entry-headword {
    font-size: 1rem;
    line-height: 1.2;
  }

  .entry-headword-secondary {
    font-size: 0.9rem;
  }

  .list-pos-tag {
    font-size: 0.7rem;
    margin-left: 0;
    background: rgba(235, 192, 84, 0.1);
    color: #517860;
    padding: 2px 6px 2px 0;
    border-radius: 4px;
    font-style: normal;
    font-weight: 600;
  }

  .list-cat-tag {
    margin-left: 0;
    width: auto;
    max-width: 100%;
    padding: 4px 10px;
    font-size: 0.65rem;
    background: rgba(81, 120, 96, 0.05);
  }
}
