/* ============================================================
   animations.css — Extra polish & micro-interactions
   ============================================================ */

/* ── PAGE TRANSITIONS ─────────────────────────────────────── */
.page-content > * {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.page-content > *:nth-child(1) { animation-delay: 0.04s }
.page-content > *:nth-child(2) { animation-delay: 0.09s }
.page-content > *:nth-child(3) { animation-delay: 0.14s }
.page-content > *:nth-child(4) { animation-delay: 0.19s }
.page-content > *:nth-child(5) { animation-delay: 0.24s }
.page-content > *:nth-child(6) { animation-delay: 0.29s }

/* ── HOVER LIFT ───────────────────────────────────────────── */
.card, .news-card, .goal-card, .notif-item {
  will-change: transform;
}

/* ── SHINE EFFECT on Miles Cards ────────────────────────────── */
.miles-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255,255,255,0.07) 50%,
    transparent 80%
  );
  transform: skewX(-15deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.miles-card:hover::after { left: 120%; }

/* ── ACTIVE STATES ───────────────────────────────────────── */
.btn:active       { transform: scale(0.97) !important; }
.nav-item:active  { transform: scale(0.9); }
.card:active      { transform: scale(0.99); }
.goal-card:active { transform: scale(0.99); }
.news-card:active { transform: scale(0.99); }

/* ── SAFE AREA ───────────────────────────────────────────── */
.page-header {
  padding-top: max(20px, env(safe-area-inset-top));
}
.bottom-nav {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* ── FOCUS VISIBLE ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── SELECTION ───────────────────────────────────────────── */
::selection {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── LOADING SPINNER ─────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

/* ── SWIPE INDICATOR ─────────────────────────────────────── */
.swipe-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.swipe-hint::before, .swipe-hint::after {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}

/* ── FLOATING LABEL INPUT ────────────────────────────────── */
.float-label-group {
  position: relative;
}
.float-label-group .input-field {
  padding-top: 22px;
  padding-bottom: 8px;
}
.float-label-group .float-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s;
}
.float-label-group .input-field:focus ~ .float-label,
.float-label-group .input-field:not(:placeholder-shown) ~ .float-label {
  top: 14px;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── PULL TO REFRESH INDICATOR ───────────────────────────── */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.ptr-indicator.visible { opacity: 1; }

/* ── GLASS CARD VARIANT ──────────────────────────────────── */
.card-frosted {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── NUMBER TICKER ───────────────────────────────────────── */
@keyframes tickUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.tick-animate { animation: tickUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* ── TAG LIST ─────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── CONFETTI ANIMATION ──────────────────────────────────── */
@keyframes confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  top: -10px;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
  pointer-events: none;
  z-index: 9999;
}

/* ── RESPONSIVE TWEAKS ───────────────────────────────────── */
@media (max-width: 360px) {
  :root { font-size: 14px; }
  .nav-label { font-size: 0.58rem; }
  .nav-item { padding: 8px 10px; min-width: 48px; }
}

@media (min-width: 480px) {
  .container { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  body { background: #050508; }
}

/* ── DARK SCROLLBAR for webkit ───────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }

/* ── INPUT DATE fix for dark mode ───────────────────────── */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(5) hue-rotate(10deg);
  cursor: pointer;
}
select option { background: var(--bg-elevated); color: var(--text-primary); }

/* ── IFRAME EMBED ────────────────────────────────────────── */
iframe { display: block; border-radius: var(--radius-md); }

/* ── ARTICLE CONTENT STYLES ──────────────────────────────── */
.article-content h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 8px;
}
.article-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}
.article-content strong { color: var(--text-primary); font-weight: 600; }
.article-content a { color: var(--accent); text-decoration: underline; }
