/* ============================================
   ASSISTENTE LÉO - GUIA FLUTUANTE
   Sistema de overlay para guiar pais através
   das etapas de segurança digital
   ============================================ */

/* ============================================
   VARIÁVEIS CSS
   ============================================ */
:root {
  --leo-primary: #f89832;
  --leo-secondary: #2b7de9;
  --leo-success: #47d764;
  --leo-bg: #ffffff;
  --leo-shadow: rgba(0, 0, 0, 0.15);
  --leo-shadow-lg: rgba(0, 0, 0, 0.25);
  --leo-text: #333333;
  --leo-text-light: #666666;
  --leo-border: #e0e0e0;
  --leo-overlay: rgba(0, 0, 0, 0.5);
  --leo-z-index: 999999;
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
#leo-assistant {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: var(--leo-z-index);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   ÍCONE FLUTUANTE
   ============================================ */
#leo-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--leo-primary), #ffb347);
  box-shadow: 0 4px 20px var(--leo-shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 3px solid #fff;
}

#leo-icon:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 8px 30px var(--leo-shadow-lg);
}

#leo-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Badge de progresso */
#leo-progress-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--leo-success);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  border: 2px solid white;
  box-shadow: 0 2px 8px var(--leo-shadow);
}

/* ============================================
   PAINEL EXPANDIDO
   ============================================ */
#leo-panel {
  position: fixed;
  bottom: 95px;
  right: 20px;
  width: 380px;
  max-height: 600px;
  background: var(--leo-bg);
  border-radius: 16px;
  box-shadow: 0 8px 40px var(--leo-shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#leo-panel.visible {
  display: flex;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   CABEÇALHO DO PAINEL
   ============================================ */
#leo-header {
  background: linear-gradient(135deg, var(--leo-primary), #ffb347);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#leo-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

#leo-header-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
}

#leo-header-text h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

#leo-header-text p {
  margin: 3px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}

#leo-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 0.2s;
}

#leo-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MENSAGEM CONTEXTUAL
   ============================================ */
#leo-message {
  background: linear-gradient(135deg, #f0f7ff, #e6f2ff);
  padding: 18px;
  border-bottom: 1px solid var(--leo-border);
  color: var(--leo-text);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: start;
  gap: 10px;
}

#leo-message-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* ============================================
   LISTA DE ETAPAS
   ============================================ */
#leo-steps {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

#leo-steps::-webkit-scrollbar {
  width: 6px;
}

#leo-steps::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#leo-steps::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

#leo-steps::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ============================================
   ITEM DE ETAPA
   ============================================ */
.leo-step {
  background: white;
  border: 2px solid var(--leo-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.leo-step:hover {
  border-color: var(--leo-primary);
  box-shadow: 0 4px 12px var(--leo-shadow);
  transform: translateY(-2px);
}

.leo-step.completed {
  border-color: var(--leo-success);
  background: linear-gradient(135deg, #f0fff4, #e6f9ee);
}

.leo-step.current {
  border-color: var(--leo-secondary);
  background: linear-gradient(135deg, #f0f7ff, #e6f2ff);
}

.leo-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.leo-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--leo-border);
  color: var(--leo-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.leo-step.completed .leo-step-number {
  background: var(--leo-success);
  color: white;
}

.leo-step.current .leo-step-number {
  background: var(--leo-secondary);
  color: white;
}

.leo-step-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--leo-text);
  margin: 0;
}

.leo-step-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--leo-success);
}

.leo-step-description {
  color: var(--leo-text-light);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding-left: 44px;
}

/* ============================================
   RODAPÉ
   ============================================ */
#leo-footer {
  background: #f9f9f9;
  padding: 14px 20px;
  border-top: 1px solid var(--leo-border);
  text-align: center;
  font-size: 12px;
  color: var(--leo-text-light);
}

/* ============================================
   RESPONSIVIDADE MOBILE
   ============================================ */
@media (max-width: 768px) {
  #leo-assistant {
    bottom: 15px;
    right: 15px;
  }

  #leo-icon {
    width: 60px;
    height: 60px;
  }

  #leo-progress-badge {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  #leo-panel {
    bottom: 80px;
    right: 15px;
    left: 15px;
    width: auto;
    max-height: 500px;
  }

  #leo-header {
    padding: 16px;
  }

  #leo-header-avatar {
    width: 40px;
    height: 40px;
  }

  #leo-header-text h3 {
    font-size: 16px;
  }

  #leo-header-text p {
    font-size: 11px;
  }

  #leo-message {
    padding: 14px;
    font-size: 13px;
  }

  #leo-steps {
    padding: 12px;
  }

  .leo-step {
    padding: 14px;
  }

  .leo-step-title {
    font-size: 14px;
  }

  .leo-step-description {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #leo-panel {
    max-height: 400px;
  }

  .leo-step-description {
    padding-left: 0;
    margin-top: 8px;
  }
}

/* ============================================
   ANIMAÇÕES ADICIONAIS
   ============================================ */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.leo-step.current .leo-step-number {
  animation: pulse 2s infinite;
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.leo-hidden {
  display: none !important;
}

.leo-fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
