/**
 * Tooltip above bottom arrow - desktop only
 * Floating panel design with triangle pointing at target
 */

.tooltip-bottom {
  position: fixed;
  z-index: 45;
  width: 28rem;
  max-width: calc(100vw - 2rem);
  padding: 0;
  background: rgba(230, 235, 241, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: visible;
  pointer-events: auto;
  --tooltip-bg: rgba(230, 235, 241, 0.95);
  --tooltip-border: rgba(255, 255, 255, 0.5);
}

html.dark .tooltip-bottom {
  background: rgba(28, 38, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --tooltip-bg: rgba(28, 38, 45, 0.95);
  --tooltip-border: rgba(255, 255, 255, 0.08);
}

@media (max-width: 767px) {
  .tooltip-bottom {
    display: none !important;
  }
}

.tooltip-bottom.tooltip-bottom-visible {
  display: flex;
}

.tooltip-bottom-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.tooltip-bottom-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #334155;
}

html.dark .tooltip-bottom-title {
  color: #f1f5f9;
}

.tooltip-bottom-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tooltip-bottom-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #334155;
}

html.dark .tooltip-bottom-close {
  color: #94a3b8;
}

html.dark .tooltip-bottom-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.tooltip-bottom-text {
  padding: 0 1rem 0.75rem;
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #475569;
}

html.dark .tooltip-bottom-text {
  color: #94a3b8;
}

.tooltip-bottom-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #0f172a;
  margin-top: 0.5rem;
  overflow: hidden;
}

.tooltip-bottom-video-wrap .tooltip-video-el {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tooltip-bottom-video-wrap .tooltip-video-el.hidden {
  display: none;
}

.tooltip-video-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: tooltip-video-skeleton-shimmer 1.5s ease-in-out infinite;
}

.tooltip-video-skeleton.hidden {
  display: none;
}

@keyframes tooltip-video-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.tooltip-video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  margin: 0;
}

.tooltip-video-fallback.hidden {
  display: none;
}

.tooltip-video-fallback code {
  font-size: 0.7em;
  background: rgba(255,255,255,0.1);
  padding: 0.15em 0.3em;
  border-radius: 0.25rem;
}

/* Triangle pointing down at the arrow button - same style as tooltip (bg + border) */
.tooltip-bottom-arrow {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--tooltip-border);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.tooltip-bottom-arrow::after {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 11px solid var(--tooltip-bg);
}

html.dark .tooltip-bottom-arrow {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}
