@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  .carousel-dot-active   { @apply bg-primary; }
  .carousel-dot-inactive { @apply bg-border hover:bg-muted-foreground; }

  @keyframes campaign-cta-vibrate {
    0%, 88%, 100% {
      transform: translate3d(0, 0, 0);
    }

    90% {
      transform: translate3d(-1px, 0, 0) rotate(-1deg);
    }

    92% {
      transform: translate3d(2px, 0, 0) rotate(1deg);
    }

    94% {
      transform: translate3d(-2px, 0, 0) rotate(-1deg);
    }

    96% {
      transform: translate3d(2px, 0, 0) rotate(1deg);
    }

    98% {
      transform: translate3d(-1px, 0, 0) rotate(0deg);
    }
  }

  .campaign-cta-vibrate {
    animation: campaign-cta-vibrate 5s ease-in-out infinite;
    transform-origin: center;
    will-change: transform;
  }

  @keyframes sidebar-time-savings-toast-gain {
    0% {
      transform: translate3d(0, 4px, 0) scale(0.95);
    }

    55% {
      transform: translate3d(0, -2px, 0) scale(1.05);
    }

    100% {
      transform: translate3d(0, 0, 0) scale(1);
    }
  }

  @keyframes sidebar-time-savings-toast-sparkle {
    0% {
      opacity: 0;
      transform: translate3d(0, 4px, 0) scale(0.8) rotate(-8deg);
    }

    45% {
      opacity: 1;
      transform: translate3d(0, -2px, 0) scale(1.2) rotate(8deg);
    }

    100% {
      opacity: 0.65;
      transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
  }

  .sidebar-time-savings-toast-gain {
    animation: sidebar-time-savings-toast-gain 420ms cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
  }

  .sidebar-time-savings-toast-sparkle {
    opacity: 0.65;
    transform-origin: center;
    will-change: transform, opacity;
  }

  .sidebar-time-savings-toast-sparkle.is-animating {
    animation: sidebar-time-savings-toast-sparkle 520ms cubic-bezier(0.23, 1, 0.32, 1);
  }

  @media (prefers-reduced-motion: reduce) {
    .sidebar-time-savings-toast-gain,
    .sidebar-time-savings-toast-sparkle.is-animating {
      animation: none;
    }
  }

  .app-video-modal-overlay:not(.hidden),
  .supademo-standalone-modal-overlay[data-state="open"] {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  .app-video-modal-container,
  .supademo-standalone-modal-overlay[data-state="open"] .supademo-standalone-modal-container {
    position: relative !important;
    width: min(87.3vw, 1397px) !important;
    height: min(78.5vh, 786px) !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .app-video-modal-iframe,
  .supademo-standalone-modal-overlay[data-state="open"] .supademo-standalone-modal-iframe {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    background: transparent !important;
  }

  .app-video-modal-close,
  .supademo-standalone-modal-overlay[data-state="open"] .supademo-standalone-modal-close {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    z-index: 10000001 !important;
    display: inline-flex !important;
    width: 40px !important;
    height: 40px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 9999px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: rgb(15 23 42) !important;
    font-size: 20px !important;
    line-height: 30px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: background-color 150ms ease, color 150ms ease !important;
  }

  .app-video-modal-close:hover,
  .supademo-standalone-modal-overlay[data-state="open"] .supademo-standalone-modal-close:hover {
    background: rgba(255, 255, 255, 1) !important;
    color: rgb(15 23 42) !important;
  }

  .supademo-standalone-modal-overlay[data-state="closed"] {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: transparent !important;
  }
}

@layer base {
  :root {
    /* === TEMA LIGHT (PADRÃO) - Brand Lab C2S === */

    /* Cores Base */
    --background: 0 0% 100%; /* #ffffff */
    --foreground: 222.2 84% 4.9%; /* #0a0a0b */

    /* Cards e Superfícies */
    --card: 0 0% 100%; /* #ffffff */
    --card-foreground: 222.2 84% 4.9%; /* #0a0a0b */

    --popover: 0 0% 100%; /* #ffffff */
    --popover-foreground: 222.2 84% 4.9%; /* #0a0a0b */

    /* Cores Principais */
    --primary: 214 83% 52%; /* #1F72EA (Brand Blue) */
    --primary-foreground: 210 40% 98%; /* #f9fafb */

    --secondary: 208 100% 95%; /* #E3F2FF */
    --secondary-foreground: 215 79% 21%; /* #0B2D5F (Abyss) */

    /* Muted (Secundário/Desabilitado) */
    --muted: 210 40% 96.1%; /* #f4f6f8 */
    --muted-foreground: 215.4 16.3% 46.9%; /* #6b7280 */
    --placeholder-foreground: 218 11% 65%; /* #9ca3af */

    /* Accent (Destaque/Hover) */
    --accent: 210 40% 96.1%; /* #f4f6f8 */
    --accent-foreground: 222.2 47.4% 11.2%; /* #1a1a1d */

    /* Destrutivo */
    --destructive: 0 84.2% 60.2%; /* #ef4444 */
    --destructive-foreground: 210 40% 98%; /* #f9fafb */

    /* Componentes UI */
    --border: 214.3 31.8% 91.4%; /* #e2e8f0 */
    --input: 214.3 31.8% 91.4%; /* #e2e8f0 */
    --ring: 214 83% 52%; /* #1F72EA */

    /* Sidebar */
    --sidebar-background: 0 0% 98%; /* #fafafa */
    --sidebar-foreground: 240 5.3% 26.1%; /* #3f3f46 */
    --sidebar-primary: 240 5.9% 10%; /* #18181b */
    --sidebar-primary-foreground: 0 0% 98%; /* #fafafa */
    --sidebar-accent: 240 4.8% 95.9%; /* #f4f4f5 */
    --sidebar-accent-foreground: 240 5.9% 10%; /* #18181b */
    --sidebar-border: 220 13% 91%; /* #e4e4e7 */
    --sidebar-ring: 217.2 91.2% 59.8%; /* #3b82f6 */

    /* Portal colors */
    --portal-olx: 270 91% 65%; /* #a855f7 */
    --portal-imovelweb: 217 91% 60%; /* #3b82f6 */
    --portal-chavesnamao: 142 71% 37%; /* #16a34a */

    /* Cores de Alerta - Light Mode */
    --alert-error-title: 0 70% 35%; /* #991b1b */
    --alert-error-text: 0 70% 45%; /* #b91c1c */
    --alert-info-title: 217 91% 35%; /* #0c4a9c */
    --alert-info-text: 217 91% 50%; /* #1e40af */
    --alert-success-title: 142 71% 25%; /* #166534 */
    --alert-success-text: 142 71% 35%; /* #15803d */
    --alert-warning-title: 32 95% 30%; /* #92400e */
    --alert-warning-text: 32 95% 40%; /* #b45309 */

    /* Cores do Banner de Atenção */
    --alert-attention-bg: 54 96% 88%; /* #FEF9C3 */
    --alert-attention-border: 54 96% 63%; /* #FDE047 */
    --alert-attention-text: 38 84% 29%; /* #854D0E */

    /* Table Row Hover */
    --table-row-hover: 214.3 31.8% 94%; /* cinza-azulado claro */
  }

  /* === TEMA DARK - Brand Lab C2S === */
  .dark {
    /* Cores Base */
    --background: 215 79% 8%; /* #081832 (Abyss) */
    --foreground: 215 30% 96%; /* #f2f5fa */

    /* Cards e Superfícies */
    --card: 215 70% 12%; /* #102244 */
    --card-foreground: 215 30% 96%; /* #f2f5fa */

    --popover: 215 70% 12%; /* #102244 */
    --popover-foreground: 215 30% 96%; /* #f2f5fa */

    /* Cores Principais */
    --primary: 214 88% 60%; /* #4A9DF5 (Brand Blue dark) */
    --primary-foreground: 215 79% 8%; /* #081832 */

    --secondary: 215 60% 20%; /* #14335C */
    --secondary-foreground: 215 30% 96%; /* #f2f5fa */

    /* Muted (Secundário/Desabilitado) */
    --muted: 215 50% 16%; /* #142848 */
    --muted-foreground: 215 25% 70%; /* #9ab0d4 */
    --placeholder-foreground: 215 20% 60%; /* #8498b6 */

    /* Accent (Destaque/Hover) */
    --accent: 215 60% 22%; /* #183A66 */
    --accent-foreground: 215 30% 96%; /* #f2f5fa */

    /* Destrutivo */
    --destructive: 0 62.8% 50%; /* #dc2626 */
    --destructive-foreground: 210 40% 98%; /* #f9fafb */

    /* Componentes UI */
    --border: 215 50% 22%; /* #1a3a66 */
    --input: 215 50% 22%; /* #1a3a66 */
    --ring: 214 88% 60%; /* #4A9DF5 */

    /* Sidebar */
    --sidebar-background: 215 79% 6%; /* #061226 */
    --sidebar-foreground: 215 30% 92%; /* #dce6f5 */
    --sidebar-primary: 214 88% 60%; /* #4A9DF5 */
    --sidebar-primary-foreground: 215 79% 8%; /* #081832 */
    --sidebar-accent: 215 60% 14%; /* #0e2544 */
    --sidebar-accent-foreground: 215 30% 96%; /* #f2f5fa */
    --sidebar-border: 215 50% 18%; /* #152e52 */
    --sidebar-ring: 214 88% 60%; /* #4A9DF5 */

    /* Cores de Alerta - Dark Mode */
    --alert-error-title: 0 70% 65%; /* #e57373 */
    --alert-error-text: 0 70% 75%; /* #ef9a9a */
    --alert-info-title: 214 88% 70%; /* #82b8f8 */
    --alert-info-text: 214 88% 80%; /* #b0d4fb */
    --alert-success-title: 142 71% 55%; /* #4ade80 */
    --alert-success-text: 142 71% 65%; /* #6ee7a0 */
    --alert-warning-title: 32 95% 60%; /* #fb923c */
    --alert-warning-text: 32 95% 70%; /* #fca561 */

    /* Cores do Banner de Atenção - Dark Mode */
    --alert-attention-bg: 38 84% 14%; /* #451A03 */
    --alert-attention-border: 32 95% 40%; /* #B45309 */
    --alert-attention-text: 54 96% 65%; /* #FCD34D */

    /* Table Row Hover */
    --table-row-hover: 215 60% 16%; /* azul escuro para hover */
  }
}

@layer components {
  .markdown-content {
    @apply inline-block w-full;
  }

  .markdown-content p {
    @apply m-0 inline;
  }

  .markdown-content ul {
    @apply m-0 inline;
  }

  .markdown-content li {
    @apply inline;
    position: relative;
    padding-left: 1em;
  }

  .markdown-content li:before {
    content: "• ";
    position: absolute;
    left: 0;
  }

  .tooltip-container {
    @apply relative inline-block;
    position: relative;
  }

  .tooltip-content {
    @apply p-4 bg-gray-800 text-white text-sm rounded-lg shadow-xl;
    position: fixed;
    top: auto;
    left: auto;
    transform: none;
    margin-top: 0;
    white-space: normal;
    min-width: 300px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
    word-wrap: break-word;
    z-index: 999999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  }

  .tooltip-content ul {
    @apply list-disc pl-5 mt-1;
    display: block;
  }

  .tooltip-content li {
    @apply block mb-1;
    display: list-item;
  }

  .tooltip-content li:before {
    content: none;
  }

  .tooltip-content p {
    @apply block mb-3;
    display: block;
    line-height: 1.5;
  }

  /* Override markdown-content styles when inside tooltip-content */
  .tooltip-content .markdown-content {
    display: block;
  }

  .tooltip-content .markdown-content p {
    @apply block mb-3;
    display: block;
  }

  .tooltip-content .markdown-content ul {
    @apply list-disc pl-5 mt-1;
    display: block;
  }

  .tooltip-content .markdown-content li {
    @apply block mb-1;
    display: list-item;
    list-style-type: disc;
  }

  .tooltip-content .markdown-content li:before {
    content: none;
  }

  .tooltip-content h1,
  .tooltip-content h2,
  .tooltip-content h3,
  .tooltip-content h4,
  .tooltip-content h5,
  .tooltip-content h6 {
    @apply font-bold mb-2;
    line-height: 1.2;
  }

  .tooltip-content h1 { @apply text-xl; }
  .tooltip-content h2 { @apply text-lg; }
  .tooltip-content h3 { @apply text-base; }

  .tooltip-content a {
    @apply text-blue-300 underline;
  }

  .tooltip-content code {
    @apply bg-gray-700 px-1 rounded;
  }

  .tooltip-content pre {
    @apply bg-gray-700 p-2 rounded mb-3 overflow-x-auto;
  }

  /* Tooltip display is now handled by JavaScript
  .tooltip-container:hover .tooltip-content {
    display: block;
  }
  */

  /*
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
  */

  /* Highlight para cards selecionados no mapa */
  .card-highlighted {
    @apply ring-4 ring-blue-500 ring-opacity-50 shadow-lg;
    transition: all 0.3s ease-in-out;
    background-color: #f0f9ff !important;
  }

  /* Logo C2S padronizado */
  .c2s-logo {
    @apply bg-c2s-blue w-[50px] h-[36px] flex justify-center items-center mx-auto mb-6 text-white font-semibold rounded-lg;
  }

  /* Form components */
  .form-label {
    @apply text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70;
  }

  .form-label-error {
    @apply text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-destructive;
  }

  .form-input {
    @apply flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base text-foreground ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm;
  }

  #property-filters-form .property-filter-placeholder {
    color: hsl(var(--muted-foreground));
  }

  #property-filters-form input::placeholder,
  #property-filters-form textarea::placeholder {
    color: hsl(var(--muted-foreground)) !important;
  }

  #property-filters-form [data-date-field-target="display"][data-property-filter-empty="true"] {
    color: hsl(var(--muted-foreground));
  }

  #property-filters-form [data-date-field-target="display"][data-property-filter-empty="false"] {
    color: hsl(var(--foreground));
  }

  select.form-input {
    color-scheme: light;
  }

  .dark select.form-input {
    color-scheme: dark;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    border-color: hsl(var(--input));
  }

  /* Ensures the native calendar-picker icon renders light-on-dark instead of dark-on-dark */
  input[type="date"] {
    color-scheme: light;
  }

  .dark input[type="date"] {
    color-scheme: dark;
  }

  /* color-scheme alone doesn't repaint the icon in every WebKit build, so force it explicitly */
  .dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
  }

  .form-input:-webkit-autofill,
  .form-input:-webkit-autofill:hover,
  .form-input:-webkit-autofill:focus,
  .form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px hsl(var(--background)) inset !important;
    -webkit-text-fill-color: hsl(var(--foreground)) !important;
    transition: background-color 5000s ease-in-out 0s;
  }

  .form-input-error {
    @apply flex h-10 w-full rounded-md border border-destructive bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm;
  }

  input::placeholder,
  textarea::placeholder {
    color: hsl(var(--placeholder-foreground)) !important;
    opacity: 1;
  }

  [data-owner-selected="true"] [data-international-phone-mask-group] {
    background-color: hsl(var(--background)) !important;
    border-color: hsl(var(--input)) !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
  }

  [data-owner-selected="true"] [data-international-phone-mask-group] input {
    color: hsl(var(--foreground)) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
  }

  [data-international-phone-mask-group] input::placeholder {
    color: hsl(var(--placeholder-foreground)) !important;
    opacity: 1;
  }

  [data-owner-selected="true"] [data-international-phone-mask-trigger] {
    background-color: hsl(var(--background)) !important;
    border-color: hsl(var(--input)) !important;
    color: hsl(var(--foreground)) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
  }

  [data-owner-selected="true"] [data-owner-autocomplete-target~="exclusiveOwnerAssignment"] {
    display: none !important;
  }

  [data-international-phone-mask-locked-value="true"] [data-international-phone-mask-group] {
    background-color: hsl(var(--background)) !important;
    border-color: hsl(var(--input)) !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
  }

  [data-international-phone-mask-locked-value="true"] [data-international-phone-mask-group] input {
    color: hsl(var(--foreground)) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
  }

  [data-international-phone-mask-locked-value="true"] [data-international-phone-mask-trigger] {
    background-color: hsl(var(--background)) !important;
    border-color: hsl(var(--input)) !important;
    color: hsl(var(--foreground)) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
  }

  .form-input-error:-webkit-autofill,
  .form-input-error:-webkit-autofill:hover,
  .form-input-error:-webkit-autofill:focus,
  .form-input-error:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px hsl(var(--background)) inset !important;
    -webkit-text-fill-color: hsl(var(--foreground)) !important;
    transition: background-color 5000s ease-in-out 0s;
  }

  .form-textarea {
    @apply flex min-h-[80px] mt-2 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50;
  }

  .form-radio-btn {
    @apply aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50;
  }

  /* Radio button customizado - preenchido 100% quando selecionado */
  /* REMOVER COMPLETAMENTE TODOS OS EFEITOS DE HOVER */
  input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    opacity: 1 !important;
    background-color: white !important;
    pointer-events: auto !important;
  }

  /* Estado checked - sempre primary */
  input[type="radio"]:checked {
    background-color: hsl(var(--primary)) !important;
    border-color: hsl(var(--primary)) !important;
    background-image: none !important;
    opacity: 1 !important;
  }

  /* Remover focus visual */
  input[type="radio"]:focus,
  input[type="radio"]:focus-visible,
  input[type="radio"]:focus-within {
    outline: none !important;
    box-shadow: none !important;
    ring: 0 !important;
    opacity: 1 !important;
  }

  /* FORÇAR: Quando NÃO está checked, NENHUM efeito de hover/active/focus */
  input[type="radio"]:not(:checked):hover,
  input[type="radio"]:not(:checked):active,
  input[type="radio"]:not(:checked):focus,
  input[type="radio"]:not(:checked):focus:hover,
  input[type="radio"]:not(:checked):active:hover,
  input[type="radio"]:not(:checked):focus:active,
  label:hover input[type="radio"]:not(:checked),
  label:active input[type="radio"]:not(:checked) {
    opacity: 1 !important;
    background-color: white !important;
    border-color: rgb(209 213 219) !important;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
  }

  /* FORÇAR: Quando está checked, manter primary em TODOS os estados */
  input[type="radio"]:checked:hover,
  input[type="radio"]:checked:active,
  input[type="radio"]:checked:focus,
  input[type="radio"]:checked:focus:hover,
  input[type="radio"]:checked:active:hover,
  input[type="radio"]:checked:focus:active,
  label:hover input[type="radio"]:checked,
  label:active input[type="radio"]:checked {
    background-color: hsl(var(--primary)) !important;
    border-color: hsl(var(--primary)) !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
  }

  /* Remover hover do label */
  input[type="radio"] + label:hover,
  input[type="radio"]:hover + label,
  label:has(input[type="radio"]):hover {
    color: inherit !important;
    opacity: 1 !important;
    background-color: transparent !important;
  }

  /* Checkbox customizado - checked na cor primary */
  input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
  }

  input[type="checkbox"]:checked {
    background-color: hsl(var(--primary)) !important;
    border-color: hsl(var(--primary)) !important;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e") !important;
  }

  input[type="checkbox"]:focus,
  input[type="checkbox"]:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1) !important;
    ring-color: hsl(var(--primary)) !important;
  }

  .form-field {
    @apply space-y-2;
  }

  .form-group {
    @apply space-y-4 max-w-md;
  }

  /* Action buttons */
  .action-button {
    @apply justify-center whitespace-nowrap rounded-md text-sm font-medium;
    @apply ring-offset-background transition-colors;
    @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
    @apply disabled:pointer-events-none disabled:opacity-50;
    @apply [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0;
    @apply bg-primary text-primary-foreground hover:bg-primary/90;
    @apply h-10 px-4 py-2;
    @apply flex items-center gap-2;
  }

  .action-button-secondary {
    @apply justify-center whitespace-nowrap rounded-md text-sm font-medium;
    @apply ring-offset-background transition-colors;
    @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
    @apply disabled:pointer-events-none disabled:opacity-50;
    @apply [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0;
    @apply h-10 px-4 py-2;
    @apply flex items-center gap-2;
    /* Botão selecionado: azul com fundo branco e borda grossa */
    background-color: #fff !important;
    border: 2px solid hsl(var(--primary)) !important;
    color: hsl(var(--primary)) !important;
  }

  .action-button-secondary:hover {
    background-color: #fff !important;
  }

  .action-button-secondary svg {
    stroke: hsl(var(--primary)) !important;
  }

  .action-button-destructive {
    @apply justify-center whitespace-nowrap rounded-md text-sm font-medium;
    @apply ring-offset-background transition-colors;
    @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
    @apply disabled:pointer-events-none disabled:opacity-50;
    @apply [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0;
    @apply bg-destructive text-destructive-foreground hover:bg-destructive/90;
    @apply h-10 px-4 py-2;
    @apply flex items-center gap-2;
  }

  .secondary-button {
    @apply justify-center whitespace-nowrap text-foreground rounded-md text-sm font-medium;
    @apply ring-offset-background transition-colors;
    @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
    @apply disabled:pointer-events-none disabled:opacity-50;
    @apply [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0;
    @apply border border-input bg-card hover:bg-accent;
    @apply h-10 px-4 py-2;
    @apply flex items-center gap-2;
  }

  .secondary-brand-button {
    @apply justify-center whitespace-nowrap rounded-md text-sm font-medium;
    @apply ring-offset-background transition-colors;
    @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2;
    @apply disabled:pointer-events-none disabled:opacity-50;
    @apply [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0;
    @apply border border-primary/25 bg-primary/10 text-primary hover:bg-primary/20;
    @apply h-10 px-4 py-2;
    @apply flex items-center gap-2;
  }

  .copy-feedback-active {
    @apply border-green-600 bg-green-600 text-white shadow-sm ring-2 ring-green-600/20;
  }

   .tertiary-button {
        @apply justify-center whitespace-nowrap rounded-md text-sm font-medium;
        @apply ring-offset-background transition-colors;
        @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
        @apply disabled:pointer-events-none disabled:opacity-50;
        @apply [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0;
        @apply bg-secondary text-secondary-foreground hover:bg-secondary/80;
        @apply h-10 px-4 py-2;
        @apply flex items-center gap-2;
   }

  /* ============================================
     BOTÕES SHADCN/UI STYLE
     Componentes modulares com variantes e tamanhos
     ============================================ */

  /* Classe base para todos os botões */
  .btn {
    @apply inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium;
    @apply ring-offset-background transition-colors;
    @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
    @apply disabled:pointer-events-none disabled:opacity-50;
    @apply [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0;
  }

  /* VARIANTES DE COR */
  .btn-primary {
    @apply bg-primary text-primary-foreground hover:bg-primary/90;
  }

  .btn-secondary {
    @apply bg-secondary text-secondary-foreground hover:bg-secondary/80;
  }

  .btn-success {
    @apply bg-success text-success-foreground hover:bg-success/90;
  }

  .btn-warning {
    @apply bg-warning text-warning-foreground hover:bg-warning/90;
  }

  .btn-destructive {
    @apply bg-destructive text-destructive-foreground hover:bg-destructive/90;
  }

  .btn-info {
    @apply bg-info text-info-foreground hover:bg-info/90;
  }

  .btn-outline {
    @apply border border-input bg-background hover:bg-[#EFF4F9] hover:text-accent-foreground;
  }

  .btn-ghost {
    @apply hover:bg-[#EFF4F9] text-foreground hover:text-accent-foreground;
  }

  .btn-link {
    @apply text-primary underline-offset-4 hover:underline;
  }

  /* TAMANHOS */
  .btn-sm {
    @apply h-9 rounded-md px-3 text-xs;
  }

  .btn-md {
    @apply h-10 px-4 py-2 text-sm;
  }

  .btn-lg {
    @apply h-11 rounded-md px-8 text-base;
  }

  /* ÍCONES */
  .btn-icon {
    @apply flex items-center justify-center h-9 w-9 rounded-md;
  }

  .btn-icon-left svg,
  .btn-icon-left i {
    @apply mr-2 h-4 w-4;
  }

  .btn-icon-right svg,
  .btn-icon-right i {
    @apply ml-2 h-4 w-4;
  }

  /* Variações de ícones apenas (botão quadrado) */
  .btn-icon-sm {
    @apply h-8 w-8;
  }

  .btn-icon-md {
    @apply h-9 w-9;
  }

  .btn-icon-lg {
    @apply h-10 w-10;
  }

  /* Container with border and shadow */
  .divider {
    @apply rounded-lg border border-muted bg-card text-card-foreground shadow-sm overflow-hidden;
  }

  /* Variant for sections with dropdowns - allows dropdown menu to overflow */
  .divider-with-dropdown {
    @apply rounded-lg border border-muted bg-card text-card-foreground shadow-sm;
    overflow: visible !important;
  }

  /* ============================================
     BADGES
     Componentes de etiquetas com variantes de cor
     ============================================ */

  /* Badge base */
  .badge {
    @apply inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors
      focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2;
  }

  /* Variações de cor de feedback/status */
  .badge-default {
    @apply border-transparent bg-primary text-primary-foreground hover:bg-primary/80;
  }

  .badge-secondary {
    @apply border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80;
  }

  .badge-success {
    @apply border-transparent bg-success text-success-foreground hover:bg-success/80;
  }

  .badge-warning {
    @apply border-transparent bg-warning text-warning-foreground hover:bg-warning/80;
  }

  .badge-destructive {
    @apply border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80;
  }

  .badge-info {
    @apply border-transparent bg-info text-info-foreground hover:bg-info/80;
  }

  .badge-outline {
    @apply text-foreground border;
  }

  /* Variações de portais */
  .badge-grupoolx {
    @apply border-transparent bg-grupoolx text-white hover:opacity-80;
  }

  .badge-imovelweb {
    @apply border-transparent bg-imovelweb text-white hover:opacity-80;
  }

  .badge-chavesnamao {
    @apply border-transparent bg-chavesnamao text-white hover:opacity-80;
  }

  /* ============================================
     SWITCH (TOGGLE)
     Componente de alternância on/off
     ============================================ */

  /* Container do switch */
  .switch {
    @apply inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors;
    @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background;
    @apply disabled:cursor-not-allowed disabled:opacity-50;
  }

  /* Estados do switch */
  .switch[data-state="checked"] {
    @apply bg-primary;
  }

  .switch[data-state="unchecked"] {
    @apply bg-input;
  }

  /* Thumb (bolinha interna do switch) */
  .switch-thumb {
    @apply pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform;
  }

  /* Estados do thumb */
  .switch[data-state="checked"] .switch-thumb {
    @apply translate-x-5;
  }

  .switch[data-state="unchecked"] .switch-thumb {
    @apply translate-x-0;
  }
}

.custom-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.custom-scroll::-webkit-scrollbar {
  width: 0.50rem !important;
  height: 0.37rem !important;
}

.custom-scroll::-webkit-scrollbar-thumb {
  border-radius: 0.2187rem;
  background-color: rgba(0, 0, 0, 0.3);
}

.custom-scroll::-webkit-scrollbar-track {
  background: hsla(0, 0%, 100%, 0.1);
}

/* ============================================
   ANIMATIONS
   Animações personalizadas
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@import "actiontext.css";

/* Trix Content Styles - Direct inclusion for public website */
.trix-content h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  color: #111827;
}

.trix-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: #1f2937;
}

.trix-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  color: #374151;
}

.trix-content .rich-description-heading {
  display: block;
  color: #1f2937;
  line-height: 1.25;
}

.trix-content .rich-description-heading--primary {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.trix-content .rich-description-heading--secondary {
  font-size: 1.25rem;
  font-weight: 650;
  margin-top: 0.875rem;
  margin-bottom: 0.75rem;
}

.trix-content .rich-description-heading--tertiary {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.625rem;
  color: #374151;
}

.trix-content p {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #4b5563;
  line-height: 1.625;
}

.trix-content strong {
  font-weight: 700;
  color: #111827;
}

.trix-content em {
  font-style: italic;
}

.trix-content ul {
  list-style-type: disc;
  list-style-position: inside;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.trix-content ul li {
  margin-top: 0.25rem;
}

.trix-content ol {
  list-style-type: decimal;
  list-style-position: inside;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.trix-content ol li {
  margin-top: 0.25rem;
}

/* Override Tailwind reset for blockquote */
.trix-content blockquote,
div.trix-content blockquote,
[class*="trix-content"] blockquote {
  display: block !important;
  border-left: 4px solid #3b82f6 !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  margin-left: 0.3rem !important;
  margin-right: 0 !important;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
  color: #4b5563 !important;
  font-style: italic !important;
  background-color: #f0f9ff !important;
  border-radius: 0.375rem !important;
  quotes: "\201C""\201D""\2018""\2019";
}

.trix-content blockquote::before {
  content: open-quote;
  font-size: 2rem;
  line-height: 0.1rem;
  margin-right: 0.25rem;
  vertical-align: -0.4rem;
  color: #3b82f6;
  font-weight: bold;
}

.trix-content blockquote p {
  display: inline;
  margin: 0 !important;
}

.trix-content a {
  color: #2563eb;
  text-decoration: underline;
}

.trix-content a:hover {
  color: #1e40af;
}

.trix-content pre {
  background-color: #f3f4f6;
  border-radius: 0.375rem;
  padding: 1rem;
  overflow-x: auto;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.trix-content del {
  text-decoration: line-through;
  color: #9ca3af;
}

/* Trix toolbar dark mode */
.dark trix-toolbar .trix-button--icon::before {
  filter: invert(1);
}

.dark trix-toolbar .trix-button {
  color: hsl(var(--foreground) / 0.7);
  border-bottom-color: hsl(var(--border));
}

.dark trix-toolbar .trix-button:not(:first-child) {
  border-left-color: hsl(var(--border));
}

.dark trix-toolbar .trix-button-group {
  border-color: hsl(var(--border));
}

.dark trix-toolbar .trix-button--icon-heading-1::before,
.dark trix-toolbar .trix-button--icon-heading-2::before,
.dark trix-toolbar .trix-button--icon-heading-3::before {
  color: hsl(var(--foreground));
  filter: none;
}

.dark trix-toolbar .trix-button.trix-active {
  background: hsl(var(--primary) / 0.2);
  color: hsl(var(--foreground));
}

.dark trix-toolbar .trix-button--icon.trix-active::before {
  filter: invert(1);
}

.dark trix-editor {
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
}

@layer utilities {
  .overflow-x-clip {
    overflow-x: clip;
  }
}

