/* ============================================================
   WORD OF THE DAY WIDGET — Floating Sticky
   Monkey-Type.in
   ============================================================ */

/* ── Widget Container ─────────────────────────────────────── */
#wotd-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9998;
  font-family: var(--font-ui, 'Inter', sans-serif);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

/* ── Toggle Tab (always visible) ─────────────────────────── */
#wotd-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: #4F46E5;
  background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
  color: #fff;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(79,70,229,0.45), 0 2px 6px rgba(0,0,0,0.12);
  user-select: none;
  border: 2px solid rgba(255,255,255,0.18);
  transition: all 0.2s ease;
  line-height: 1;
  max-width: 200px;
  min-width: 0;
}

#wotd-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(79,70,229,0.55), 0 3px 8px rgba(0,0,0,0.15);
}

#wotd-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

#wotd-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#wotd-chevron {
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  opacity: 0.8;
}

/* ── Expand Panel ─────────────────────────────────────────── */
#wotd-panel {
  background: #fff;
  border: 1px solid #E0E0F0;
  border-radius: 18px;
  box-shadow: 0 12px 48px rgba(15,14,43,0.14), 0 4px 12px rgba(79,70,229,0.08);
  padding: 1.4rem 1.5rem 1.35rem;
  width: 280px;
  order: -1; /* appear above the toggle */

  /* Hidden state */
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    max-height 0.35s ease,
    padding 0.3s ease;
}

#wotd-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
  max-height: 400px;
  overflow: visible;
}

/* ── Panel Header ──────────────────────────────────────────── */
#wotd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #E0E0F0;
}

#wotd-date {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4F46E5;
  background: rgba(79,70,229,0.08);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
}

#wotd-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #A8A7C0;
  font-size: 0.95rem;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

#wotd-close:hover {
  color: #4F46E5;
  background: rgba(79,70,229,0.07);
}

/* ── Word ──────────────────────────────────────────────────── */
#wotd-word {
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0F0E2B;
  line-height: 1.1;
  background: linear-gradient(135deg, #4F46E5 0%, #0891B2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

/* ── Part of Speech badge ──────────────────────────────────── */
#wotd-pos {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0891B2;
  background: rgba(8,145,178,0.10);
  border: 1px solid rgba(8,145,178,0.2);
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

/* ── Definition ────────────────────────────────────────────── */
#wotd-def {
  font-size: 0.88rem;
  color: #2D2B4A;
  line-height: 1.65;
  margin-bottom: 1.1rem;
}

/* ── Practice Button ───────────────────────────────────────── */
#wotd-practice-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-ui, 'Inter', sans-serif);
  box-shadow: 0 4px 12px rgba(79,70,229,0.28);
  width: 100%;
  justify-content: center;
  letter-spacing: 0.01em;
}

#wotd-practice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79,70,229,0.38);
}

#wotd-practice-btn:active {
  transform: translateY(0);
}

/* ── Pulse animation on first appearance ──────────────────── */
@keyframes wotdPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(79,70,229,0.45); }
  50%       { box-shadow: 0 4px 28px rgba(79,70,229,0.70); }
}

#wotd-toggle {
  animation: wotdPulse 2.5s ease-in-out 1.5s 3;
}

/* ── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 480px) {
  #wotd-widget {
    bottom: 1rem;
    right: 1rem;
  }

  #wotd-panel {
    width: calc(100vw - 2rem);
    max-width: 320px;
  }

  #wotd-label {
    display: none; /* just icon on very small screens */
  }
}
