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

@layer utilities {
  .event-caution {
    @apply text-event-caution;
  }

  .event-warning {
    @apply text-event-warning;
  }

  .event-danger {
    @apply text-event-danger;
  }
}

/* Notificaciones Flotantes */
#notifications {
  @apply w-full max-w-sm;
}

.notification {
  @apply transform transition-all duration-500 ease-in-out shadow-lg;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/*

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

*/
.table-container {
    display: grid;
    grid-template-columns: repeat(9, 2fr) 1fr;
    column-gap: 2rem;
    align-items: bottom;
    padding: 1rem;
    border-bottom: none;
}

/* Estilos para marcadores de POI personalizados */
.custom-poi-marker {
  /* Eliminar el fondo por defecto de Leaflet */
  background: none;
  border: none;
}

.marker-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.marker-pin {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #3388ff;
  border: 2px solid white;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.marker-image-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65%;
  height: 65%;
  border-radius: 50%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.marker-image {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

/* Estilos personalizados para scrollbar de floating panels */
.floating-panels-scroll::-webkit-scrollbar {
  height: 8px;
}

.floating-panels-scroll::-webkit-scrollbar-track {
  background: rgba(229, 231, 235, 0.5);
  border-radius: 4px;
}

.floating-panels-scroll::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.8);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.floating-panels-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.9);
}

/* Para Firefox */
.floating-panels-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.8) rgba(229, 231, 235, 0.5);
}

/* Estilos de paginación Pagy con Tailwind CSS */
.pagy-nav {
  @apply flex justify-center space-x-1;
}

.pagy-nav .page {
  @apply inline-flex items-center px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 hover:bg-gray-50 hover:text-gray-700 transition-colors;
}

.pagy-nav .page:first-child {
  @apply rounded-l-md;
}

.pagy-nav .page:last-child {
  @apply rounded-r-md;
}

.pagy-nav .page.prev,
.pagy-nav .page.next {
  @apply text-gray-700;
}

.pagy-nav .page.active {
  @apply bg-blue-600 text-white border-blue-600 hover:bg-blue-700 hover:border-blue-700;
}

.pagy-nav .page.gap {
  @apply text-gray-300 cursor-default hover:bg-white hover:text-gray-300;
}


/* Item seleccionado */
.selectize-control .selectize-input > div.selectize-item-custom {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 6px !important;
  background: #e3f2fd !important;
  border: 1px solid #bbdefb !important;
  border-radius: 3px !important;
  margin: 1px !important;
  height: auto !important;
  line-height: 1 !important;
}

.selectize-control .selectize-input > div.selectize-item-custom .icon-selected {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
}

.selectize-control .selectize-input > div.selectize-item-custom .text-selected {
  font-size: 12px !important;
  line-height: 1 !important;
}

.selectize-dropdown {
  z-index: 999999999 !important;
}
/* Cada opción del dropdown en su propia línea */
.selectize-dropdown .selectize-option-single {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

.selectize-dropdown .selectize-option-single:last-child {
  border-bottom: none !important;
}

.selectize-dropdown .selectize-option-single .icon-option {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

.selectize-dropdown .selectize-option-single .text-option {
  font-size: 14px !important;
  flex: 1 !important;
}

/* Hover effect para las opciones */
.selectize-dropdown .selectize-option-single:hover {
  background-color: #f5f5f5 !important
}

/* Estilos personalizados para tooltips de markers */
.leaflet-tooltip.custom-marker-tooltip {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.375rem !important;
  padding: 0.25rem 0.5rem !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  opacity: 0.95 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Tamaños de tooltip según zoom */
.leaflet-tooltip.custom-marker-tooltip.tooltip-small {
  font-size: 9px !important;
  padding: 0.2rem 0.4rem !important;
}

.leaflet-tooltip.custom-marker-tooltip.tooltip-medium {
  font-size: 11px !important;
  padding: 0.25rem 0.5rem !important;
}

.leaflet-tooltip.custom-marker-tooltip.tooltip-large {
  font-size: 13px !important;
  padding: 0.3rem 0.6rem !important;
}

/* Ocultar la flecha por defecto del tooltip de Leaflet */
.leaflet-tooltip.custom-marker-tooltip::before,
.leaflet-tooltip.custom-marker-tooltip::after {
  display: none !important;
}