/*
 * Sistema de Widgets de Acessibilidade com Drag and Drop
 * Design moderno e interativo para ferramentas de acessibilidade
 */

/* ===== Botão Flutuante Principal ===== */
.accessibility-fab {
  position: fixed;
  bottom: 110px;
  right: 30px;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.accessibility-fab-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d7a68 0%, #16a085 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.accessibility-fab-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.accessibility-fab-button:hover::before {
  width: 300px;
  height: 300px;
}

.accessibility-fab-button:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.accessibility-fab-button:active {
  transform: translateY(-2px) scale(1.02);
}

.accessibility-fab-button i {
  z-index: 1;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ===== Menu Popup ===== */
.accessibility-popup-menu {
  position: absolute;
  bottom: 75px;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 8px;
  width: 239px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
}

.accessibility-popup-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.accessibility-popup-menu::before {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 20px;
  width: 16px;
  height: 16px;
  background: white;
  transform: rotate(45deg);
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.accessibility-popup-menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
  text-decoration: none;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.accessibility-popup-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  /* verde suave */
  background: linear-gradient(90deg, #0d7a68 0%, #16a085 100%);
  transition: width 0.3s ease;
}

.accessibility-popup-menu-item:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transform: translateX(5px);
  color: white;
}

.accessibility-popup-menu-item:hover::before {
  width: 100%;
}

.accessibility-popup-menu-item i {
  font-size: 20px;
  width: 24px;
  text-align: center;
  z-index: 1;
}

.accessibility-popup-menu-item span {
  font-size: 14px;
  font-weight: 500;
  z-index: 1;
}

/* ===== Widgets Draggable ===== */
.accessibility-widget {
  position: fixed;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 9998;
  width: 280px;


  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.accessibility-widget.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.accessibility-widget.dragging {
  cursor: move;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
  transform: scale(1.02);
}

.accessibility-widget.minimized .widget-content {
  display: none;
}

.accessibility-widget.minimized {
  min-width: auto;
}

/* Widget Header */
.widget-header {
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  color: #4c4c4c;
  padding: 10px 16px;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.widget-header:active {
  cursor: grabbing;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

.widget-title i {
  font-size: 18px;
}

.widget-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.widget-control-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #4c4c4c;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
}

.widget-control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.widget-control-btn:active {
  transform: scale(0.95);
}

/* Widget Content */
.widget-content {
  padding: 0px 20px;
  animation: slideDown 0.3s ease;
}

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

.widget-content label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.widget-content label i {
  color: #667eea;
}

.widget-content select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.widget-content select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.widget-content select:hover {
  border-color: #764ba2;
}

.widget-info {
  margin-top: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-radius: 8px;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  border-left: 3px solid #0d7a68 !important;
  margin-bottom: 68px;
}

.widget-info i {
  color: #0d7a68 !important;
  margin-right: 6px;
}


/* ===== Responsividade ===== */
@media (max-width: 768px) {
  .accessibility-fab {
    bottom: 20px;
    right: 20px;
  }

  .accessibility-fab-button {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .accessibility-popup-menu {
    width: 260px;
    bottom: 65px;
  }

  .accessibility-widget {
    min-width: 260px;
    max-width: calc(100vw - 40px);
  }
}

/* ===== Animações de entrada ===== */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Estados visuais ===== */
.accessibility-widget:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* Badge de notificação (opcional para futuras features) */
.widget-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4757;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

/* ===== Acessibilidade ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible para acessibilidade de teclado */
.accessibility-fab-button:focus-visible,
.widget-control-btn:focus-visible,
.accessibility-popup-menu-item:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* ===== Transições suaves ===== */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ===== Container VLibras dentro do Widget ===== */
.vlibras-widget-container {
  min-height: 120px;
  width: 100%;
  position: relative;
}

/* Ajusta o widget VLibras */
/* #widget-vlibras {
  min-width: 400px;
  max-width: 700px;
} */
/*
#widget-vlibras .widget-content {
  padding: 20px;
  position: relative;
  overflow: visible;
  min-height: 300px;
} */

/* Container VLibras - centraliza tudo */
.vlibras-widget-container [vw].enabled {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  margin: 0 auto !important;
  width: 100% !important;
  text-align: center !important;
}

/* Botão de acesso VLibras */
.vlibras-widget-container [vw-access-button] {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  margin: 0 auto !important;
  text-align: center !important;
}

/* Plugin wrapper - mantém centralizado */
.vlibras-widget-container [vw-plugin-wrapper] {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  margin: 10px auto 0 !important;
  text-align: center !important;
}

/* Top wrapper */
.vlibras-widget-container .vw-plugin-top-wrapper {
  position: relative !important;
  margin: 0 auto !important;
  left: auto !important;
  right: auto !important;
  text-align: center !important;
}

/* Qualquer div dentro do VLibras */
.vlibras-widget-container [vw].enabled > div {
  margin-left: auto !important;
  margin-right: auto !important;
}

