/* Glossary Modal Styles */

.glossary-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 9999;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glossary-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.glossary-button::before {
  content: '📖';
}

.glossary-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  animation: fadeIn 0.2s;
}

.glossary-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.glossary-modal {
  background: white;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s;
}

.glossary-header {
  padding: 24px 28px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.glossary-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.glossary-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
  line-height: 1;
}

.glossary-close:hover {
  background: rgba(255,255,255,0.3);
}

.glossary-search {
  padding: 16px 28px;
  border-bottom: 1px solid #e2e8f0;
}

.glossary-search input {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.glossary-search input:focus {
  outline: none;
  border-color: #1e40af;
}

.glossary-content {
  overflow-y: auto;
  padding: 20px 28px 28px;
  flex: 1;
}

.glossary-category {
  margin-bottom: 32px;
}

.glossary-category h3 {
  font-size: 18px;
  color: #1e40af;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
}

.glossary-term {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #1e40af;
  transition: transform 0.2s, box-shadow 0.2s;
}

.glossary-term:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.glossary-term.hidden {
  display: none;
}

.glossary-term-label {
  font-weight: 700;
  font-size: 16px;
  color: #1e40af;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.glossary-term-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.glossary-term-short {
  color: #475569;
  line-height: 1.6;
  margin-bottom: 8px;
}

.glossary-term-long {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.glossary-term-why {
  color: #0f766e;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
  font-style: italic;
  background: #f0fdfa;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #14b8a6;
}

.glossary-term-why::before {
  content: '💡 Why it matters: ';
  font-weight: 600;
  font-style: normal;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .glossary-modal {
    width: 95%;
    max-height: 90vh;
  }

  .glossary-header {
    padding: 20px;
  }

  .glossary-header h2 {
    font-size: 20px;
  }

  .glossary-search {
    padding: 12px 20px;
  }

  .glossary-content {
    padding: 16px 20px 20px;
  }

  .glossary-button {
    bottom: 80px;
    right: 24px;
    width: 52px;
    height: 52px;
    font-size: 22px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  }
}
