/* Estilos base para integração Omie */
.omie-integration {
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Container principal com scroll */
.omie-main-container {
  height: calc(100vh - 60px); /* Ajustar baseado na altura do header do Concord */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  scroll-behavior: smooth;
}

/* Cards com altura controlada */
.omie-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

/* Área de conteúdo scrollável */
.omie-content-area {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Tabelas com scroll horizontal quando necessário */
.omie-table-container {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling em dispositivos iOS */
}

.omie-table-container table {
  min-width: 800px; /* Largura mínima para tabelas */
}

/* Formulários com scroll */
.omie-form-container {
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px; /* Espaço para a scrollbar */
}

/* Personalizar scrollbar */
.omie-integration ::-webkit-scrollbar,
.omie-content-area ::-webkit-scrollbar,
.omie-form-container ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.omie-integration ::-webkit-scrollbar-track,
.omie-content-area ::-webkit-scrollbar-track,
.omie-form-container ::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.omie-integration ::-webkit-scrollbar-thumb,
.omie-content-area ::-webkit-scrollbar-thumb,
.omie-form-container ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.omie-integration ::-webkit-scrollbar-thumb:hover,
.omie-content-area ::-webkit-scrollbar-thumb:hover,
.omie-form-container ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modal com scroll interno */
.omie-modal-content {
  max-height: 80vh;
  overflow-y: auto;
}

/* Lista de histórico com scroll */
.omie-history-list {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

/* Área de mapeamento com scroll */
.omie-mapping-area {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
}

/* Seções de configuração */
.omie-config-section {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.omie-config-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Inputs e selects */
.omie-input,
.omie-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: border-color 0.15s ease-in-out;
}

.omie-input:focus,
.omie-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Labels */
.omie-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Botões */
.omie-button-primary {
  background-color: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.omie-button-primary:hover:not(:disabled) {
  background-color: #2563eb;
}

.omie-button-primary:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.omie-button-secondary {
  background-color: white;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.omie-button-secondary:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.omie-button-secondary:disabled {
  background-color: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Estados de status */
.omie-status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.omie-status-running {
  background-color: #dbeafe;
  color: #1e40af;
}

.omie-status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.omie-status-failed {
  background-color: #fee2e2;
  color: #991b1b;
}

.omie-status-cancelled {
  background-color: #f3f4f6;
  color: #4b5563;
}

/* Progress bar */
.omie-progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.omie-progress-fill {
  height: 100%;
  background-color: #3b82f6;
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
}

/* Utility classes */
.omie-mb-6 {
  margin-bottom: 1.5rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .omie-main-container {
    height: calc(100vh - 80px); /* Altura ajustada para mobile */
    padding: 0.5rem;
  }
  
  .omie-content-area {
    max-height: calc(100vh - 150px);
  }
  
  .omie-form-container {
    max-height: calc(100vh - 200px);
  }
  
  .omie-mapping-area {
    max-height: calc(100vh - 250px);
  }
  
  .omie-history-list {
    max-height: 50vh;
  }
  
  .omie-table-container {
    font-size: 0.875rem;
  }
}

/* Scroll suave em toda a aplicação */
* {
  scroll-behavior: smooth;
}

/* Loading states */
.omie-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.omie-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Sticky elements */
.omie-sticky-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem;
  margin-bottom: 1rem;
}

.omie-sticky-actions {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 1rem;
  margin-top: 1rem;
  z-index: 10;
}

/* Grid responsivo para mapeamentos */
.omie-mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .omie-mapping-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Highlight para campos obrigatórios */
.omie-required-field {
  border-left: 4px solid #ef4444;
  padding-left: 1rem;
}

/* Transições suaves */
.omie-transition {
  transition: all 0.2s ease-in-out;
}

/* Estados de hover */
.omie-hover-bg:hover {
  background-color: #f9fafb;
}

/* Sombras */
.omie-shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.omie-shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Bordas arredondadas */
.omie-rounded {
  border-radius: 0.375rem;
}

.omie-rounded-lg {
  border-radius: 0.5rem;
}

/* Cores de fundo */
.omie-bg-gray-50 {
  background-color: #f9fafb;
}

.omie-bg-blue-50 {
  background-color: #eff6ff;
}

/* Fix para overflow em containers flexbox */
.omie-flex-container {
  display: flex;
  min-height: 0; /* Importante para scroll em flex containers */
}

.omie-flex-item {
  flex: 1;
  min-height: 0; /* Importante para scroll em flex items */
}

/* Melhorar aparência das abas */
.omie-tab-container {
  border-bottom: 1px solid #e5e7eb;
  background: white;
  position: sticky;
  top: 0;
  z-index: 20;
}

.omie-tab-content {
  padding: 1.5rem 0;
}