/* Pequenas melhorias sem recompilar Tailwind */

/* Área viva para mensagens dinâmicas acessível a leitores de tela */
[aria-live][data-visually-hidden="true"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

/* mobile-enhancements.css — patch barra móvel flutuante e translúcida */

.floating-mobile-actions {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.10);
  padding: 8px 10px;
}
 
/* Menu flutuante em estilo HUD */
body.has-mobile-floating-menu {
  scroll-padding-bottom: 6.5rem;
}

.mobile-floating-menu {
  --hud-accent: #38bdf8;
  --hud-accent-strong: #67e8f9;
  --hud-bg: transparent;
  position: fixed;
  inset: auto 0 clamp(12px, 1.4vh, 28px);
  margin: 0 auto;
  width: min(92%, 460px);
  color: #f8fafc;
  background: var(--hud-bg);
  border: 1px solid color-mix(in srgb, var(--hud-accent) 30%, transparent);
  border-radius: 1.5rem;
  padding: 1rem 0.85rem calc(0.95rem + env(safe-area-inset-bottom));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  z-index: 90;
  display: none;
  transform: translate3d(0, 0, 0);
  transition: transform 0.35s ease, opacity 0.25s ease;
  clip-path: none;
}

.mobile-floating-menu::before,
.mobile-floating-menu::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.mobile-floating-menu::before {
  border: 1px solid rgba(103, 232, 249, 0.4);
  background: none;
  opacity: 1;
  filter: none;
}

.mobile-floating-menu::after {
  display: none;
}

.mobile-floating-menu--visible {
  display: block;
  animation: menuPop 0.35s ease;
}

.mobile-floating-menu--snoozed {
  opacity: 0;
  transform: translate3d(0, 85%, 0);
  pointer-events: none;
}

.mobile-floating-menu__circuit {
  position: absolute;
  inset: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)) 1.2rem;
  border-radius: 1rem;
  border: 1px dashed rgba(103, 232, 249, 0.35);
  transform: skewX(-4deg);
  pointer-events: none;
  opacity: 0.35;
}

.mobile-floating-menu__grabber {
  width: 46px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--hud-accent), transparent);
  margin: 0 auto 0.8rem;
  display: block;
}

.mobile-floating-menu__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248, 250, 252, 0.7);
}

.mobile-floating-menu__status-label {
  opacity: 0.8;
}

.mobile-floating-menu__status-value {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.45);
  color: var(--hud-accent-strong);
  background: rgba(103, 232, 249, 0.05);
  font-weight: 700;
}

.mobile-floating-menu__status.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.mobile-floating-menu__inner {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  justify-content: space-between;
  overflow-x: auto;
  scrollbar-width: none;
}

.mobile-floating-menu__inner::-webkit-scrollbar {
  display: none;
}

.mobile-floating-menu__btn {
  position: relative;
  flex: 1;
  min-width: 4rem;
  /* WCAG 2.1 - Touch target mínimo 44x44px */
  min-height: 44px;
  /* HUD button styling – adjust opacity/contrast here */
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 1rem;
  color: inherit;
  padding: 0.55rem 0.35rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: inset 0 0 12px rgba(2, 6, 23, 0.35);
}

.mobile-floating-menu__btn::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(103, 232, 249, 0.25);
  border-radius: 0.85rem;
  pointer-events: none;
}

.mobile-floating-menu__btn:focus-visible {
  outline: 2px solid var(--hud-accent);
  outline-offset: 3px;
}

.mobile-floating-menu__btn:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.6);
  background: rgba(30, 64, 175, 0.55);
}

.mobile-floating-menu__btn.is-primary {
  background: linear-gradient(135deg, #34d399, #22d3ee);
  color: #031b0f;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 15px 30px rgba(34, 211, 238, 0.25);
}

.mobile-floating-menu__btn.is-primary::before {
  border-color: rgba(4, 120, 87, 0.4);
}

.mobile-floating-menu__btn.is-ghost {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.45);
}

.mobile-floating-menu__icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-weight: 700;
}

.mobile-floating-menu__icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(103, 232, 249, 0.35));
  font-weight: 700;
}

.mobile-floating-menu__label {
  font-size: 0.7rem;
  font-weight: 700;
}

.mobile-floating-menu__collapse {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  border: none;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: inherit;
  cursor: pointer;
  letter-spacing: 0.08em;
}

.mobile-floating-menu__collapse svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* Estado compacto (padrão) - apenas ícones */
.mobile-floating-menu--compact .mobile-floating-menu__label {
  display: none;
}

.mobile-floating-menu--compact .mobile-floating-menu__btn {
  min-width: 2.8rem;
  padding: 0.5rem;
}

.mobile-floating-menu--compact .mobile-floating-menu__inner {
  gap: 0.35rem;
}

.mobile-floating-menu--compact .mobile-floating-menu__collapse span {
  display: none;
}

.mobile-floating-menu--compact .mobile-floating-menu__collapse {
  padding: 0.25rem 0.45rem;
}

/* Estado expandido - ícones + labels */
.mobile-floating-menu:not(.mobile-floating-menu--compact) .mobile-floating-menu__btn {
  min-width: 4.5rem;
}

.mobile-floating-menu--empty {
  display: none;
}

.mobile-floating-menu__spacer {
  width: 100%;
  height: 0;
}
 
@media (prefers-color-scheme: light) {
  .mobile-floating-menu {
    --hud-bg: transparent;
    color: #0f172a;
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: none;
  }
  .mobile-floating-menu__btn.is-primary {
    color: #022c22;
  }
}
@keyframes menuPop {
  from {
    opacity: 0;
    transform: translate3d(0, 25%, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.pulse-highlight {
  animation: pulseTarget 1.2s ease;
}

@keyframes pulseTarget {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5);
  }

  100% {
    box-shadow: 0 0 0 18px rgba(14, 165, 233, 0);
  }
}

.floating-mobile-actions.hidden {
  display: none;
}

.floating-mobile-actions .inner {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .hide-on-mobile {
    display: none !important;
  }
}

/* Botões maiores para toque */
.btn-touch {
  min-height: 2.75rem;
  line-height: 1.2;
  font-weight: 600;
}

/* Foco visível consistente */
:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Badge offline */
.offline-badge {
  background: #991b1b;
  color: #fff;
  font-size: .625rem;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-left: 6px;
}

/* Skeleton */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #e5e7eb;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
  animation: skeleton 1.2s infinite;
}

@keyframes skeleton {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Toast simples */
.toast-container {
  position: fixed;
  z-index: 70;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(90%, 400px);
}

.toast {
  background: #1f2937;
  color: #f8fafc;
  padding: .75rem .9rem;
  border-radius: .75rem;
  font-size: .85rem;
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  animation: fadeToast .25s ease;
}

.toast.success {
  background: #065f46;
}

.toast.error {
  background: #991b1b;
}

@keyframes fadeToast {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Modal bottom-sheet no mobile (reutiliza modal existente com uma classe extra) */
@media (max-width:640px) {
  .bottom-sheet {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 1.25rem 1.25rem 0 0 !important;
    transform: translateY(0) !important;
  }
}
