/* public/styles.css */
/* Estilos Customizados para o Painel Meta Ads & Wiapy */

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --bg-dark: #0b0f19;
  --card-bg: #1e293b;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0b0f19;
  color: #f1f5f9;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ==================== FUNIL VISUAL COM FAIXAS ESTREITAS ==================== */
.visual-funnel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 1rem 0;
}

.funnel-band {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0.85rem;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.4);
  margin: 0 auto;
}

.funnel-band:hover {
  transform: translateY(-2px) scale(1.01);
}

/* Conectores / Setas de fluxo entre as faixas do funil */
.funnel-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  margin: -0.35rem 0;
  z-index: 10;
}

/* Tabela de Campanhas: Rolagem Horizontal e Colunas Fixas (Sticky) */
.table-scroll-container {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.metrics-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.metrics-table th,
.metrics-table td {
  white-space: nowrap;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #1e293b;
  font-size: 0.875rem;
}

.metrics-table th[data-col="last_record"],
.metrics-table td[data-col="last_record"] {
  min-width: 245px;
  white-space: normal;
}

.history-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  font-size: 11px;
  line-height: 1.35;
  color: #e2e8f0;
}

.history-summary:hover,
.history-empty:hover { color: #93c5fd; }
.history-separator { color: #64748b; }
.history-after { color: #6ee7b7; font-weight: 700; }
.history-date { color: #94a3b8; }
.history-empty { color: #93c5fd; text-decoration: underline; }

/* Primeira coluna fixa: Nome da Campanha */
.metrics-table .sticky-col-1 {
  position: sticky;
  left: 0;
  z-index: 20;
  background-color: #111827;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.4);
}

/* Segunda coluna fixa: Status */
.metrics-table .sticky-col-2 {
  position: sticky;
  left: 200px;
  z-index: 19;
  background-color: #111827;
  min-width: 110px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .metrics-table .sticky-col-1 {
    min-width: 160px;
    max-width: 180px;
  }
  .metrics-table .sticky-col-2 {
    left: 160px;
    min-width: 95px;
  }
}

.metrics-table thead th.sticky-col-1,
.metrics-table thead th.sticky-col-2 {
  z-index: 30;
  background-color: #1e293b;
}

.metrics-table tbody tr:hover td {
  background-color: #1e293b;
}
.metrics-table tbody tr:hover .sticky-col-1,
.metrics-table tbody tr:hover .sticky-col-2 {
  background-color: #1f2a3f;
}

/* Glassmorphism & Cards */
.glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

/* Animações e Transições */
.fade-in {
  animation: fadeIn 0.25s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modais */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
