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

@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;
  }
}

.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);
}
