/* ==========================================================================
   GLOSSARIO PAGE - Premium Design
   ========================================================================== */

.glossario-page {
  background: #0a0a0a;
  min-height: 100vh;
  --header-height: 110px;
}

.glossario-page *,
.glossario-page *::before,
.glossario-page *::after {
  box-sizing: border-box;
}

.glossario-hero > .container {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Hero */
.glossario-hero {
  position: relative;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px 60px;
  text-align: center;
  overflow: hidden;
}

.glossario-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.glossario-hero__gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(233, 30, 140, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 20% 80%, rgba(233, 30, 140, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a0a 0%, #111 100%);
}

.glossario-hero__pattern {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

.glossario-hero__content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.glossario-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(233, 30, 140, 0.15);
  border: 1px solid rgba(233, 30, 140, 0.3);
  color: #e91e8c;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.glossario-hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.glossario-hero__subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
  margin: 0 0 24px;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.glossario-hero__subtitle p {
  margin: 0;
}

.glossario-hero__subtitle a {
  color: #e91e8c;
  text-decoration: underline;
}

.glossario-hero__subtitle strong {
  color: #fff;
}

/* Hero Search */
.glossario-hero__search {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.glossario-hero__search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  pointer-events: none;
}

.glossario-hero__search-input {
  width: 100%;
  padding: 18px 80px 18px 56px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  font-size: 1rem;
  background: rgba(255,255,255,0.05);
  color: #fff;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.glossario-hero__search-input:focus {
  outline: none;
  border-color: #e91e8c;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 4px rgba(233, 30, 140, 0.2);
}

.glossario-hero__search-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.glossario-hero__search-kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Scroll Indicator - hidden for compact hero */
.glossario-hero__scroll {
  display: none;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* Content Section */
.glossario-content {
  padding: 0 20px 100px;
  margin-top: -40px;
  position: relative;
  z-index: 10;
}

.glossario-content .container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Sticky Navigation */
.glossario-nav-wrapper {
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 60px;
  position: sticky;
  top: calc(var(--header-height, 80px) + 16px);
  z-index: 100;
}

.glossario-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .glossario-nav-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Letter Navigation */
.glossario-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.glossario-nav__letter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.15);
}

.glossario-nav__letter:hover {
  background: rgba(233, 30, 140, 0.1);
  color: #e91e8c;
  border-color: rgba(233, 30, 140, 0.3);
}

.glossario-nav__letter.active {
  background: linear-gradient(135deg, #e91e8c, #c41574);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(233, 30, 140, 0.4);
}

.glossario-nav__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 0.65rem;
  border-radius: 100px;
  padding: 0 5px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.glossario-nav__letter:hover .glossario-nav__count,
.glossario-nav__letter.active .glossario-nav__count {
  opacity: 1;
  transform: scale(1);
}

.glossario-nav__letter.active .glossario-nav__count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Toggle View Button - Hidden (views are identical) */
.glossario-nav__toggle-view {
  display: none;
}

/* Letter Groups */
.glossario-letter-group {
  display: flex;
  gap: 40px;
  margin-bottom: 80px;
  scroll-margin-top: 180px;
}

.glossario-letter-group__marker {
  flex: 0 0 80px;
  position: sticky;
  top: 200px;
  height: fit-content;
}

.glossario-letter-group__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(233, 30, 140, 0.2), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(233, 30, 140, 0.3);
  border-radius: 20px;
  font-size: 2.5rem;
  font-weight: 800;
  color: #e91e8c;
  text-shadow: 0 0 40px rgba(233, 30, 140, 0.5);
}

.glossario-letter-group__terms {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Grid view */
.glossario-terms--grid .glossario-letter-group__terms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Individual Term */
.glossario-term {
  position: relative;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--delay, 0s);
}

.glossario-term.visible {
  opacity: 1;
  transform: translateY(0);
}

.glossario-term:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(233, 30, 140, 0.3);
  transform: translateY(-4px);
}

.glossario-term--highlighted {
  border-color: #e91e8c;
  background: rgba(233, 30, 140, 0.05);
}

.glossario-term__content {
  padding: 28px;
}

.glossario-term__accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e91e8c, #6366f1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.glossario-term:hover .glossario-term__accent {
  transform: scaleX(1);
}

.glossario-term__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.glossario-term__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.glossario-term__anchor {
  color: rgba(255,255,255,0.2);
  text-decoration: none;
  margin-right: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.glossario-term:hover .glossario-term__anchor {
  opacity: 1;
}

.glossario-term__anchor:hover {
  color: #e91e8c;
}

.glossario-term__copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
}

.glossario-term:hover .glossario-term__copy {
  opacity: 1;
}

.glossario-term__copy:hover {
  background: rgba(233, 30, 140, 0.1);
  border-color: rgba(233, 30, 140, 0.3);
  color: #e91e8c;
}

.glossario-term__copy.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.glossario-term__description {
  color: rgba(255,255,255,0.85);
  line-height: 1.8;
  font-size: 0.95rem;
}

.glossario-term__description p {
  margin: 0 0 12px;
}

.glossario-term__description p:last-child {
  margin-bottom: 0;
}

.glossario-term__description a {
  color: #e91e8c;
  text-decoration: underline;
}

.glossario-term__description strong {
  color: #fff;
  font-weight: 600;
}

/* Details/Summary Accordion */
.glossario-term__details {
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}

.glossario-term__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  color: #e91e8c;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 0;
  transition: all 0.2s ease;
}

.glossario-term__summary::-webkit-details-marker {
  display: none;
}

.glossario-term__summary:hover {
  color: #fff;
}

.glossario-term__summary-icon {
  transition: transform 0.3s ease;
}

.glossario-term__details[open] .glossario-term__summary-icon {
  transform: rotate(180deg);
}

.glossario-term__panel {
  padding: 16px 0 0;
  color: rgba(255,255,255,0.85);
  line-height: 1.8;
  font-size: 0.9rem;
  animation: slideDown 0.3s ease;
}

.glossario-term__panel h2,
.glossario-term__panel h3,
.glossario-term__panel h4,
.glossario-term__panel h5,
.glossario-term__panel h6 {
  color: #fff !important;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.glossario-term__panel h3:first-child {
  margin-top: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glossario-term__panel p {
  margin: 0 0 12px;
}

.glossario-term__panel p:last-child {
  margin-bottom: 0;
}

/* Back to Top */
.glossario-back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e91e8c, #c41574);
  border: none;
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(233, 30, 140, 0.4);
  z-index: 1000;
}

.glossario-back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.glossario-back-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(233, 30, 140, 0.5);
}

/* Empty State */
.glossario-empty {
  text-align: center;
  padding: 100px 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
}

.glossario-empty svg {
  color: rgba(255,255,255,0.2);
  margin-bottom: 24px;
}

.glossario-empty p {
  color: rgba(255,255,255,0.5);
  font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
  .glossario-hero {
    min-height: 60vh;
    padding: 120px 20px 80px;
  }
  
  .glossario-letter-group {
    flex-direction: column;
    gap: 24px;
  }
  
  .glossario-letter-group__marker {
    position: relative;
    top: 0;
    flex: none;
  }
  
  .glossario-letter-group__letter {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  
  .glossario-nav__letter {
    min-width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
  
  .glossario-hero__search-kbd {
    display: none;
  }
}

