/* Correções específicas para espaçamento entre elementos Tailwind em todas as resoluções */

/* Correções globais (desktop, tablet, mobile) */
.tw-template-container > * {
  margin-bottom: 1.5rem !important;
}

.tw-template-container > *:last-child {
  margin-bottom: 0 !important;
}

/* Espaçamento específico para elementos de background colorido */
.tw-template-container .tw-bg-blue-50,
.tw-template-container .tw-bg-green-50,
.tw-template-container .tw-bg-orange-50,
.tw-template-container .tw-bg-purple-50,
.tw-template-container .tw-bg-cyan-50,
.tw-template-container .tw-bg-yellow-50,
.tw-template-container .tw-bg-red-50,
.tw-template-container .tw-bg-pink-50,
.tw-template-container .tw-bg-gray-50 {
  margin-bottom: 1.5rem !important;
  margin-top: 0.75rem !important;
}

/* Espaçamento entre cards e elementos rounded */
.tw-template-container .tw-rounded-xl,
.tw-template-container .tw-rounded-2xl,
.tw-template-container .tw-rounded-lg {
  margin-bottom: 1.5rem !important;
}

/* Espaçamento entre headings */
.tw-template-container h1,
.tw-template-container h2,
.tw-template-container h3,
.tw-template-container h4,
.tw-template-container .tw-text-3xl,
.tw-template-container .tw-text-2xl,
.tw-template-container .tw-text-xl {
  margin-bottom: 1rem !important;
  margin-top: 1.5rem !important;
}

.tw-template-container h1:first-child,
.tw-template-container h2:first-child,
.tw-template-container .tw-text-3xl:first-child,
.tw-template-container .tw-text-2xl:first-child {
  margin-top: 0 !important;
}

/* Espaçamento para parágrafos */
.tw-template-container p {
  margin-bottom: 1rem !important;
}

/* Espaçamento para listas */
.tw-template-container ul,
.tw-template-container ol {
  margin-bottom: 1.5rem !important;
  margin-top: 0.75rem !important;
}

.tw-template-container li {
  margin-bottom: 0.375rem !important;
}

/* Espaçamento para tabelas */
.tw-template-container table {
  margin-bottom: 1.5rem !important;
  margin-top: 0.75rem !important;
}

/* Espaçamento para elementos gradientes */
.tw-template-container .tw-bg-gradient-to-r {
  margin-bottom: 2rem !important;
  margin-top: 1.5rem !important;
}

/* Espaçamento para grids */
.tw-template-container .tw-grid {
  margin-bottom: 1.5rem !important;
}

.tw-template-container .tw-grid > * {
  margin-bottom: 0.75rem !important;
}

/* Espaçamento específico para elementos com classes tw-mb-* - Desktop */
.tw-template-container .tw-mb-12 {
  margin-bottom: 3rem !important;
}

.tw-template-container .tw-mb-8 {
  margin-bottom: 2rem !important;
}

.tw-template-container .tw-mb-6 {
  margin-bottom: 1.5rem !important;
}

.tw-template-container .tw-mb-4 {
  margin-bottom: 1rem !important;
}

.tw-template-container .tw-mb-3 {
  margin-bottom: 0.75rem !important;
}

.tw-template-container .tw-mb-2 {
  margin-bottom: 0.5rem !important;
}

/* Padding interno adequado para containers */
.tw-template-container .tw-p-8,
.tw-template-container .tw-p-6,
.tw-template-container .tw-p-4,
.tw-template-container .tw-p-3 {
  padding: 1.5rem !important;
}

/* Garantir que elementos inline tenham espaçamento */
.tw-template-container .tw-flex.tw-items-center > * {
  margin-right: 0.75rem !important;
}

.tw-template-container .tw-flex.tw-items-center > *:last-child {
  margin-right: 0 !important;
}

/* Correções específicas para mobile */
@media (max-width: 640px) {
  .tw-template-container > * {
    margin-bottom: 1rem !important;
  }
  
  .tw-template-container > *:last-child {
    margin-bottom: 0 !important;
  }
  
  /* Espaçamento específico para elementos de background colorido */
  .tw-template-container .tw-bg-blue-50,
  .tw-template-container .tw-bg-green-50,
  .tw-template-container .tw-bg-orange-50,
  .tw-template-container .tw-bg-purple-50,
  .tw-template-container .tw-bg-cyan-50,
  .tw-template-container .tw-bg-yellow-50,
  .tw-template-container .tw-bg-red-50,
  .tw-template-container .tw-bg-pink-50,
  .tw-template-container .tw-bg-gray-50 {
    margin-bottom: 1rem !important;
    margin-top: 0.5rem !important;
  }
  
  /* Espaçamento entre cards e elementos rounded */
  .tw-template-container .tw-rounded-xl,
  .tw-template-container .tw-rounded-2xl,
  .tw-template-container .tw-rounded-lg {
    margin-bottom: 1rem !important;
  }
  
  /* Espaçamento entre headings */
  .tw-template-container h1,
  .tw-template-container h2,
  .tw-template-container h3,
  .tw-template-container h4,
  .tw-template-container .tw-text-3xl,
  .tw-template-container .tw-text-2xl,
  .tw-template-container .tw-text-xl {
    margin-bottom: 0.75rem !important;
    margin-top: 1rem !important;
  }
  
  .tw-template-container h1:first-child,
  .tw-template-container h2:first-child,
  .tw-template-container .tw-text-3xl:first-child,
  .tw-template-container .tw-text-2xl:first-child {
    margin-top: 0 !important;
  }
  
  /* Espaçamento para parágrafos */
  .tw-template-container p {
    margin-bottom: 0.75rem !important;
  }
  
  /* Espaçamento para listas */
  .tw-template-container ul,
  .tw-template-container ol {
    margin-bottom: 1rem !important;
    margin-top: 0.5rem !important;
  }
  
  .tw-template-container li {
    margin-bottom: 0.25rem !important;
  }
  
  /* Espaçamento para tabelas */
  .tw-template-container table {
    margin-bottom: 1rem !important;
    margin-top: 0.5rem !important;
  }
  
  /* Espaçamento para elementos gradientes */
  .tw-template-container .tw-bg-gradient-to-r {
    margin-bottom: 1.5rem !important;
    margin-top: 1rem !important;
  }
  
  /* Espaçamento para grids */
  .tw-template-container .tw-grid {
    margin-bottom: 1rem !important;
  }
  
  .tw-template-container .tw-grid > * {
    margin-bottom: 0.5rem !important;
  }
  
  /* Espaçamento específico para elementos com classes tw-mb-* */
  .tw-template-container .tw-mb-12 {
    margin-bottom: 2rem !important;
  }
  
  .tw-template-container .tw-mb-8 {
    margin-bottom: 1.5rem !important;
  }
  
  .tw-template-container .tw-mb-6 {
    margin-bottom: 1rem !important;
  }
  
  .tw-template-container .tw-mb-4 {
    margin-bottom: 0.75rem !important;
  }
  
  .tw-template-container .tw-mb-3 {
    margin-bottom: 0.5rem !important;
  }
  
  .tw-template-container .tw-mb-2 {
    margin-bottom: 0.375rem !important;
  }
  
  /* Padding interno adequado para containers */
  .tw-template-container .tw-p-8,
  .tw-template-container .tw-p-6,
  .tw-template-container .tw-p-4,
  .tw-template-container .tw-p-3 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  /* Garantir que elementos inline tenham espaçamento */
  .tw-template-container .tw-flex.tw-items-center > * {
    margin-right: 0.5rem !important;
  }
  
  .tw-template-container .tw-flex.tw-items-center > *:last-child {
    margin-right: 0 !important;
  }
}

/* Melhorias para tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .tw-template-container > * {
    margin-bottom: 1.25rem !important;
  }
  
  .tw-template-container .tw-bg-gradient-to-r {
    margin-bottom: 2rem !important;
  }
}
