/* ════════════════════════════════════════════════════════════════
   EduExpert — Section Dots Navigator Styles
   Loaded after landing.css + playground.css.
   Scoped class names avoid conflict with landing CSS.
   ════════════════════════════════════════════════════════════════ */

/* ── Nav container (glass pill) ── */
.sd-nav {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px -8px rgba(15, 23, 42, 0.15);
  transition: opacity 0.3s, transform 0.3s;
}
:where(.dark) .sd-nav {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4);
}

/* Hide on very narrow viewports only (< 360px — old/small phones) */
@media (max-width: 360px) {
  .sd-nav { display: none; }
}

/* Compact mode on phones/tablets (≤ 640px): smaller dots, tighter spacing */
@media (max-width: 640px) {
  .sd-nav {
    right: 10px;
    padding: 14px 9px;
    gap: 11px;
  }
  .sd-dot {
    width: 10px;
    height: 10px;
  }
  .sd-tip {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* ── Each dot ── */
.sd-dot {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}
:where(.dark) .sd-dot { background: rgba(255, 255, 255, 0.25); }

.sd-dot:hover {
  background: rgba(15, 23, 42, 0.4);
  transform: scale(1.25);
}
:where(.dark) .sd-dot:hover { background: rgba(255, 255, 255, 0.4); }

.sd-dot.sd-active {
  background: #3b82f6;
  transform: scale(1.4);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18), 0 0 12px rgba(59, 130, 246, 0.4);
}
.sd-dot.sd-active::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.4);
  animation: sdPulse 2s ease-in-out infinite;
}
@keyframes sdPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0; }
}

/* ── Tooltip (gradient style) ── */
.sd-dot .sd-tip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px) scale(0.95);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  padding: 7px 14px;
  border-radius: 8px;
  box-shadow:
    0 8px 24px -4px rgba(59, 130, 246, 0.45),
    0 2px 6px rgba(99, 102, 241, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
:where(.dark) .sd-tip {
  background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
  color: #0f172a;
  font-weight: 800;
  box-shadow:
    0 8px 24px -4px rgba(96, 165, 250, 0.55),
    0 2px 6px rgba(129, 140, 248, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
/* Only apply :hover on devices that have a real hover (mouse/trackpad).
   On touch devices, tap is treated as sticky :hover by browsers, causing
   the tooltip to stay visible after click. @media (hover: hover) excludes touch. */
@media (hover: hover) {
  .sd-dot:hover .sd-tip {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}
.sd-dot.sd-flash .sd-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  animation: sdFlashTip 2s ease-out forwards;
}
@keyframes sdFlashTip {
  0%   { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
  75%  { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
  100% { opacity: 0; transform: translateY(-50%) translateX(0) scale(0.96); }
}
/* Arrow on tooltip pointing to dot — matches gradient end (indigo) */
.sd-dot .sd-tip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #6366f1;
}
:where(.dark) .sd-dot .sd-tip::after { border-left-color: #818cf8; }

/* Reduced motion: disable pulse + smooth transitions */
@media (prefers-reduced-motion: reduce) {
  .sd-dot.sd-active::before { animation: none; }
  .sd-dot.sd-flash .sd-tip { animation: none; }
  .sd-dot, .sd-tip { transition: none; }
}
