/* Estilos específicos para o Glossário */
:root {
  --primary: #b71c50;
  --secondary: #2c3e50;
  --accent: #3498db;
  --light-accent: #e3f2fd;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --dark: #333334;
  --gray: #8f8f8f;
  --light-gray: #f4f4f4;
  --background: #f9f9f9;
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

/* Cabeçalho do Glossário */
.glossary-header {
  background: linear-gradient(135deg, var(--primary) 0%, #8e1542 100%);
  color: white;
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.glossary-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
  animation: pulse 15s infinite linear;
  z-index: 1;
}

.glossary-header h1 {
  position: relative;
  z-index: 2;
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.glossary-header p {
  position: relative;
  z-index: 2;
  font-size: 1.1rem;
  max-width: 80%;
  opacity: 0.9;
}

/* Categorias de termos */
.glossary-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 2rem;
}

.category-pill {
  background-color: white;
  color: var(--dark);
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-pill:hover, .category-pill.active {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(183, 28, 80, 0.2);
}

.category-pill i {
  margin-right: 5px;
}

/* Barra de pesquisa */
.glossary-search {
  position: relative;
  margin-bottom: 2rem;
}

.glossary-search input {
  width: 100%;
  padding: 1rem 1.5rem;
  padding-left: 3rem;
  border-radius: 50px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.glossary-search input:focus {
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-color: var(--primary);
}

.glossary-search i {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 1.2rem;
}

/* Cards de termos */
.term-card {
  background-color: white;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary);
  overflow: hidden;
}

.term-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.term-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.term-title {
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--dark);
  display: flex;
  align-items: center;
}

.term-title i {
  margin-right: 10px;
  color: var(--primary);
  font-size: 1.4rem;
}

.term-category {
  font-size: 0.8rem;
  background-color: var(--light-accent);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 500;
}

.term-body {
  padding: 1.5rem;
}

.term-definition {
  color: var(--dark);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.term-example {
  background-color: var(--light-gray);
  padding: 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  color: var(--gray);
  border-left: 3px solid var(--accent);
}

.term-footer {
  padding: 1rem 1.5rem;
  background-color: rgba(0,0,0,0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.term-related {
  display: flex;
  gap: 10px;
}

.related-term {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-term:hover {
  color: var(--primary);
  text-decoration: underline;
}

.term-action {
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Alfabeto de navegação */
.alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2rem 0;
  gap: 5px;
}

.alphabet-letter {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: white;
  color: var(--dark);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.alphabet-letter:hover, .alphabet-letter.active {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.alphabet-letter.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Animações */
@keyframes pulse {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

/* Ícone flutuante de ajuda */
.floating-help {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
}

.floating-help:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.floating-help i {
  font-size: 1.5rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .glossary-header h1 {
    font-size: 2rem;
  }
  
  .glossary-header p {
    max-width: 100%;
  }
  
  .term-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .term-category {
    margin-top: 0.5rem;
  }
  
  .term-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .alphabet-letter {
    width: 35px;
    height: 35px;
  }
}

/* Modo escuro */
[data-bs-theme="dark"] {
  --background: #1a1a1a;
  --light-gray: #2c2c2c;
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  
  .glossary-header {
    background: linear-gradient(135deg, var(--primary) 0%, #5a0e2a 100%);
  }
  
  .term-card {
    background-color: #252525;
  }
  
  .term-title {
    color: #e0e0e0;
  }
  
  .term-definition {
    color: #d0d0d0;
  }
  
  .term-example {
    background-color: #333;
    color: #b0b0b0;
  }
  
  .alphabet-letter {
    background-color: #333;
    color: #e0e0e0;
  }
  
  .category-pill {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
  }
}

/* Efeitos de hover nos cards */
.term-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(183, 28, 80, 0.1) 0%, rgba(183, 28, 80, 0) 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.term-card:hover::after {
  opacity: 1;
}

/* Tooltip personalizado */
.custom-tooltip {
  position: relative;
}

.custom-tooltip:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--dark);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.custom-tooltip:hover::after {
  content: "";
  position: absolute;
  bottom: calc(100% - 5px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark) transparent transparent transparent;
  z-index: 100;
}
