/*
  Tooltip 03 — Icon 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);
  --tooltip-hover: oklch(0.96 0 0);
}

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

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

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

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

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

.tooltip03__bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  z-index: 10;
  margin-bottom: 0.625rem;
  display: block;
  width: max-content;
  max-width: 14rem;
  transform: translateX(-50%);
  transform-origin: bottom center;
  border-radius: 0.5rem;
  background-color: var(--tooltip-fg);
  padding: 0.5rem 0.75rem;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.35);
  animation: tooltip03-in 180ms ease-out both;
}

.tooltip03__bubble[hidden] {
  display: none;
}

@keyframes tooltip03-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.85);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
  }
}

.tooltip03__title {
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
  font-weight: 600;
  color: #ffffff;
}

.tooltip03__description {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.7);
}

.tooltip03__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) {
  .tooltip03__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);
}
.tooltip03-layout {
  display: flex;
  min-height: 14rem;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}
.tooltip03-layout__panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid oklch(0.9 0 0);
  border-radius: 1rem;
  background: #ffffff;
  padding: 0.75rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.tooltip03-layout__icon-btn {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: oklch(0.6 0 0);
}
