/*
  Tooltip 01 — Foundational Tooltip — standalone HTML/CSS/JS
  implementation. No build step, no framework, no external dependency:
  copy index.html, this file, and script.js into any project as-is.
*/

:root {
  --tooltip-accent: #39ff14;
  --tooltip-fg: oklch(0.145 0 0);
  --tooltip-muted: oklch(0.5 0 0);
}

.tooltip01 {
  position: relative;
  display: inline-flex;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.tooltip01__trigger {
  display: flex;
  height: 1.25rem;
  width: 1.25rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: none;
  font-family: inherit;
  color: var(--tooltip-muted);
  cursor: pointer;
  outline: none;
  transition: color 150ms ease-out;
}

.tooltip01__trigger svg {
  height: 1rem;
  width: 1rem;
}

.tooltip01__trigger:hover {
  color: var(--tooltip-fg);
}

.tooltip01__trigger:focus-visible {
  outline: 2px solid var(--tooltip-fg);
  outline-offset: 2px;
}

.tooltip01__bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  z-index: 10;
  margin-bottom: 0.625rem;
  width: max-content;
  max-width: 14rem;
  transform: translate(-50%, 0);
  animation: tooltip01-in 150ms ease-out both;
}

.tooltip01__bubble[hidden] {
  display: none;
}

@keyframes tooltip01-in {
  from {
    opacity: 0;
    transform: translate(-50%, 4px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.tooltip01__content {
  display: block;
  border-radius: 0.5rem;
  background-color: var(--tooltip-fg);
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.35;
  font-weight: 500;
  color: #ffffff;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.35);
}

.tooltip01__arrow {
  position: absolute;
  top: 100%;
  left: 50%;
  height: 0.5rem;
  width: 0.5rem;
  transform: translate(-50%, -4px) rotate(45deg);
  background-color: var(--tooltip-fg);
}

@media (prefers-reduced-motion: reduce) {
  .tooltip01__bubble {
    animation: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
.tooltip01-layout {
  display: flex;
  min-height: 13rem;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}
.tooltip01-layout__panel {
  display: flex;
  width: 100%;
  max-width: 28rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid oklch(0.9 0 0);
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.5rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.tooltip01-layout__label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.tooltip01-layout__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: oklch(0.145 0 0);
}
.tooltip01-layout__state {
  font-size: 0.75rem;
  font-weight: 500;
  color: oklch(0.5 0 0);
}
