/*
* demo.css
* Refatorado para Alta Performance, Acessibilidade e Manutenibilidade
******************************************************************************/

:root {
  /* Curva de animação premium (Snappy) */
  --tile-transition-speed: 0.25s;
  --tile-ease-snappy: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ====== TILE PRO - BASE ====== */
.tile-pro {
  --tile-radius: var(--bs-card-border-radius, 0.7rem);
  --tile-bg: var(--bs-card-bg, #fff);
  --tile-shadow: var(--bs-card-box-shadow, 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05));

  display: flex;
  align-items: center;
  gap: 0.75rem; /* ~12px */
  padding: 1rem 1.125rem; /* ~16px 18px */
  border: none;
  border-radius: var(--tile-radius);
  background: var(--tile-bg);
  box-shadow: var(--tile-shadow);
  text-decoration: none;
  color: var(--bs-body-color);
  position: relative;
  overflow: hidden;
  
  /* Animação otimizada: apenas as propriedades que realmente mudam */
  transition: 
    transform var(--tile-transition-speed) var(--tile-ease-snappy), 
    box-shadow var(--tile-transition-speed) var(--tile-ease-snappy), 
    background-color var(--tile-transition-speed) var(--tile-ease-snappy);
}

/* Foco para Acessibilidade (A11y) - Navegação por teclado */
.tile-pro:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 3px;
}

.tile-pro:hover {
  box-shadow: var(--bs-card-hover-box-shadow, 0 0.5rem 1.25rem rgba(0, 0, 0, 0.08));
  transform: translateY(-2px);
}

.tile-pro:active {
  transform: translateY(-1px);
}

/* ====== ÍCONE ====== */
.tile-pro .tile-icon {
  display: grid;
  place-items: center;
  width: 2.75rem; /* ~44px */
  height: 2.75rem; /* ~44px */
  border-radius: 0.75rem; /* ~12px */
  color: var(--bs-primary);
  flex: 0 0 auto;
}

.tile-pro .tile-icon i {
  font-size: 1.375rem; /* ~22px */
  line-height: 1;
}

/* ====== TÍTULO (2 LINHAS, CORTE LIMPO) ====== */
.tile-pro .tile-title {
  min-width: 0;
  max-width: 100%;
  display: -webkit-box; /* Requisito obrigatório para o line-clamp funcionar */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ====== SETA COM HOVER ====== */
.tile-pro .tile-arrow {
  color: var(--bs-secondary-color);
  transition: 
    transform var(--tile-transition-speed) var(--tile-ease-snappy), 
    color var(--tile-transition-speed) var(--tile-ease-snappy);
}

.tile-pro:hover .tile-arrow {
  transform: translateX(4px);
  color: var(--bs-primary);
}

/* ====== VARIAÇÃO COMPACTA ====== */
@media (max-width: 991.98px) {
  .tile-pro {
    padding: 0.875rem 1rem; /* ~14px 16px */
  }

  .tile-pro .tile-icon {
    width: 2.5rem; /* ~40px */
    height: 2.5rem; /* ~40px */
  }
}

.tile-title-sm {
  font-size: 0.85rem;
  line-height: 1.2;
}

/* ====== BORDA-SHADOW (ESTILO VUEXY COM ::after) ====== */
.tile-pro[class*="tile-border-shadow-"] {
  position: relative;
  border-bottom: none;
  z-index: 1;
}

.tile-pro[class*="tile-border-shadow-"]::after {
  content: "";
  position: absolute;
  inset: 0; /* Substitui top/right/bottom/left 0 */
  border-bottom: 2px solid transparent;
  border-radius: inherit; /* Herda o var(--tile-radius) do elemento pai */
  z-index: -1;
  pointer-events: none; /* Previne bloqueio de interações/cliques do mouse */
  
  /* Transições exatas em vez do pesado 'transition: all' */
  transition: 
    border-bottom-width var(--tile-transition-speed) var(--tile-ease-snappy),
    border-color var(--tile-transition-speed) var(--tile-ease-snappy);
}

.tile-pro[class*="tile-border-shadow-"]:hover {
  box-shadow: 0 0.25rem 1rem rgba(165, 163, 174, 0.45);
}

.tile-pro[class*="tile-border-shadow-"]:hover::after {
  border-bottom-width: 3px;
}

/* ====== VARIAÇÕES DE COR ====== */
.tile-border-shadow-primary::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-primary));
}
.tile-border-shadow-primary:hover::after {
  border-bottom-color: var(--bs-primary);
}

.tile-border-shadow-secondary::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-secondary));
}
.tile-border-shadow-secondary:hover::after {
  border-bottom-color: var(--bs-secondary);
}

.tile-border-shadow-success::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-success));
}
.tile-border-shadow-success:hover::after {
  border-bottom-color: var(--bs-success);
}

.tile-border-shadow-info::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-info));
}
.tile-border-shadow-info:hover::after {
  border-bottom-color: var(--bs-info);
}

.tile-border-shadow-warning::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-warning));
}
.tile-border-shadow-warning:hover::after {
  border-bottom-color: var(--bs-warning);
}

.tile-border-shadow-danger::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-danger));
}
.tile-border-shadow-danger:hover::after {
  border-bottom-color: var(--bs-danger);
}

.tile-border-shadow-light::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-light));
}
.tile-border-shadow-light:hover::after {
  border-bottom-color: var(--bs-light);
}

.tile-border-shadow-dark::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-dark));
}
.tile-border-shadow-dark:hover::after {
  border-bottom-color: var(--bs-dark);
}

.tile-border-shadow-gray::after {
  border-bottom-color: color-mix(in sRGB, var(--bs-body-bg) var(--bs-border-subtle-amount, 80%), var(--bs-gray, #6c757d));
}
.tile-border-shadow-gray:hover::after {
  border-bottom-color: var(--bs-gray, #6c757d);
}

/*
* Configurações de Layout e Navbar
******************************************************************************/

.light-style .menu .app-brand.demo,
.dark-style .menu .app-brand.demo {
  height: 90px;
}

.app-brand-logo.demo {
  /* Limpeza de prefixos legados (-ms-) */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
}

.app-brand-logo.demo svg {
  width: 35px;
  height: 24px;
}

.app-brand-text.demo {
  font-size: 1rem;
}

/* Navbar page z-index issue solution e ajustes de padding usando propriedades lógicas */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-block-start: 64px !important; /* Lógico: adapta-se a RTL/LTR automaticamente */
}

.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-block-start: 78px !important;
}

.content-wrapper .navbar {
  z-index: auto;
}

/*
* Utilities / Demos 
* (Refatorado para Propriedades Lógicas, eliminando a classe fixa .rtl-only)
******************************************************************************/

.demo-blocks > * {
  display: block !important;
}

.demo-inline-spacing > * {
  /* margin-inline-end inverte sozinho se o documento for dir="rtl" */
  margin-block-start: 1rem !important;
  margin-inline-end: 0.375rem !important;
  margin-block-end: 0 !important;
}

.demo-vertical-spacing > * {
  margin-block-start: 1rem !important;
  margin-block-end: 0 !important;
}

.demo-vertical-spacing.demo-only-element > :first-child {
  margin-block-start: 0 !important;
}

.demo-vertical-spacing-lg > * {
  margin-block-start: 1.875rem !important;
  margin-block-end: 0 !important;
}

.demo-vertical-spacing-lg.demo-only-element > :first-child {
  margin-block-start: 0 !important;
}

.demo-vertical-spacing-xl > * {
  margin-block-start: 5rem !important;
  margin-block-end: 0 !important;
}

.demo-vertical-spacing-xl.demo-only-element > :first-child {
  margin-block-start: 0 !important;
}

/* Dropdown buttons going out of small screens */
@media (max-width: 576px) {
  #dropdown-variation-demo .btn-group .text-truncate {
    width: 254px;
    position: relative;
  }

  #dropdown-variation-demo .btn-group .text-truncate::after {
    position: absolute;
    top: 45%;
    inset-inline-end: 0.65rem; /* Substitui 'right' para suporte bidirecional automático */
  }
}

/*
* Layout demo
******************************************************************************/

.layout-demo-wrapper {
  display: flex; /* Removido flex legados */
  align-items: center;
  flex-direction: column;
  margin-block-start: 1rem;
}

.layout-demo-placeholder img {
  width: 900px;
  max-width: 100%; /* Previne transbordo em telas menores */
}

.layout-demo-info {
  text-align: center;
  margin-block-start: 1rem;
}

/*
* Estilos extras de Botões
******************************************************************************/

.btn-icon.no-fill {
  transition: 
    background-color var(--tile-transition-speed) ease,
    color var(--tile-transition-speed) ease,
    border-color var(--tile-transition-speed) ease;
}

/* Hover e Focus amarrados para Acessibilidade */
.btn-icon.no-fill:hover,
.btn-icon.no-fill:focus-visible {
  background-color: transparent !important;
  color: #184ca5 !important;
  border-color: #184ca5 !important;
}