/* CSTA Glossary Plugin Styles */

.csta-glossary-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  background-color: #ffffff;
}

.csta-glossary-header {
  margin-bottom: 30px;
}

.csta-glossary-title {
  font-size: 32px;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

.csta-glossary-description {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
}

.csta-glossary-description a {
  color: #0066cc;
  text-decoration: none;
}

.csta-glossary-description a:hover {
  text-decoration: underline;
}

.csta-glossary-wrapper {
  display: flex;
  gap: 30px;
  margin-top: 30px;
}

/* Sidebar Styles */
.csta-glossary-sidebar {
  width: 300px;
  flex-shrink: 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  background-color: #f5f5f5;
  padding: 20px;
  border-radius: 4px;
  scrollbar-width: thin;
  scrollbar-color: #c4c4c4 #f0f0f0;
}

.csta-glossary-sidebar::-webkit-scrollbar {
  width: 8px;
}

.csta-glossary-sidebar::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.csta-glossary-sidebar::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 4px;
}

.csta-glossary-sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Sticky block: Filters + Search stay at top; scroll starts from alphabet/filter categories */
.csta-sidebar-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f5f5f5;
  padding-bottom: 5px;
  margin-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 0 0 #f5f5f5;
}

.csta-sidebar-sticky .csta-search-section {
  margin-bottom: 15px;
}

.csta-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ddd;
  padding-top: 0;
  margin-top: 0;
}

.csta-filters-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.csta-icon-filter {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}

.csta-btn-reset {
  background-color: #0066cc;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.csta-btn-reset:hover {
  background-color: #0052a3;
}

.csta-search-section {
  margin-bottom: 25px;
}

.csta-search-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.csta-help-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #999;
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.csta-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.csta-search-input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.csta-search-input:focus {
  outline: none;
  border-color: #0066cc;
}

.csta-search-submit {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csta-icon-search {
  font-size: 18px;
  color: #666;
}

/* Alphabet Navigation */
.csta-alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.csta-letter-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csta-letter-btn:hover:not(.disabled) {
  background-color: #e6f2ff;
  border-color: #0066cc;
}

.csta-letter-btn.active {
  background-color: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

.csta-letter-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Filter Categories */
.csta-filter-categories {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.csta-filter-category {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  margin-top: -1px;
}

.csta-filter-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  cursor: pointer;
}

.csta-filter-category-header h3 {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 0;
}

.csta-toggle-icon {
  font-size: 18px;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csta-filter-category-content {
  padding-bottom: 15px;
  display: none;
}

.csta-filter-category-content.active {
  display: block;
}

.csta-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.csta-filter-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.csta-filter-empty {
  font-size: 13px;
  color: #888;
  margin: 0;
  padding: 8px 0;
}

/* Main Content Area */
.csta-glossary-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.csta-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.csta-results-count {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.csta-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.csta-btn-action {
  background-color: #0066cc;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
}

.csta-btn-action:hover {
  background-color: #0052a3;
}

.csta-icon-expand {
  font-size: 14px;
}

.csta-icon-download {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

.csta-icon-pin {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

.csta-dropdown {
  position: relative;
}

.csta-btn-dropdown {
  padding-right: 12px;
}

.csta-dropdown-caret {
  font-size: 10px;
  margin-left: 4px;
}

.csta-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 4px;
  min-width: 150px;
  z-index: 100;
}

.csta-dropdown-item {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s;
}

.csta-dropdown-item:hover {
  background-color: #f5f5f5;
}

/* Glossary Results - Table-like design */
.csta-glossary-results {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  background-color: #fff;
  scrollbar-width: thin;
  scrollbar-color: #c4c4c4 #f0f0f0;
}

/* Custom scrollbar - light grey, thin (CSTA Standards style) */
.csta-glossary-results::-webkit-scrollbar {
  width: 8px;
}

.csta-glossary-results::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.csta-glossary-results::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 4px;
}

.csta-glossary-results::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.csta-glossary-item {
  border-bottom: 1px solid #dee2e6;
  padding: 12px 16px;
  transition: background-color 0.2s;
  background-color: #fff;
}

.csta-glossary-item:nth-child(even) {
  background-color: #f8f9fa;
}

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

.csta-glossary-item:hover {
  background-color: #e9ecef !important;
}

.csta-glossary-item.hidden {
  display: none !important;
}

.csta-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.csta-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #212529;
  margin: 0;
  flex: 1;
}

.csta-pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  opacity: 0.5;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csta-pin-btn:hover {
  opacity: 1;
}

.csta-pin-btn.pinned {
  opacity: 1;
}

.csta-pin-btn.pinned .csta-icon-pin-line {
  display: none;
}

.csta-pin-btn.pinned .csta-icon-pin-fill {
  display: block;
}

.csta-icon-pin-outline {
  display: flex;
  align-items: center;
  justify-content: center;
}

.csta-icon-pin-outline .csta-pin-icon {
  width: 16px;
  height: 16px;
}

.csta-icon-pin-outline .csta-pin-icon-fill {
  display: none;
}

.csta-item-content {
  margin-top: 12px;
  padding: 12px 0 0;
  border-top: 1px solid #dee2e6;
}

.csta-item-definition {
  font-size: 14px;
  line-height: 1.6;
  color: #495057;
  margin-bottom: 8px;
}

.csta-item-definition p {
  margin: 0 0 8px 0;
}

.csta-item-definition p:last-child {
  margin-bottom: 0;
}

.csta-item-sources {
  font-size: 13px;
  color: #6c757d;
  padding-top: 8px;
}

.csta-item-sources strong {
  font-weight: 600;
  color: #495057;
}

/* Pin/Unpin Toast Notification */
.csta-pin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background-color: #e8f4fc;
  border: 1px solid #b8daff;
  border-radius: 4px;
  font-size: 14px;
  color: #004085;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.csta-pin-toast.csta-pin-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.csta-pin-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: #28a745;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .csta-glossary-wrapper {
    flex-direction: column;
  }
  
  .csta-glossary-sidebar {
    width: 100%;
    max-height: 50vh;
  }
  
  .csta-results-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .csta-action-buttons {
    width: 100%;
  }
  
  .csta-btn-action {
    flex: 1;
    justify-content: center;
  }

  .csta-pin-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
  }
}
