/* ============================================
   AIFEIN v3 — Additional Styles
   Light theme + Pick of Week + Stack drawer + Score tooltip + Toast
   ============================================ */

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
  --bg: #faf8f3;
  --bg-2: #f5f1ea;
  --bg-3: #efe9dd;
  --ink: #0a0a0a;
  --ink-2: #2c2c2c;
  --ink-3: #6b665d;
  --gold: #a8854a;
  --gold-2: #8d7440;
  --gold-soft: #c8a96a;
  --line: rgba(10,10,10,0.08);
  --line-2: rgba(10,10,10,0.14);
  --shadow: 0 30px 80px -20px rgba(0,0,0,0.15);
}

[data-theme="light"] body { background: var(--bg); }

[data-theme="light"] .nav {
  background: rgba(250,248,243,0.85);
  border-bottom-color: var(--line);
}

[data-theme="light"] .nav__logo {
  filter: drop-shadow(0 0 12px rgba(168,133,74,0.2));
}

[data-theme="light"] .hero__title em {
  background: linear-gradient(120deg, var(--gold), var(--gold-2) 50%, var(--gold));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="light"] .finder__inner {
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
}

[data-theme="light"] .finder__btn,
[data-theme="light"] .btn-gold {
  color: #fff;
}

[data-theme="light"] .grain { opacity: 0.025; }

[data-theme="light"] .foot { background: #f0ebe0; }

[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }

/* Theme toggle button */
.nav__theme,
.nav__stack {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

.nav__theme:hover,
.nav__stack:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.nav__theme svg,
.nav__stack svg {
  width: 18px;
  height: 18px;
}

.nav__theme-light { display: none; }
[data-theme="light"] .nav__theme-light { display: block; }
[data-theme="light"] .nav__theme-dark { display: none; }

.nav__stack-count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--gold);
  color: var(--bg);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

@media (max-width: 720px) {
  .nav__theme { display: none; }
}

/* ============================================
   PICK OF THE WEEK
   ============================================ */
.pick {
  padding: clamp(3rem, 6vw, 5rem) var(--pad);
  background: var(--bg);
}

.pick__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: clamp(2rem, 4vw, 3.5rem);
  background: linear-gradient(135deg, rgba(200,169,106,0.08) 0%, rgba(200,169,106,0.02) 100%);
  border: 1px solid rgba(200,169,106,0.2);
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

.pick__inner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(200,169,106,0.15), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.pick__content { position: relative; z-index: 1; }

.pick__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(200,169,106,0.15);
  border: 1px solid rgba(200,169,106,0.4);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.pick__tag::before {
  content: '⭐';
  font-size: 0.85rem;
}

.pick__eyebrow {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.pick__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}

[lang="zh"] .pick__name { font-family: var(--font-cn); font-weight: 500; }

.pick__verdict {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 1.5rem;
  max-width: 30ch;
}

.pick__why {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin-bottom: 2rem;
  max-width: 48ch;
}

.pick__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--bg);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.pick__cta::after {
  content: '→';
  transition: transform 0.3s ease;
}

.pick__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px -10px rgba(200,169,106,0.5);
}

.pick__cta:hover::after { transform: translateX(4px); }

.pick__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.pick__visual img {
  width: 80%;
  max-width: 280px;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.4));
  animation: floatBot 8s ease-in-out infinite;
}

.pick__score {
  position: absolute;
  top: 10%;
  right: 5%;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(200,169,106,0.3);
  border-radius: 18px;
  padding: 1.2rem 1.5rem;
  text-align: center;
  z-index: 2;
}

[data-theme="light"] .pick__score {
  background: rgba(255,255,255,0.95);
  color: var(--ink);
}

.pick__score__label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}

[data-theme="light"] .pick__score__label { color: var(--ink-2); }

.pick__score__value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-style: italic;
  font-weight: 500;
  color: var(--gold-2);
  line-height: 1;
}

@media (max-width: 880px) {
  .pick__inner { grid-template-columns: 1fr; gap: 2rem; }
  .pick__visual { order: -1; min-height: 200px; }
  .pick__visual img { width: 60%; max-width: 200px; }
  .pick__score { top: 0; right: 0; padding: 0.8rem 1rem; }
  .pick__score__value { font-size: 1.8rem; }
}

/* ============================================
   AIFEIN SCORE TOOLTIP
   ============================================ */
.tool__score {
  cursor: help;
  position: relative;
}

.tool__score:hover {
  background: rgba(200,169,106,0.18);
  border-color: rgba(200,169,106,0.5);
}

.score-tip {
  position: fixed;
  z-index: 200;
  min-width: 280px;
  padding: 1.2rem 1.4rem;
  background: rgba(15,15,15,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(200,169,106,0.3);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(8px);
  color: var(--ink);
}

[data-theme="light"] .score-tip {
  background: rgba(255,255,255,0.98);
  color: #0a0a0a;
  border-color: rgba(168,133,74,0.3);
}

.score-tip.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.score-tip__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid rgba(200,169,106,0.15);
}

.score-tip__title {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.score-tip__total {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 500;
  color: var(--gold-2);
  line-height: 1;
}

.score-tip__row {
  display: grid;
  grid-template-columns: 100px 1fr 28px;
  gap: 0.7rem;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.78rem;
}

.score-tip__row__label {
  color: rgba(255,255,255,0.7);
}

[data-theme="light"] .score-tip__row__label { color: rgba(0,0,0,0.65); }

.score-tip__row__bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

[data-theme="light"] .score-tip__row__bar { background: rgba(0,0,0,0.08); }

.score-tip__row__bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold-2));
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}

.score-tip__row__val {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-2);
  text-align: right;
  font-size: 0.85rem;
}

/* ============================================
   SAVE TO STACK (on tool card)
   ============================================ */
.tool__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.tool__save {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.25s ease;
  flex: 1;
  justify-content: center;
}

[data-theme="light"] .tool__save {
  background: rgba(0,0,0,0.02);
}

.tool__save svg { width: 14px; height: 14px; }
.tool__save:hover {
  border-color: var(--gold);
  color: var(--gold-2);
  background: rgba(200,169,106,0.08);
}

.tool__save--active {
  background: rgba(200,169,106,0.18);
  border-color: var(--gold);
  color: var(--gold-2);
}

.tool__save--active svg { fill: var(--gold); stroke: var(--gold); }

/* The CTA is now a smaller inline button next to save */
.tool .tool__cta {
  margin-top: 0;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.75rem;
  flex: 0 0 auto;
}

.tool .tool__cta:hover {
  border-color: var(--gold);
  background: rgba(200,169,106,0.08);
}

.tool .tool__cta::after { display: none; }

/* ============================================
   STACK DRAWER
   ============================================ */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  visibility: hidden;
}

.drawer.active {
  pointer-events: auto;
  visibility: visible;
}

.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer.active .drawer__overlay { opacity: 1; }

.drawer__panel {
  position: absolute;
  right: 0; top: 0;
  height: 100dvh;
  width: min(440px, 100vw);
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -40px 0 80px rgba(0,0,0,0.4);
}

.drawer.active .drawer__panel { transform: translateX(0); }

.drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.drawer__head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.8rem;
  color: var(--gold-2);
}

[lang="zh"] .drawer__head h3 { font-family: var(--font-cn); font-style: normal; }

.drawer__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  transition: all 0.3s ease;
}

.drawer__close:hover { border-color: var(--gold); color: var(--gold); }

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.drawer__empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-3);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
}

[lang="zh"] .drawer__empty { font-family: var(--font-cn); font-style: normal; }

.stack-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.stack-item__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}

[lang="zh"] .stack-item__name { font-family: var(--font-cn); }

.stack-item__cat {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 0.15rem;
}

.stack-item__price {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-2);
  font-size: 1rem;
}

.stack-item__remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.stack-item__remove:hover {
  border-color: #c89a9a;
  color: #c89a9a;
}

.drawer__foot {
  padding: 1.2rem 1.5rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--bg-3);
}

.drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.2rem;
}

.drawer__total span {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.drawer__total strong {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  font-weight: 500;
  color: var(--gold-2);
}

.drawer__actions {
  display: flex;
  gap: 0.6rem;
}

.btn-line {
  flex: 0 0 auto;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: all 0.3s ease;
}

.btn-line:hover {
  border-color: #c89a9a;
  color: #c89a9a;
}

.drawer__actions .btn-gold {
  flex: 1;
  padding: 0.85rem 1.2rem;
  font-size: 0.78rem;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.85rem 1.4rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #0a0a0a;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 20px 50px -10px rgba(200,169,106,0.5);
  white-space: nowrap;
}

.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   SHARED STACK BANNER
   ============================================ */
.shared-banner {
  background: linear-gradient(135deg, rgba(200,169,106,0.15), rgba(200,169,106,0.05));
  border-bottom: 1px solid rgba(200,169,106,0.3);
  padding: 0.7rem var(--pad);
  text-align: center;
  font-size: 0.85rem;
  color: var(--gold-2);
  position: relative;
  z-index: 50;
  margin-top: 64px;
}

.shared-banner button {
  margin-left: 0.8rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 600;
  transition: all 0.3s ease;
}

.shared-banner button:hover {
  background: var(--gold);
  color: var(--bg);
}
