/**
 * iLibras Widget - Estilos
 * @version 1.0.0
 */

/* Reset e configurações base */
#ilibras-widget-container * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Container principal */
#ilibras-widget-container {
  position: fixed;
  z-index: 9999;
}

/* Posicionamento */
.ilibras-widget-bottom-right {
  bottom: 30px;
  right: 30px;
}

.ilibras-widget-bottom-left {
  bottom: 30px;
  left: 30px;
}

.ilibras-widget-close svg {
  fill: white !important;
  color: white !important;
}

.ilibras-widget-close svg path {
  fill: white !important;
}

#ilibras-widget-container svg {
  pointer-events: none !important;
}

#ilibras-widget-container svg path {
  pointer-events: none !important;
}

.ilibras-widget-top-right {
  top: 30px;
  right: 30px;
}

.ilibras-widget-top-left {
  top: 30px;
  left: 30px;
}

/* Botão flutuante */
.ilibras-widget-button {
  position: relative;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.3), 0 3px 8px rgba(74, 144, 226, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001;
}

.ilibras-widget-button:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.4), 0 4px 12px rgba(74, 144, 226, 0.25);
}

.ilibras-widget-button:active {
  transform: scale(1.02);
}

.ilibras-widget-button svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Badge de notificação */
.ilibras-widget-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #FF3B30;
  color: white;
  font-size: 12px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  animation: ilibras-pulse 2s infinite;
}

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

/* Modal */
.ilibras-widget-modal {
  position: fixed;
  width: 400px;
  max-width: calc(100vw - 60px);
  background: white;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  overflow: hidden;
}

.ilibras-widget-modal-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Posicionamento do modal baseado na posição do botão */
.ilibras-widget-bottom-right .ilibras-widget-modal,
.ilibras-widget-bottom-left .ilibras-widget-modal {
  bottom: 105px;
}

.ilibras-widget-top-right .ilibras-widget-modal,
.ilibras-widget-top-left .ilibras-widget-modal {
  top: 105px;
}

.ilibras-widget-bottom-right .ilibras-widget-modal,
.ilibras-widget-top-right .ilibras-widget-modal {
  right: 0;
}

.ilibras-widget-bottom-left .ilibras-widget-modal,
.ilibras-widget-top-left .ilibras-widget-modal {
  left: 0;
}

/* Header do modal */
.ilibras-widget-header {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.ilibras-widget-header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.ilibras-widget-logo {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ilibras-widget-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.ilibras-widget-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.ilibras-widget-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ilibras-widget-close:active {
  background: rgba(255, 255, 255, 0.25);
}

/* Body do modal */
.ilibras-widget-body {
  padding: 3px 8px !important;
  background: #f8f9fa;
}

.ilibras-widget-message {
  background: white;
  padding: 18px 20px;
  border-radius: 14px;
  color: #2c3e50;
  line-height: 1.6;
  margin-bottom: 8px !important;
  font-size: 14px;
  position: relative;
}

/* Formulário */
.ilibras-widget-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ilibras-widget-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ilibras-widget-form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  padding-left: 4px;
}

.ilibras-widget-form-group input[type="text"],
.ilibras-widget-form-group input[type="tel"] {
  padding: 14px 16px !important;
  border: 1.5px solid #dee2e6;
  border-radius: 10px;
  font-size: 14px;
  color: #2c3e50;
  background: white;
  transition: all 0.2s;
  outline: none;
}

.ilibras-widget-form-group input[type="text"]:focus,
.ilibras-widget-form-group input[type="tel"]:focus {
  border-color: #4A90E2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.ilibras-widget-form-group input[type="text"]::placeholder,
.ilibras-widget-form-group input[type="tel"]::placeholder {
  color: #adb5bd;
}

/* Checkbox customizado */
.ilibras-widget-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 8px 4px;
  font-size: 13px;
  color: #495057;
  line-height: 1.4;
}

.ilibras-widget-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4A90E2;
}

.ilibras-widget-checkbox-label span {
  flex: 1;
}

/* Botão de submit */
.ilibras-widget-submit {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border: none;
  padding: 8px 18px !important;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
  margin-top: 12px;
}

.ilibras-widget-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.ilibras-widget-submit:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(74, 144, 226, 0.3);
}

.ilibras-widget-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsividade */
@media (max-width: 480px) {
  .ilibras-widget-modal {
    width: calc(100vw - 40px);
    max-width: 100%;
  }

  .ilibras-widget-bottom-right,
  .ilibras-widget-bottom-left {
    bottom: 20px;
    left: 20px !important;
    right: 20px !important;
  }

  .ilibras-widget-top-right,
  .ilibras-widget-top-left {
    top: 20px;
    left: 20px !important;
    right: 20px !important;
  }

  .ilibras-widget-button {
    width: 64px;
    height: 64px;
  }

  .ilibras-widget-button svg {
    width: 32px;
    height: 32px;
  }

  .ilibras-widget-modal {
    bottom: 94px !important;
    right: 0 !important;
    left: 0 !important;
    margin: 0 20px;
  }

  .ilibras-widget-body {
    padding: 28px 24px;
  }
}

/* Animação de entrada */
@keyframes ilibras-slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#ilibras-widget-container {
  animation: ilibras-slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estados de erro */
.ilibras-widget-form-group input:invalid:not(:placeholder-shown) {
  border-color: #dc3545;
}

.ilibras-widget-form-group input:valid:not(:placeholder-shown) {
  border-color: #28a745;
}

/* Accessibilidade */
.ilibras-widget-button:focus-visible,
.ilibras-widget-close:focus-visible,
.ilibras-widget-submit:focus-visible {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
}

/* Tema escuro (opcional) */
@media (prefers-color-scheme: dark) {
  .ilibras-widget-modal {
    background: #1e1e1e;
  }

  .ilibras-widget-body {
    background: #2d2d2d;
  }

  .ilibras-widget-message {
    background: #363636;
    color: #e0e0e0;
  }

  .ilibras-widget-form-group label {
    color: #b0b0b0;
  }

  .ilibras-widget-form-group input[type="text"],
  .ilibras-widget-form-group input[type="tel"] {
    background: #363636;
    border-color: #4a4a4a;
    color: #e0e0e0;
  }

  .ilibras-widget-form-group input[type="text"]::placeholder,
  .ilibras-widget-form-group input[type="tel"]::placeholder {
    color: #6c6c6c;
  }

  .ilibras-widget-checkbox-label {
    color: #b0b0b0;
  }
}
