/* ============================================================
   TOBIRA — user.css
   User layer styles: header dropdown, favorite hearts,
   upgrade modal. Matches the C-2 dark taste:
   bg #0a0a0a / ink #f2efe9 / vermilion #ff5b3d / gothic 900 /
   pill capsules / hairlines. System fonts only.
   ============================================================ */

/* ---------------- header dropdown ---------------- */
.user-menu-wrap {
  position: relative;
  display: inline-flex;
}
.user-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  right: 0;
  min-width: 196px;
  padding: 7px;
  border: 1px solid rgba(242, 239, 233, .16);
  border-radius: 16px;
  background: rgba(12, 12, 12, .82);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .85);
  opacity: 0;
  transform: translateY(-8px) scale(.94);
  transform-origin: top right;
  pointer-events: none;
  transition:
    transform .28s cubic-bezier(.34, 1.56, .64, 1),
    opacity .16s ease;
}
.user-menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.user-menu-item {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b3afa6;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.user-menu-item:hover,
.user-menu-item:focus-visible {
  color: #f2efe9;
  background: rgba(242, 239, 233, .07);
}
.user-menu-sep {
  height: 1px;
  margin: 6px 6px;
  background: rgba(242, 239, 233, .12);
}
.user-menu-signout:hover,
.user-menu-signout:focus-visible {
  color: #ff5b3d;
}

/* ---------------- favorite hearts ---------------- */
.fav-toggle {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(242, 239, 233, .2);
  border-radius: 50%;
  background: rgba(9, 9, 9, .62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(242, 239, 233, .55);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, transform .18s ease, background .18s ease;
}
.fav-toggle:hover {
  color: #f2efe9;
  border-color: rgba(242, 239, 233, .45);
  transform: scale(1.08);
}
.fav-toggle.is-active {
  color: #ff5b3d;
  border-color: rgba(255, 91, 61, .55);
  background: rgba(255, 91, 61, .14);
}
@keyframes fav-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  70% { transform: scale(.92); }
  100% { transform: scale(1); }
}
.fav-toggle.fav-pop { animation: fav-pop .38s cubic-bezier(.34, 1.56, .64, 1); }

/* larger heart in the detail dialog header — inline with the actions */
.detail-actions .fav-toggle {
  position: static;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(242, 239, 233, .26);
  border-radius: 12px;
  background: #181818;
  font-size: 17px;
}
.detail-actions .fav-toggle:hover { transform: translateY(-1px); }
.detail-actions .fav-toggle.is-active {
  color: #ff5b3d;
  border-color: rgba(255, 91, 61, .6);
  background: rgba(255, 91, 61, .12);
}

/* ---------------- upgrade modal ---------------- */
.upgrade-veil {
  position: fixed;
  z-index: 200; /* above detail dialog (z 90) */
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .78);
  opacity: 0;
  transition: opacity .2s ease;
}
.upgrade-veil.is-open { opacity: 1; }
.upgrade-modal {
  width: min(92vw, 420px);
  padding: 34px 30px 26px;
  border: 1px solid rgba(242, 239, 233, .2);
  border-radius: 22px;
  background: #101010;
  color: #f2efe9;
  box-shadow: 0 50px 140px rgba(0, 0, 0, .85);
  text-align: left;
  transform: translateY(14px) scale(.96);
  opacity: 0;
  transition:
    transform .32s cubic-bezier(.34, 1.56, .64, 1),
    opacity .18s ease;
}
.upgrade-veil.is-open .upgrade-modal {
  transform: none;
  opacity: 1;
}
.upgrade-eyebrow {
  margin: 0 0 14px;
  color: #ff5b3d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.upgrade-modal h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.045em;
}
.upgrade-price {
  margin: 10px 0 0;
  color: #b3afa6;
}
.upgrade-price b {
  color: #f2efe9;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.upgrade-price span { font-size: 12px; }
.upgrade-benefits {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(242, 239, 233, .12);
  list-style: none;
}
.upgrade-benefits li {
  color: #b3afa6;
  font-size: 12px;
}
.upgrade-benefits li::before {
  content: "✓";
  margin-right: 10px;
  color: #ff5b3d;
  font-weight: 900;
}
.upgrade-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 24px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: #ff5b3d;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.upgrade-primary:hover { transform: translateY(-1px); background: #ff6c50; }
.upgrade-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  background-size: 260% 100%;
  animation: upgrade-sheen 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes upgrade-sheen {
  0%, 55% { background-position: 130% 0; }
  100% { background-position: -130% 0; }
}
.upgrade-primary.is-processing {
  background: #8a3324;
  cursor: wait;
}
.upgrade-primary.is-processing::after { animation: none; }
.upgrade-later {
  width: 100%;
  margin-top: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(242, 239, 233, .22);
  border-radius: 999px;
  background: transparent;
  color: #b3afa6;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.upgrade-later:hover {
  color: #f2efe9;
  border-color: rgba(242, 239, 233, .45);
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .user-menu,
  .upgrade-veil,
  .upgrade-modal,
  .fav-toggle {
    transition: none;
  }
  .fav-toggle.fav-pop { animation: none; }
  .upgrade-primary::after { animation: none; }
}
