/* ═══════════════════════════════════════════════════════════════════════
   CONTEXTUAL EFFORT METER - AMU SHIRINGANI PORTFOLIO
   Top-left contextual effort meter recreation adhering strictly to
   reference video specs: 6 discrete stops, pill tick on Medium,
   animated Ultracode matrix grid, accessible slider, and proximity reveal.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── FLYOUT CONTAINER ─────────────────────────────────────────────────── */
.effort-meter-flyout {
  position: absolute;
  top: calc(100% + 15px);
  left: 0;
  width: 438px;
  max-width: calc(100vw - 32px);
  background: rgba(27, 27, 29, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 24px 24px 24px 24px;
  box-sizing: border-box;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
  z-index: 1040;
  font-family: var(--font-body, 'Switzer', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);

  /* Inactive state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top left;
  transition:
    opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.22s ease;
}

/* Invisible bridge so mouse moving from logo down to meter doesn't leave hover area */
.effort-meter-flyout::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  height: 20px;
  pointer-events: auto;
}

/* Active / Revealed state */
.effort-meter-flyout.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ── HEADER: TITLE & INFO ICON ────────────────────────────────────────── */
.effort-meter__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.effort-meter__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.effort-meter__label {
  font-size: 19px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.effort-meter__value {
  font-size: 19px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.effort-meter-flyout.is-ultracode .effort-meter__value {
  color: #9d8df1;
  text-shadow: 0 0 14px rgba(157, 141, 241, 0.55);
}

.effort-meter__help-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  outline: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.effort-meter__help-btn:hover,
.effort-meter__help-btn:focus-visible {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* ── SUB LABELS (FASTER / SMARTER) ────────────────────────────────────── */
.effort-meter__sub-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 2px;
}

.effort-meter__sub-label {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ── TRACK CONTAINER ──────────────────────────────────────────────────── */
.effort-meter__track {
  position: relative;
  width: 100%;
  height: 40px;
  border-radius: 9999px;
  background: #2a2a2c;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}

/* ── ULTRACODE MATRIX TEXTURE ─────────────────────────────────────────── */
.effort-meter__matrix {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  background: #232228;
}

.effort-meter-flyout.is-ultracode .effort-meter__matrix {
  opacity: 1;
}

.effort-meter__matrix-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── PROGRESS FILL ────────────────────────────────────────────────────── */
.effort-meter__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 20%;
  background: #6a6a6e;
  border-radius: 9999px;
  pointer-events: none;
  transition: width 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, opacity 0.2s ease;
}

.effort-meter-flyout.is-dragging .effort-meter__fill {
  transition: none;
}

.effort-meter-flyout.is-ultracode .effort-meter__fill {
  opacity: 0;
}

/* ── TICKS (6 DISCRETE STOPS) ─────────────────────────────────────────── */
.effort-meter__ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.effort-meter__tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  width: 6px;
  height: 6px;
}

.effort-meter__tick--pill {
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.55);
}

/* ── THUMB ────────────────────────────────────────────────────────────── */
.effort-meter__thumb {
  position: absolute;
  top: 2px;
  left: 0;
  width: 30px;
  height: 36px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
  cursor: grab;
  z-index: 3;
  outline: none;
  transition: left 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.1s ease;
}

.effort-meter-flyout.is-dragging .effort-meter__thumb {
  transition: transform 0.1s ease;
  cursor: grabbing;
  transform: scale(1.02);
}

.effort-meter__thumb:focus-visible {
  outline: 2px solid #9d8df1;
  outline-offset: 2px;
}

/* ── FOOTER: RECOMMENDED BADGE ────────────────────────────────────────── */
.effort-meter__footer {
  position: relative;
  height: 24px;
  margin-top: 14px;
}

.effort-meter__rec-label {
  position: absolute;
  font-size: 14.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: -0.01em;
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: 1.2;
}

/* ── RESPONSIVE ADAPTATIONS ───────────────────────────────────────────── */
@media screen and (max-width: 480px) {
  .effort-meter-flyout {
    padding: 20px 18px 20px 18px;
    border-radius: 16px;
  }
}

/* ── REDUCED MOTION ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .effort-meter-flyout,
  .effort-meter__fill,
  .effort-meter__thumb,
  .effort-meter__value,
  .effort-meter__matrix {
    transition: none !important;
    animation: none !important;
  }
}
