/* ═══════════════════════════════════════════════════════════════════
   MyTemple Admin — Decorative Animations
   These keyframes can't be expressed as Tailwind utilities.
   Everything else uses Tailwind classes in the ERB templates.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Floating lotus petals ─────────────────────────────────────── */
@keyframes petal-fall {
  0%   { transform: translateY(-40px) rotate(0deg); opacity: 0; }
  10%  { opacity: var(--po, 0.07); }
  85%  { opacity: var(--po, 0.07); }
  100% { transform: translateY(calc(100vh + 40px)) rotate(540deg); opacity: 0; }
}
@keyframes petal-sway {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(var(--drift, 20px)); }
}

/* ── Meditating monk breathing ─────────────────────────────────── */
@keyframes monk-breathe {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50%      { transform: scaleY(1.02) translateY(-0.5px); }
}
@keyframes monk-glow {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.35; }
}
.monk-breathe { animation: monk-breathe 4s ease-in-out infinite; transform-origin: center bottom; }
.monk-glow    { animation: monk-glow 4s ease-in-out infinite; }

/* ── Temple cat ────────────────────────────────────────────────── */
@keyframes cat-breathe {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.04); }
}
@keyframes cat-tail {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(8deg); }
}
.cat-body { animation: cat-breathe 3s ease-in-out infinite; transform-origin: center bottom; }
.cat-tail { animation: cat-tail 4s ease-in-out infinite; transform-origin: right center; }

/* Cat eyes: hidden by default (sleeping), shown on group hover */
.cat-eyes-open  { display: none; }
.cat-eyes-shut  { display: block; }
.cat-zzz        { display: block; }
.group:hover .cat-eyes-open  { display: block; }
.group:hover .cat-eyes-shut  { display: none; }
.group:hover .cat-zzz        { display: none; }

/* ── Incense smoke ─────────────────────────────────────────────── */
@keyframes smoke-1 {
  0%   { opacity: 0; d: path("M10 38 Q8 30 12 22 Q8 14 10 6"); }
  30%  { opacity: 0.3; }
  100% { opacity: 0; d: path("M10 38 Q4 28 14 18 Q6 8 12 -4"); }
}
@keyframes smoke-2 {
  0%   { opacity: 0; d: path("M10 38 Q13 30 8 22 Q13 14 10 6"); }
  40%  { opacity: 0.2; }
  100% { opacity: 0; d: path("M10 38 Q16 26 6 16 Q14 6 8 -6"); }
}
.smoke-1 { animation: smoke-1 4s ease-out infinite; opacity: 0; }
.smoke-2 { animation: smoke-2 5s ease-out 1.5s infinite; opacity: 0; }

/* ── Garland bells ─────────────────────────────────────────────── */
@keyframes bell-tinkle {
  0%, 85%, 100% { transform: rotate(0); }
  88%  { transform: rotate(5deg); }
  92%  { transform: rotate(-4deg); }
  96%  { transform: rotate(2deg); }
}
.bell-tinkle { transform-origin: top center; }
.bell-tinkle:nth-child(4n+1) { animation: bell-tinkle 6s ease-in-out infinite; }
.bell-tinkle:nth-child(4n+2) { animation: bell-tinkle 7s ease-in-out 0.5s infinite; }
.bell-tinkle:nth-child(4n+3) { animation: bell-tinkle 5s ease-in-out 1s infinite; }
.bell-tinkle:nth-child(4n)   { animation: bell-tinkle 8s ease-in-out 1.5s infinite; }

/* ── Dharma wheel spin ─────────────────────────────────────────── */
@keyframes dharma-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.dharma-spin { animation: dharma-spin 20s linear infinite; transform-origin: center; }

/* ── Prayer flags flutter ──────────────────────────────────────── */
@keyframes flag-flutter {
  0%, 100% { transform: skewX(0deg); }
  25%      { transform: skewX(2deg); }
  75%      { transform: skewX(-1.5deg); }
}
.flag-flutter { animation: flag-flutter 3s ease-in-out infinite; }
.flag-flutter:nth-child(4n+1) { animation-duration: 3s; }
.flag-flutter:nth-child(4n+2) { animation-duration: 3.5s; animation-delay: 0.4s; }
.flag-flutter:nth-child(4n+3) { animation-duration: 4s; animation-delay: 0.8s; }
.flag-flutter:nth-child(4n)   { animation-duration: 2.8s; animation-delay: 0.2s; }

/* ── Wisdom quote crossfade ────────────────────────────────────── */
@keyframes quote-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes quote-fade-out { from { opacity: 1; } to { opacity: 0; } }
.quote-visible { animation: quote-fade-in 0.4s ease forwards; }
.quote-hidden  { animation: quote-fade-out 0.4s ease forwards; }

/* ── Mindfulness bell ring ─────────────────────────────────────── */
@keyframes bell-ring {
  0%   { transform: rotate(0); }
  15%  { transform: rotate(-10deg); }
  30%  { transform: rotate(6deg); }
  45%  { transform: rotate(-3deg); }
  60%  { transform: rotate(1deg); }
  100% { transform: rotate(0); }
}
@keyframes dong-fade {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-12px); }
}
.bell-ringing { animation: bell-ring 0.6s ease-out; transform-origin: top center; }
.dong-text    { animation: dong-fade 1.5s ease-out forwards; }

/* ── Incense ember glow ────────────────────────────────────────── */
@keyframes ember-glow {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 0.5; }
}
.ember-glow { animation: ember-glow 1.5s ease-in-out infinite; }

/* ── Sidebar active indicator ──────────────────────────────────── */
.sidebar-item { transition: all 0.15s ease; }
.sidebar-item:hover { background: rgba(196, 101, 42, 0.05); }
.sidebar-item.active { background: rgba(196, 101, 42, 0.09); border-left-color: #e89830; color: #e89830; }

/* ── Table row striping ────────────────────────────────────────── */
.admin-table tbody tr:nth-child(even) { background: rgba(212, 200, 184, 0.05); }
.admin-table tbody tr:hover { background: rgba(212, 200, 184, 0.12); }

/* ── Form layout classes ──────────────────────────────────────── */
.admin-form-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-form-field {
  flex: 1;
  min-width: 0;
}
.admin-hint {
  font-size: 9px;
  color: rgba(168, 152, 136, 0.7); /* temple-stone/70 */
  margin-top: 2px;
}
.admin-field-error {
  font-size: 9px;
  color: #b84a3c; /* temple-red-warn */
  margin-top: 2px;
}

.admin-checkbox {
  border-radius: 2px;
  border: 1px solid rgba(168, 152, 136, 0.5);
  color: #c4652a; /* temple-orange */
}
.admin-checkbox:focus {
  box-shadow: 0 0 0 2px rgba(196, 101, 42, 0.2);
}

/* ── Form input classes ───────────────────────────────────────── */
.admin-input {
  background: #fff;
  border: 1px solid rgba(168, 152, 136, 0.4); /* temple-stone/40 */
  border-radius: 2px;
  padding: 6px 8px;
  font-size: 11px;
  color: #2a2520; /* temple-charcoal */
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  width: 100%;
}
.admin-input:focus {
  outline: none;
  border-color: rgba(196, 101, 42, 0.6); /* temple-orange/60 */
  box-shadow: 0 0 0 1px rgba(196, 101, 42, 0.2); /* ring temple-orange/20 */
}
.admin-input::placeholder {
  color: rgba(168, 152, 136, 0.5); /* temple-stone/50 */
}
.admin-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a89888; /* temple-stone */
  width: 7rem;
  min-width: 7rem;
  text-align: right;
  flex-shrink: 0;
}
.admin-input-error {
  border-color: rgba(184, 74, 60, 0.6); /* temple-red-warn/60 */
}
.admin-input-error:focus {
  box-shadow: 0 0 0 1px rgba(184, 74, 60, 0.2); /* ring temple-red-warn/20 */
}
