/* ============================================================
   Components
   Back-to-top button, badge/pill, tooltips, global flash
   messages, Material Icons / Symbols fallback.
   ============================================================ */

/* Badge / pill helpers */
.gf-pill-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background-color: var(--gf-color-primary-soft);
  color: var(--gf-color-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--gf-color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1020;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.back-to-top:hover {
  background-color: var(--gf-color-primary-hover);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

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

/* Only show back to top button on mobile */
@media (min-width: 992px) {
  .back-to-top {
    display: none !important;
  }
}

/* Tooltip styling for better readability */
.tooltip-inner {
  max-width: 350px;
  text-align: left;
  white-space: pre-line;
  line-height: 1.6;
  padding: 0.75rem 1rem;
}

.tooltip {
  font-size: 0.875rem;
}

/* Global flash messages */
.global-messages {
  background-color: var(--bs-body-bg, #ffffff);
  color: var(--gf-color-neutral-900);
  transition: opacity 0.3s ease;
}

.global-messages__alert {
  --global-message-accent: rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0;
  border: none;
  background-color: transparent;
  color: var(--bs-alert-color, inherit);
  box-shadow: none;
  padding: 0.75rem 1.1rem 0.75rem 1.45rem;
  border-radius: 0.85rem;
  position: relative;
  isolation: isolate;
}

.global-messages__content {
  flex: 1 1 auto;
  color: inherit;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.global-messages__alert.alert-success .global-messages__content,
.global-messages__alert.alert-success {
  color: var(--gf-color-primary);
  --global-message-accent: rgba(var(--gf-color-primary-rgb), 0.65);
}

.global-messages__alert.alert-info {
  --global-message-accent: rgba(56, 189, 248, 0.55);
}

.global-messages__alert.alert-warning {
  --global-message-accent: rgba(251, 191, 36, 0.6);
}

.global-messages__alert.alert-danger,
.global-messages__alert.alert-error {
  --global-message-accent: rgba(248, 113, 113, 0.7);
}

.global-messages__alert::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 15px 30px -24px rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 0;
}

/* Barra lateral removida - sem ::after */

.global-messages .btn-close {
  float: none;
  margin: 0;
  position: relative;
  z-index: 1;
}

.page-home .global-messages {
  background-color: var(--gf-color-primary);
  color: var(--gf-color-primary-contrast);
}

.page-home .global-messages__alert {
  color: var(--gf-color-primary-contrast);
}

.page-home .global-messages__alert::before {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 18px 32px -28px rgba(0, 0, 0, 0.55);
}

/* Barra lateral removida - sem ::after na home */

.page-home .global-messages__alert .global-messages__content {
  color: inherit;
}

.page-home .global-messages__alert.alert-success .global-messages__content,
.page-home .global-messages__alert.alert-success {
  color: inherit;
}

.page-home .global-messages .btn-close {
  filter: invert(1);
  opacity: 0.75;
}

.page-home .global-messages .btn-close:hover,
.page-home .global-messages .btn-close:focus {
  opacity: 1;
}

/* ============================================================
   Material Icons Fallback
   Ensures icon text is hidden if the font fails to load.
   The font-display: block in Google Fonts should handle this,
   but this provides extra protection against FOIT/FOUT issues.
   ============================================================ */

/* Hide icon text content when fonts are loading or unavailable */
.material-icons,
.material-icons-outlined {
  font-family: 'Material Icons', 'Material Icons Outlined', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  /* Ensure text doesn't show as fallback - overflow hidden clips text */
  overflow: hidden;
  /* Fixed width prevents layout shift */
  width: 1em;
  height: 1em;
}

/* Ensure proper sizing in various contexts */
.material-icons-outlined {
  font-family: 'Material Icons Outlined', sans-serif;
}
