/* ═══════════════════════════════════════════════════════════════════
   css/ambient-review.css — Ám Ảnh Tu Luyện v7.98
   Glassmorphism dark card — góc bottom-right cố định
   ═══════════════════════════════════════════════════════════════════ */

/* === Wrapper chính === */
.ytt-ambient-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 316px;
  max-width: calc(100vw - 32px);
  background: rgba(14, 14, 26, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 18px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 215, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  z-index: 99990;
  overflow: hidden;
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  font-family: 'Poppins', system-ui, sans-serif;
  pointer-events: none;
  user-select: none;
}

.ytt-ambient-card.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

.ytt-ambient-card.hide {
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  pointer-events: none;
}

/* === Header === */
.yac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.yac-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 215, 0, 0.8);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.yac-badge i { margin-right: 5px; }

.yac-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Buttons trong header */
.yac-tts-btn,
.yac-snooze-btn,
.yac-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  padding: 4px 6px;
  transition: background 0.18s, color 0.18s;
}

.yac-tts-btn {
  color: rgba(100, 190, 255, 0.75);
  font-size: 0.95rem;
}
.yac-tts-btn:hover {
  background: rgba(100, 190, 255, 0.12);
  color: rgba(100, 190, 255, 1);
}

.yac-snooze-btn {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.65rem;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
}
.yac-snooze-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.75);
}

.yac-close-btn {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.15rem;
  font-weight: 300;
}
.yac-close-btn:hover {
  background: rgba(255, 80, 80, 0.14);
  color: rgba(255, 110, 110, 0.95);
}

/* === Body: chữ Hán, pinyin, nghĩa === */
.yac-body {
  padding: 16px 20px 12px;
  text-align: center;
}

.yac-hanzi {
  font-family: 'KaiTi', 'Noto Sans SC', 'STKaiti', '楷体', serif;
  font-size: 2.9rem;
  font-weight: bold;
  color: #ef5350;
  line-height: 1.1;
  margin-bottom: 6px;
  text-shadow: 0 0 24px rgba(239, 83, 80, 0.35);
  letter-spacing: 0.05em;
}

.yac-pinyin {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: #ce93d8;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.yac-meaning {
  font-size: 0.85rem;
  color: rgba(210, 210, 210, 0.7);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 4 Rating Buttons === */
.yac-buttons {
  display: flex;
  gap: 5px;
  padding: 4px 12px 12px;
}

.yac-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, filter 0.15s;
  outline: none;
}

.yac-btn:hover  { transform: translateY(-2px); filter: brightness(1.15); }
.yac-btn:active { transform: translateY(0);    filter: brightness(0.9);  }

.yac-btn-icon    { font-size: 1.1rem; line-height: 1; }
.yac-btn-label   { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.03em; }
.yac-btn-interval{ font-size: 0.6rem;  opacity: 0.7; }

/* Màu 4 nút FSRS */
.yac-again { background: rgba(211, 47, 47,  0.18); color: #ef9a9a; border: 1px solid rgba(211,47,47,0.3); }
.yac-hard  { background: rgba(230, 119, 0,  0.18); color: #ffcc80; border: 1px solid rgba(230,119,0,0.3); }
.yac-good  { background: rgba(46,  125, 50, 0.18); color: #a5d6a7; border: 1px solid rgba(46,125,50,0.3); }
.yac-easy  { background: rgba(255, 215, 0,  0.14); color: #fff176; border: 1px solid rgba(255,215,0,0.28); }

/* === Countdown bar === */
.yac-countdown-wrap {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0 0 18px 18px;
  overflow: hidden;
}

.yac-countdown-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffd700, #ef5350);
  border-radius: inherit;
  transition: width 0.12s linear;
  transform-origin: left;
}

/* === Micro-reward float "+1 Tu Vi" === */
.yac-reward-float {
  position: fixed;
  bottom: 200px;
  right: 30px;
  z-index: 99995;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition: none;
}

.yac-reward-float.float-up {
  animation: yac-float-up 1.1s ease-out forwards;
}

@keyframes yac-float-up {
  0%   { opacity: 1; transform: translateY(0)    scale(1);    }
  60%  { opacity: 1; transform: translateY(-45px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-75px) scale(0.9);  }
}

/* === Mobile: slide từ dưới, full-width === */
@media (max-width: 480px) {
  .ytt-ambient-card {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    transform: translateY(110%);
  }
  .ytt-ambient-card.show  { transform: translateY(0); }
  .ytt-ambient-card.hide  { transform: translateY(110%); }

  .yac-reward-float {
    right: 50%;
    transform: translateX(50%);
  }
}

/* ═══ Settings Modal — Toggle Switch Ám Ảnh Tu Luyện ═══════════════
   Dùng trong modals/settings-modal.html
   ─────────────────────────────────────────────────────────────────── */
.ytt-toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.ytt-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ytt-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(180, 180, 180, 0.35);
  border-radius: 26px;
  transition: background 0.25s;
  border: 1px solid rgba(255,255,255,0.1);
}

.ytt-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.ytt-toggle-switch input:checked + .ytt-toggle-slider {
  background: linear-gradient(135deg, #e53935, #b71c1c);
}

.ytt-toggle-switch input:checked + .ytt-toggle-slider::before {
  transform: translateX(20px);
}
