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


.mapboxgl-ctrl-bottom-right {
  display: none !important;
}

@media (min-width: 640px) {
  .mapboxgl-ctrl-bottom-right {
    min-height: 160px !important;
    display: block !important;
  }
  .mapboxgl-ctrl-attrib {
    font-size: 12px !important;
    line-height: 2;
    letter-spacing: 0px;
  }

  .mapboxgl-ctrl-attrib a {
    font-size: 12px !important;
  }

  .mapboxgl-ctrl-attrib button {
    display: none;
  }

  .mapboxgl-canvas {
    cursor: inherit !important;
  }
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

details > summary {
  list-style: none !important;
}

.placemark-cursor-pointer .mapboxgl-canvas-container {
  cursor: pointer !important;
}

.placemark-cursor-grab .mapboxgl-canvas-container {
  cursor: grab !important;
}

.placemark-cursor-default .mapboxgl-canvas-container {
  cursor: url("/cursors/cursor-default.svg"), auto !important;
}

.placemark-cursor-point .mapboxgl-canvas-container {
  cursor: url("/cursors/cursor-point.svg"), auto !important;
}

.placemark-cursor-crosshair .mapboxgl-canvas-container {
  cursor: crosshair !important;
}

.placemark-cursor-not-allowed .mapboxgl-canvas-container {
  cursor: not-allowed !important;
}

/** SAFARI COMPATIBILITY: it's the only browser
 * that shows the disclosure caret even when you tell
 * it not to */
details summary::-webkit-details-marker {
  display: none;
}

.mapboxgl-canvas:focus,
.mapboxgl-canvas:active {
  outline: none !important;
}

/*
 * Aria components trigger styles that aren't
 * overridden by Tailwind's reset
 */
[type="button"] {
  -webkit-appearance: none;
}

.contain-layout {
  contain: layout;
}

:root {
  --highlight-purple: theme("colors.purple.500");
  --highlight-dark-purple: theme("colors.purple.700");
  --highlight-yellow: theme("colors.yellow.500");
  --highlight-dark-yellow: theme("colors.yellow.500");
  --highlight-gray: theme("colors.gray.300");
  --highlight-dark-gray: theme("colors.gray.500");
  --highlight-light-gray: theme("colors.purple.100");
  --highlight-tooltip-text: theme("colors.black");
  --highlight-background: theme("colors.white");
  --cm-font: theme("fontFamily.mono");
}

.dark {
  --highlight-purple: theme("colors.purple.300");
  --highlight-dark-purple: theme("colors.purple.100");
  --highlight-yellow: theme("colors.yellow.100");
  --highlight-dark-yellow: theme("colors.yellow.300");
  --highlight-gray: theme("colors.gray.300");
  --highlight-dark-gray: theme("colors.gray.500");
  --highlight-light-gray: theme("colors.gray.700");
  --highlight-background: theme("colors.gray.800");
  --highlight-tooltip-text: theme("colors.white");
  --cm-font: theme("fontFamily.mono");
}

.cm-editor.cm-focused {
  outline: none !important;
}

*:focus,
*:active {
  outline: none;
}

/**
 * Codemirror
 */

.properties-tab {
  @apply py-0.5 px-1 text-xs cursor-pointer text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-sm;
}

.properties-tab[data-state="active"] {
  @apply bg-gray-200 hover:bg-gray-200 dark:text-black;
}

[aria-expanded="true"] .aria-expanded\:block {
  display: block;
}

/**
 * react-colorful
 */
.react-colorful {
  width: 230px;
}

.react-colorful__saturation {
  border-radius: 4px 4px 0 0 !important;
}

.react-colorful__last-control {
  border-radius: 0 0 4px 4px !important;
}

.react-colorful__pointer {
  width: 22px !important;
  height: 22px !important;
  border-radius: 2px !important;
}

body.dark .mapboxgl-ctrl-group {
  background-color: theme("colors.gray.800");
  box-shadow: 0 0 0 1px theme("colors.gray.500");
}

body.dark .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E %3C/svg%3E");
}

body.dark .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E %3C/svg%3E");
}

body.dark .mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E %3C/svg%3E");
}

body.dark .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E");
}

body.dark .mapboxgl-ctrl-group button + button {
  border-top: 1px solid #000;
}

body.dark .mapboxgl-ctrl-attrib-button {
  background-color: hsla(0, 0%, 0%, 0.5);
}

.placemark-scrollbar::-webkit-scrollbar-thumb {
  @apply bg-gray-400 dark:bg-gray-100;
  @apply hover:bg-gray-500 hover:dark:bg-white;
}

.placemark-scrollbar::-webkit-scrollbar {
  @apply h-3 w-3;
  @apply bg-gray-100 dark:bg-gray-500;
}

.group-1:hover .group-1-hover\:opacity-100 {
  opacity: 100;
}

.ProseMirror-focused {
  @apply ring-1 ring-gray-500;
}

/* Basic editor styles */
.ProseMirror {
  @apply block w-full
    text-sm
    h-64
    overflow-auto
    p-2
    border
    border-gray-300 dark:border-gray-500 rounded
    dark:bg-gray-800 dark:text-white;

  > * + * {
    margin-top: 0.75em;
  }

  ul,
  ol {
    list-style-type: disc;
    padding: 0 1rem;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-weight: bold;
    line-height: 1.1;
  }

  h1 {
    font-size: 140%;
  }
  h2 {
    font-size: 130%;
  }
  h3 {
    font-size: 120%;
  }
  h4 {
    font-size: 110%;
  }

  code {
    background-color: rgba(#616161, 0.1);
    color: #616161;
  }

  a {
    text-decoration: underline;
    @apply text-purple-700 dark:text-purple-300;
  }

  pre {
    background: #0d0d0d;
    color: #fff;
    @apply font-mono;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;

    code {
      color: inherit;
      padding: 0;
      background: none;
      font-size: 0.8rem;
    }
  }

  img {
    max-width: 100%;
    height: auto;
    &.ProseMirror-selectednode {
      @apply ring-1 ring-purple-500;
    }
  }

  blockquote {
    padding-left: 1rem;
    border-left: 2px solid rgba(#0d0d0d, 0.1);
  }

  hr {
    border: none;
    border-top: 2px solid rgba(#0d0d0d, 0.1);
    margin: 2rem 0;
  }
}

@keyframes slideDownAndFade {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideLeftAndFade {
  from {
    opacity: 0;
    transform: translateX(-2px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRightAndFade {
  from {
    opacity: 0;
    transform: translateX(2px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .placemark-appear {
    animation-duration: 400ms;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
    &[data-state="open"] {
      &[data-side="top"] {
        animation-name: slideDownAndFade;
      }
      &[data-side="right"] {
        animation-name: slideLeftAndFade;
      }
      &[data-side="bottom"] {
        animation-name: slideUpAndFade;
      }
      &[data-side="left"] {
        animation-name: slideRightAndFade;
      }
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .placemark-fadein {
    animation: fadeIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* Basemap thumbnail backgrounds */
.bg-thumbnail-monochrome {
  background-image: url('/images/basemaps/monochrome-thumbnail.png');
  background-size: cover;
}

.bg-thumbnail-satellite {
  background-image: url('/images/basemaps/satellite-thumbnail.png');
  background-size: cover;
}

.bg-thumbnail-outdoors {
  background-image: url('/images/basemaps/outdoors-thumbnail.png');
  background-size: cover;
}

.bg-thumbnail-streets {
  background-image: url('/images/basemaps/streets-thumbnail.png');
  background-size: cover;
}

.logo-text {
  fill: oklch(55.1% 0.027 264.364);
}
