* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: #ffffff !important;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  background: #ffffff !important;
  min-height: 100vh;
  overflow-x: hidden;
  color: #1d1d1f;
}

#app {
  background: #ffffff !important;
  min-height: 100vh;
}

.bg-gradient {
  background: #ffffff !important;
  min-height: 100vh;
}

/* Cabeçalho Otimizado para Instagram */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  animation: slideDown 0.6s ease-out;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem; /* Reduzido para Instagram */
  max-width: 100%;
  margin: 0 auto;
  background: transparent;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Reduzido */
  background: transparent;
}

.logo-icon-new {
  width: 1.75rem; /* Menor para Instagram */
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.flame-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
  transition: transform 0.2s ease;
}

.flame-logo:hover {
  transform: scale(1.05);
}

.logo-text {
  font-size: 1.125rem; /* Menor para Instagram */
  font-weight: 600;
  background: linear-gradient(135deg, #ff3b30, #ff9500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.balance-display {
  display: flex;
  align-items: center;
  gap: 0.375rem; /* Reduzido */
  background: linear-gradient(135deg, #34c759, #30d158);
  color: white;
  padding: 0.375rem 0.75rem; /* Menor */
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.8rem; /* Menor */
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.25);
}

.balance-display:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

/* Conteúdo Principal Otimizado para Instagram */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Mudado para flex-start */
  min-height: calc(100vh - 120px); /* Reduzido */
  padding: 1rem; /* Reduzido */
  max-width: 100%;
  margin: 0 auto;
  background: transparent !important;
}

/* Seção de Progresso Compacta */
.progress-section-centered {
  width: 100%;
  margin-bottom: 1.25rem; /* Reduzido */
  animation: fadeInUp 0.6s ease-out 0.2s both;
  background: transparent;
}

.progress-info-centered {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem; /* Reduzido */
  width: 100%;
  background: transparent;
}

.badge-level-centered {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  padding: 0.375rem 0.75rem; /* Menor */
  border-radius: 12px;
  font-size: 0.75rem; /* Menor */
  font-weight: 600;
  letter-spacing: -0.01em;
}

.badge-streak-centered {
  background: rgba(255, 149, 0, 0.1);
  color: #ff9500;
  padding: 0.375rem 0.75rem; /* Menor */
  border-radius: 12px;
  font-size: 0.75rem; /* Menor */
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  letter-spacing: -0.01em;
}

.progress-count {
  font-size: 0.875rem; /* Menor */
  color: #8e8e93;
  font-weight: 500;
  display: none;
}

.progress-bar-centered {
  height: 3px; /* Mais fino */
  background: #f2f2f7;
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.progress-fill-centered {
  height: 100%;
  background: linear-gradient(135deg, #ff3b30, #ff9500);
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
}

/* Card do Perfil Otimizado para Instagram */
.profile-card-centered {
  width: 100%;
  max-width: 320px; /* Menor para Instagram */
  margin-bottom: 1.5rem; /* Reduzido */
  animation: cardFlip 0.8s ease-out;
  background: transparent;
}

.profile-image-container-centered {
  position: relative;
  background: #ffffff;
  border-radius: 20px; /* Menor */
  overflow: hidden;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12); /* Menor */
  border: 0.5px solid rgba(0, 0, 0, 0.04);
}

.profile-image-centered {
  width: 100%;
  height: 380px; /* Reduzido para Instagram */
  object-fit: cover;
  object-position: center;
}

.image-overlay-centered {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent 50%, transparent);
}

.question-badge-centered {
  position: absolute;
  top: 1rem; /* Menor */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 0.5rem 1rem; /* Menor */
  border-radius: 16px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08); /* Menor */
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem; /* Menor */
  font-weight: 500;
  color: #1d1d1f;
  animation: fadeInDown 0.6s ease-out 0.5s both;
  border: 0.5px solid rgba(0, 0, 0, 0.04);
}

.pulse-dot-centered {
  width: 5px; /* Menor */
  height: 5px;
  background: #ff3b30;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.profile-info-centered {
  position: absolute;
  bottom: 1rem; /* Menor */
  left: 1rem;
  color: white;
  background: transparent;
}

.profile-name-centered {
  font-size: 1.5rem; /* Menor */
  font-weight: 600;
  margin-bottom: 0.375rem; /* Menor */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.profile-location-centered {
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  font-size: 0.875rem; /* Menor */
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Botões Otimizados para Instagram */
.action-buttons-centered {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem; /* Reduzido */
  width: 100%;
  animation: fadeInUp 0.6s ease-out 0.3s both;
  background: transparent;
  margin-bottom: 1rem; /* Espaço para navegação */
}

.action-btn-centered {
  width: 56px; /* Menor para Instagram */
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 1.75rem; /* Menor */
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15); /* Menor */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.action-btn-centered i {
  position: relative;
  z-index: 2;
  font-weight: 900;
}

.btn-reject-centered {
  background: linear-gradient(135deg, #ff3b30, #ff6b6b);
}

.btn-reject-centered:hover {
  transform: scale(1.08) translateY(-1px); /* Menor */
  box-shadow: 0 6px 20px rgba(255, 59, 48, 0.4);
}

.btn-reject-centered:active {
  transform: scale(0.95);
  transition: all 0.1s ease;
}

.btn-approve-centered {
  background: linear-gradient(135deg, #34c759, #30d158);
}

.btn-approve-centered:hover {
  transform: scale(1.08) translateY(-1px); /* Menor */
  box-shadow: 0 6px 20px rgba(52, 199, 89, 0.4);
}

.btn-approve-centered:active {
  transform: scale(0.95);
  transition: all 0.1s ease;
}

/* Canvas para Confetes */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  background: transparent;
}

/* Tela de Conclusão Compacta */
.completion-screen {
  text-align: center;
  animation: fadeInScale 0.8s ease-out;
  width: 100%;
  background: #ffffff;
  border-radius: 20px; /* Menor */
  padding: 2rem 1.5rem; /* Menor */
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
  border: 0.5px solid rgba(0, 0, 0, 0.04);
}

.trophy-icon {
  width: 60px; /* Menor */
  height: 60px;
  background: linear-gradient(135deg, #ff9500, #ffcc02);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem; /* Menor */
  font-size: 2rem; /* Menor */
  color: white;
  animation: bounce 1s ease-out;
  box-shadow: 0 6px 20px rgba(255, 149, 0, 0.3);
}

.completion-title {
  font-size: 1.5rem; /* Menor */
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.75rem; /* Menor */
  letter-spacing: -0.02em;
}

.completion-text {
  color: #8e8e93;
  margin-bottom: 1rem; /* Menor */
  line-height: 1.5;
  font-size: 0.95rem; /* Menor */
  font-weight: 400;
}

.final-balance {
  font-size: 2.25rem; /* Menor */
  font-weight: 700;
  background: linear-gradient(135deg, #34c759, #30d158);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem; /* Menor */
  letter-spacing: -0.02em;
}

.completion-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* Menor */
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #007aff, #5ac8fa);
  color: white;
  border: none;
  padding: 0.875rem; /* Menor */
  border-radius: 14px; /* Menor */
  font-size: 1rem; /* Menor */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px); /* Menor */
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

.btn-secondary {
  width: 100%;
  background: #f2f2f7;
  color: #1d1d1f;
  border: none;
  padding: 0.875rem; /* Menor */
  border-radius: 14px; /* Menor */
  font-size: 1rem; /* Menor */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #e5e5ea;
  transform: translateY(-1px);
}

/* Navegação Inferior Otimizada para Instagram */
.bottom-nav {
  position: fixed;
  bottom: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  max-width: 100%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem;
  animation: slideUp 0.6s ease-out 0.5s both;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  background: transparent;
  border: none;
  color: #616161;
  cursor: pointer;
  transition: color 0.2s ease;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.375rem;
  border-radius: 10px;
  flex: 1; /* Adicionar para distribuir igualmente */
}

.nav-item.active {
  color: #007aff;
}

.nav-item:hover {
  color: #007aff;
}

.nav-icon-special {
  width: 1.5rem; /* Menor */
  height: 1.5rem;
  background: linear-gradient(135deg, #ff3b30, #ff9500);
  border-radius: 8px; /* Menor */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.25);
}

.nav-flame {
  width: 1rem; /* Menor */
  height: 1rem;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Utilitários */
.hidden {
  display: none !important;
}

/* Animações Suaves */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px); /* Menor */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-15px); /* Menor */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96); /* Menor */
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cardFlip {
  from {
    opacity: 0;
    transform: scale(0.96); /* Menor */
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05); /* Menor */
  }
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  40%,
  43% {
    transform: translate3d(0, -15px, 0); /* Menor */
  }
  70% {
    transform: translate3d(0, -8px, 0); /* Menor */
  }
  90% {
    transform: translate3d(0, -3px, 0); /* Menor */
  }
}

/* Responsividade Específica para Instagram */
@media (max-width: 414px) {
  .main-content {
    padding: 0.75rem;
    min-height: calc(100vh - 100px);
  }

  .profile-image-centered {
    height: 350px; /* Menor para telas pequenas */
  }

  .action-buttons-centered {
    gap: 2.5rem;
  }

  .action-btn-centered {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

@media (max-height: 700px) {
  .profile-image-centered {
    height: 320px; /* Muito menor para telas baixas */
  }

  .main-content {
    padding: 0.5rem;
    min-height: calc(100vh - 90px);
  }

  .action-buttons-centered {
    gap: 2rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-height: 600px) {
  .profile-image-centered {
    height: 280px; /* Ainda menor */
  }

  .header-content {
    padding: 0.5rem 1rem;
  }

  .progress-section-centered {
    margin-bottom: 1rem;
  }

  .profile-card-centered {
    margin-bottom: 1rem;
  }
}

/* Otimizações específicas para Instagram/Facebook in-app browser */
@media (max-height: 500px) {
  .profile-image-centered {
    height: 240px;
  }

  .main-content {
    padding: 0.5rem;
  }

  .bottom-nav {
    bottom: 0.25rem;
    padding: 0.375rem;
  }
}

/* FLUIDEZ MELHORADA */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Transições mais suaves */
button,
.nav-item,
.balance-display {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Performance das animações */
.profile-card-centered,
.action-buttons-centered,
.progress-section-centered {
  will-change: transform, opacity;
}

/* Hover states otimizados para touch */
@media (hover: none) and (pointer: coarse) {
  .action-btn-centered:hover {
    transform: none;
  }

  .action-btn-centered:active {
    transform: scale(0.95);
  }

  .balance-display:hover {
    transform: none;
  }

  .nav-item:hover {
    transform: none;
  }
}

/* CORREÇÃO FINAL - GARANTIR FUNDO BRANCO */
html,
body,
#app,
.bg-gradient,
.main-content {
  background: #ffffff !important;
}

div,
section,
main,
article {
  background: transparent;
}

.header {
  background: rgba(255, 255, 255, 0.98) !important;
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.98) !important;
}
