/* ============================================================
   TEMA.CSS - Estilos customizados do projeto Advances
   ============================================================ */

/* ============================================================
   1. TÍTULO HERO - Páginas Internas
   ============================================================ */

/* Classe para páginas internas - sobrescreve fs-100 para fs-40 no título hero */
/* Aplicar a classe "tp-hero-2-title-wrap-internal" no elemento tp-hero-2-title-wrap */
.tp-hero-2-title-wrap-internal .tp-hero-2-title.fs-100 {
  font-size: 40px !important;
}

/* Alternativa: aplicar a classe "tp-hero-2-title-internal" diretamente no h2 */
.tp-hero-2-title-internal {
  font-size: 40px !important;
}

/* ============================================================
   2. HERO LEFT - Padding Consistente
   ============================================================ */

/* Fix para manter padding-left do tp-hero-2-left consistente durante scroll */
/* Previne que animações de scroll ou recálculos de media queries alterem o alinhamento */
.tp-hero-2-left {
  padding-left: 35px !important;
  will-change: auto !important;
  transform: none !important;
}

/* Garantir que media queries não sobrescrevam o padding em telas maiores */
@media only screen and (min-width: 1600px) and (max-width: 1700px), only screen and (min-width: 1400px) and (max-width: 1599px) {
  .tp-hero-2-left {
    padding-left: 35px !important;
  }
}

@media only screen and (min-width: 1200px) and (max-width: 1399px), only screen and (min-width: 992px) and (max-width: 1199px) {
  .tp-hero-2-left {
    padding-left: 35px !important;
  }
}

/* Manter 0 apenas em mobile conforme necessário */
@media only screen and (min-width: 768px) and (max-width: 991px), only screen and (min-width: 576px) and (max-width: 767px), (max-width: 574.98px) {
  .tp-hero-2-left {
    padding-left: 0 !important;
  }
}

/* ============================================================
   3. HEADER - Logo - Prevenir Flash de Tamanho
   ============================================================ */

/* Garantir que a logo tenha o tamanho correto desde o carregamento
   Previne o flash visual onde a logo aparece grande e depois reduz */
.tp-header-logo img[data-width] {
  width: 150px !important;
  max-width: 150px !important;
  height: auto !important;
}

/* Garantir que o container da logo não cause overflow */
.tp-header-logo {
  max-width: 150px;
  overflow: hidden;
}

.tp-header-logo a {
  display: inline-block;
  max-width: 150px;
}

/* ============================================================
   4. HEADER - Posicionamento Inicial Padronizado
   ============================================================ */

/* Garantir que header-transparent SEM header-sticky seja sempre absolute */
/* Isso previne flash visual ao carregar - header deve começar como absolute */
#header-sticky.header-transparent:not(.header-sticky) {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9 !important;
}

/* Quando JavaScript adiciona header-sticky (scroll > 20), mudar para fixed */
#header-sticky.header-transparent.header-sticky {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 10 !important;
}

/* ============================================================
   4. HEADER - Glassmorphism e Estilos Admin
   ============================================================ */

/* Glassmorphism somente dentro do row do header */
.tp-header-glass-row {
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.65), rgba(148, 163, 184, 0.18));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 15px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  padding: 12px 28px;
  margin-top: 12px;
}

/* Padding lateral para header público em telas <= 1440px */
@media (max-width: 1440px) {
  #header-sticky .container-fluid.container-1524 {
    padding-left: 35px;
    padding-right: 35px;
  }
}

/* Remove fundos sólidos conflitantes */
.tp-header-it-bg,
.tp-header-seo-bg {
  background: transparent !important;
}

/* Header compacto do dashboard */
.tp-admin-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.tp-admin-header-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tp-admin-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
}

.tp-admin-header-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tp-admin-header-user-name {
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
}

.tp-admin-header-user-role {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tp-admin-header-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  margin-left: 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.tp-admin-header-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.9);
  transform: translateY(-1px);
}

.tp-admin-header-logout i {
  font-size: 15px;
}

/* ============================================================
   5. PAINEL ADMIN - Layout e Componentes
   ============================================================ */

/* Layout básico do dashboard admin */
.tp-admin-dashboard {
  position: relative;
}

.tp-admin-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* Sidebar do admin */
.tp-admin-sidebar {
  width: 270px;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.85));
  border-radius: 18px;
  padding: 24px 22px 20px;
  color: #e5e7eb;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.55);
  position: sticky;
  top: 120px;
}

.tp-admin-sidebar-header {
  margin-bottom: 24px;
}

.tp-admin-sidebar-title {
  font-family: var(--tp-ff-teko, "Teko", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 24px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
}

.tp-admin-sidebar-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.75;
}

.tp-admin-sidebar-menu ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.tp-admin-sidebar-menu li + li {
  margin-top: 6px;
}

.tp-admin-sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #e5e7eb;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.tp-admin-sidebar-menu a i {
  font-size: 15px;
}

.tp-admin-sidebar-menu li.active a,
.tp-admin-sidebar-menu a:hover {
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  color: #030712;
  transform: translateY(-1px);
}

.tp-admin-sidebar-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding-top: 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-admin-cta {
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  background: #facc15;
  color: #111827;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.tp-admin-cta:hover {
  background: #eab308;
  box-shadow: 0 10px 30px rgba(234, 179, 8, 0.4);
  transform: translateY(-1px);
}

.tp-admin-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #9ca3af;
  text-decoration: none;
}

.tp-admin-logout:hover {
  color: #f9fafb;
}

/* Conteúdo principal do admin */
.tp-admin-content {
  flex: 1;
  min-width: 0;
}

.tp-admin-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.tp-admin-content-title {
  font-size: 26px;
  margin-bottom: 6px;
}

.tp-admin-content-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.tp-admin-content-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-admin-action-btn {
  padding-inline: 18px;
  padding-block: 8px;
  font-size: 13px;
}

.tp-admin-action-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f9fafb;
  color: #030712;
}

.tp-admin-action-icon i {
  font-size: 15px;
}

/* Cards do admin */
.tp-admin-cards {
  margin-bottom: 32px;
}

.tp-admin-cards .tp-admin-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.tp-admin-card-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.tp-admin-card-value {
  font-size: 26px;
  font-weight: 600;
  color: #020617;
}

.tp-admin-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
}

.tp-admin-card-meta.positive {
  color: #16a34a;
}

.tp-admin-card-meta i {
  font-size: 13px;
}

/* Painéis do admin */
.tp-admin-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 24px 20px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.05);
  height: 100%;
}

.tp-admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tp-admin-panel-header h4 {
  font-size: 16px;
  margin: 0;
}

.tp-admin-select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 13px;
  padding: 6px 10px;
  color: #374151;
  background-color: #ffffff;
}

.tp-admin-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.tp-admin-panel-body {
  font-size: 13px;
}

.tp-admin-chart-placeholder {
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  padding: 26px 16px;
  background: radial-gradient(circle at top left, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.9));
  color: #4b5563;
}

/* Listas do admin */
.tp-admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-admin-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f9fafb;
}

.tp-admin-list li strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.tp-admin-list li span {
  font-size: 12px;
  color: #6b7280;
}

.tp-admin-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  align-self: center;
  white-space: nowrap;
}

.tp-admin-status.success {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.tp-admin-status.warning {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
}

.tp-admin-status.neutral {
  background: rgba(148, 163, 184, 0.18);
  color: #4b5563;
}

/* Tabelas do admin */
.tp-admin-table-wrapper {
  overflow-x: auto;
}

.tp-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tp-admin-table thead {
  background: #f9fafb;
}

.tp-admin-table th,
.tp-admin-table td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

.tp-admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.tp-admin-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.tp-admin-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
}

.tp-admin-status-pill.success {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.tp-admin-status-pill.warning {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
}

.tp-admin-status-pill.neutral {
  background: rgba(148, 163, 184, 0.18);
  color: #4b5563;
}

.tp-admin-list-compact li {
  padding-block: 8px;
}

.tp-admin-capacity {
  font-size: 12px;
  color: #0f172a;
  font-weight: 500;
  white-space: nowrap;
}

.tp-admin-panel-inline-note {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 12px;
  color: #6b7280;
}

.tp-admin-link-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  color: #2563eb;
  cursor: pointer;
  padding: 0;
}

/* ============================================================
   6. PAINEL ADMIN - Componentes Específicos
   ============================================================ */

/* Output de IA */
.tp-admin-ia-output {
  min-height: 160px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  padding: 14px 14px;
  background: #f9fafb;
  font-size: 13px;
  color: #111827;
  white-space: pre-wrap;
}

.tp-admin-ia-output.is-empty {
  color: #9ca3af;
}

.tp-admin-ia-status {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

/* Seções escondidas */
.tp-admin-section-hidden {
  display: none !important;
}

/* Seções de conteúdo - escondidas por padrão */
.tp-admin-view-section {
  display: none;
}

.tp-admin-view-section.active {
  display: block;
}

/* Ajuste de espaçamento quando apenas Propostas IA está visível */
.admin-view-propostas-ia #row-propostas-ia {
  margin-top: 0;
}

/* ============================================================
   7. PAINEL ADMIN - Responsividade
   ============================================================ */

/* Padding lateral para descolar da scrollbar em telas menores que 1440px */
@media (max-width: 1439.98px) {
  /* Containers do admin */
  .tp-admin-dashboard .container-fluid.container-1800,
  .tp-admin-dashboard .container-fluid.container-1524 {
    padding-left: 20px;
    padding-right: 20px;
  }

  .tp-admin-layout {
    padding-left: 0;
    padding-right: 0;
  }

  /* Containers gerais do site */
  .container-fluid.container-1800,
  .container-fluid.container-1524,
  .container-fluid.container-1646 {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 1199.98px) {
  .tp-admin-layout {
    flex-direction: column;
  }

  .tp-admin-sidebar {
    position: static;
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-inline: 18px;
  }

  .tp-admin-sidebar-menu {
    flex: 1;
  }
}

@media (max-width: 767.98px) {
  .tp-admin-sidebar {
    flex-direction: column;
  }

  .tp-admin-sidebar-menu a {
    padding: 7px 8px;
  }

  .tp-admin-content-header {
    align-items: flex-start;
  }
}

/* ============================================================
   8. LOADER - Desabilitar no Admin
   ============================================================ */

/* Esconder loader imediatamente nas páginas do admin */
.loader-wrap {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -9999 !important;
  pointer-events: none !important;
}

/* Desabilitar animações GSAP do loader no admin */
body.no-smooth .loader-wrap,
body.no-smooth .loader-wrap * {
  animation: none !important;
  transition: none !important;
}

/* ============================================================
   9. HERO IMPACT WRAP - Ajuste de Margin
   ============================================================ */

/* Alterar margin-left de -85px para 0px */
.tp-hero-2-impact-wrap {
  margin-left: 0px !important;
}

/* ============================================================
   10. BOTÃO SOLICITAR ORÇAMENTO - Fix Hover Texto Branco
   ============================================================ */

/* Corrigir problema de texto branco invisível no hover */
.tp-btn-border-black.hover-text-white:hover {
  background-color: var(--tp-common-black) !important;
  border-color: var(--tp-common-black) !important;
  color: var(--tp-common-white) !important;
}

/* Garantir que o texto e ícone fiquem brancos no hover */
.tp-btn-border-black.hover-text-white:hover .btn-text,
.tp-btn-border-black.hover-text-white:hover .btn-icon,
.tp-btn-border-black.hover-text-white:hover svg {
  color: var(--tp-common-white) !important;
}

/* ============================================================
       11. OFFCANVAS GALLERY - Proporção das Imagens
       ============================================================ */

/* Garantir que todas as imagens do offcanvas tenham a mesma proporção */
.tp-offcanvas-gallery-img {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1; /* Proporção quadrada */
}

.tp-offcanvas-gallery-img a {
  display: block;
  width: 100%;
  height: 100%;
}

.tp-offcanvas-gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
