/* ============================================================
   CSS 16.09 — Everything together: a theme-able button set
   ============================================================
   Variables (01, 02) + transition (03) + transform (05)
   + hover effect (06) + @keyframes spinner (07).
   ============================================================ */

:root {
  --primary: #2D62EF;
  --success: #1F9D55;
  --danger:  #E54B4F;
  --surface: #FFFFFF;               /* the background behind the buttons */
  --on-color: #FFFFFF;              /* text on coloured buttons */
  --speed: 0.2s;                    /* one speed for every animation */
}

.dark {
  --primary: #7EA2FF;               /* lighter colours look better on dark */
  --success: #4CC985;
  --danger:  #FF7A7D;
  --surface: #0F1B3D;
  --on-color: #0F1B3D;
}

.panel {
  background-color: var(--surface);
}

.btn {
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.btn:active {
  transform: translateY(0);         /* pressed: back down */
}

.primary { background-color: var(--primary); color: var(--on-color); }
.success { background-color: var(--success); color: var(--on-color); }
.danger  { background-color: var(--danger);  color: var(--on-color); }

.outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mini-spinner {
  animation: spin 0.8s linear infinite;
}

.loading {
  opacity: 0.8;
  cursor: wait;
}

/* Respect people who turn OFF animations in their computer settings */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* Try it: change --speed to 0.6s → every button animates slower.
   Try it: in .dark, change --primary to #FFAF04 → amber primary buttons in the dark panel. */


/* ------------------------------------------------------------
   Only to make the parts visible — not part of this lesson
   ------------------------------------------------------------ */
.panel {
  font-family: Arial, sans-serif;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid #E4E4E4;
  border-radius: 14px;
  max-width: 760px;
}

.btn {
  font: inherit;
  font-weight: bold;
  padding: 10px 18px;
  margin: 6px;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.outline {
  border-color: var(--primary);     /* (repeated so it beats the line above — lesson 03) */
}

.mini-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
}


/* ============================================================
   Lesson 16 — Quick summary
   ============================================================
   VARIABLES     :root { --brand: #2D62EF; }   color: var(--brand);
                 override inside a parent (.dark) → themes
   TRANSITION    transition: property duration timing;  (on the normal state)
   TIMING        linear · ease · ease-in · ease-out ✔ · ease-in-out
   TRANSFORM     translate · rotate · scale · skew (does not move other boxes)
   ANIMATION     @keyframes name { from {…} to {…} }
                 animation: name 1s ease infinite alternate forwards;
   Be kind:      @media (prefers-reduced-motion: reduce) { … }

   Practice tasks:
     1. Create --radius and --gap variables and use them in 3 cards.
     2. Make a "Download" button that grows to scale(1.05) on hover, smoothly.
     3. Make a "NEW" badge that pulses forever with @keyframes.
   ============================================================ */
