/* ============================================================
   CSS 16.07 — @keyframes: animations that run by themselves
   ============================================================
   Transitions need a trigger (like :hover). Animations run on their own.

   1. DESCRIBE the animation with @keyframes and a name:
        @keyframes spin {
          from { transform: rotate(0deg); }
          to   { transform: rotate(360deg); }
        }
      (or use percentages: 0% { … }  50% { … }  100% { … })

   2. USE it on an element:
        animation: spin 1s linear infinite;
                   ─┬── ─┬ ──┬─── ───┬────
                    │    │   │       └── how many times (infinite = forever)
                    │    │   └────────── timing function (example 04)
                    │    └────────────── duration
                    └─────────────────── the @keyframes name
   ============================================================ */

/* 1. Spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* 2. Pulsing dot */
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 1; }
  50%  { transform: scale(1.6); opacity: 0.4; }
  100% { transform: scale(1);   opacity: 1; }
}

.live-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

/* 3. Bouncing arrow */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(12px); }
}

.bounce {
  animation: bounce 1s ease-in-out infinite;
}
/* Try it: change the spinner's 1s to 3s → it turns slowly. */


/* ------------------------------------------------------------
   Only to make the parts visible — not part of this lesson
   ------------------------------------------------------------ */
body { font-family: Arial, sans-serif; padding: 20px; }

.spinner {
  width: 48px;
  height: 48px;
  border: 6px solid #E4E4E4;
  border-top-color: #2D62EF;        /* only one side coloured → you can see it turn */
  border-radius: 50%;
  margin-bottom: 24px;
}

.live-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #E54B4F;
  margin-right: 8px;
}

.bounce {
  display: inline-block;            /* transform works on inline-block */
  font-size: 40px;
  color: #2D62EF;
}
