/* ============================
   Exercises Page
   ============================ */

.exo {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* ============================
   Header
   ============================ */

.exo__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exo__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exo__title {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 28px;
  line-height: 30px;
  color: #7b3a10;
  margin: 0;
}

.exo__subtitle {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 22.5px;
  color: #a78d7c;
  margin: 0;
}

.exo__cta {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 24px;
  border-radius: 12px;
  background: linear-gradient(166deg, #e07b20 0%, #d4922a 100%);
  box-shadow: 0 4px 12px rgba(200, 106, 0, 0.2);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 22.5px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.exo__cta:hover {
  opacity: 0.92;
}

.exo__cta svg {
  flex-shrink: 0;
}

/* ============================
   Stats
   ============================ */

.exo__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.exo__stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px;
  background: #fff;
  border: 1px solid #f0e6d8;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(123, 58, 16, 0.06);
}

.exo__stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exo__stat-icon--amber { background: rgba(212, 132, 42, 0.12); }
.exo__stat-icon--teal { background: rgba(42, 155, 155, 0.1); }
.exo__stat-icon--orange { background: rgba(200, 106, 0, 0.08); }
.exo__stat-icon--brown { background: rgba(123, 58, 16, 0.08); }

.exo__stat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exo__stat-value {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 22px;
  line-height: 22px;
  color: #7b3a10;
}

.exo__stat-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 11px;
  line-height: 16.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #a78d7c;
}

/* ============================
   Toolbar
   ============================ */

.exo__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.exo__search {
  position: relative;
  width: 423px;
  max-width: 100%;
}

.exo__search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.exo__search-input {
  width: 100%;
  height: 43px;
  padding: 0 25px 0 40px;
  border: 1px solid #f0e6d8;
  border-radius: 15px;
  background: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  color: #7b3a10;
  outline: none;
  transition: border-color 0.15s ease;
}

.exo__search-input::placeholder {
  color: #c5b8a8;
}

.exo__search-input:focus {
  border-color: #d4922a;
}

.exo__filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exo__filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 43px;
  padding: 0 16px;
  border: 1.5px solid #f0e6d8;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #7b3a10;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.exo__filter-btn:hover {
  border-color: #d4922a;
}

.exo__filter-btn svg {
  flex-shrink: 0;
}

.exo__view-toggle {
  display: flex;
}

.exo__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 43px;
  border: 1px solid #f2e5d3;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.exo__view-btn:first-child {
  border-radius: 10px 0 0 10px;
}

.exo__view-btn:last-child {
  border-radius: 0 10px 10px 0;
  margin-left: -1px;
}

.exo__view-btn--active {
  background: #f7f3ef;
}

.exo__view-btn:hover {
  background: #f7f3ef;
}

/* ============================
   Exercise Cards Grid
   ============================ */

.exo__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.exo__card {
  background: #fff;
  border: 1px solid #f0e6d8;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(123, 58, 16, 0.06);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* --- Card Top (icon + badge) --- */
.exo__card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exo__card-op {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}

.exo__card-op--multiplication { background: rgba(221, 152, 60, 0.08); color: #dd983c; }
.exo__card-op--addition { background: rgba(100, 163, 84, 0.08); color: #64a354; }
.exo__card-op--soustraction { background: rgba(120, 83, 34, 0.08); color: #785322; }
.exo__card-op--division { background: rgba(27, 175, 181, 0.08); color: #1bafb5; }

.exo__card-badge {
  padding: 2px 12px;
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 11px;
  line-height: 16.5px;
  text-transform: uppercase;
}

.exo__card-badge--facile {
  background: rgba(52, 199, 89, 0.08);
  border: 1px solid rgba(52, 199, 89, 0.25);
  color: #28a745;
}

.exo__card-badge--moyen {
  background: rgba(212, 132, 42, 0.08);
  border: 1px solid #f2e5d3;
  color: #d4842a;
}

.exo__card-badge--difficile {
  background: rgba(200, 106, 0, 0.08);
  border: 1px solid rgba(200, 106, 0, 0.2);
  color: #c86a00;
}

/* --- Card Title --- */
.exo__card-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 15px;
  line-height: 21px;
  color: #7b3a10;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Card Meta --- */
.exo__card-meta {
  display: flex;
  gap: 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 12px;
  line-height: 18px;
  color: #a78d7c;
}

.exo__card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.exo__card-meta-icon {
  width: 14px;
  height: 14px;
}

/* --- Card Score --- */
.exo__card-score {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exo__card-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exo__card-score-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 11px;
  line-height: 16.5px;
  color: #bbb;
}

.exo__card-score-value {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 13px;
  line-height: 19.5px;
  color: #7b3a10;
}

.exo__card-bar {
  height: 6px;
  background: #f7f3ef;
  border-radius: 999px;
  overflow: hidden;
}

.exo__card-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(178deg, #e07b20 0%, #d4922a 100%);
}

/* --- Card Footer --- */
.exo__card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f0e6d8;
}

.exo__card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 18px;
  color: #bbb;
}

.exo__card-date svg {
  flex-shrink: 0;
}

.exo__card-actions {
  display: flex;
  gap: 8px;
}

.exo__card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.exo__card-action:hover {
  background: #f7f3ef;
}

/* ============================
   FAB
   ============================ */

.exo__fab {
  position: fixed;
  bottom: 40px;
  left: calc(260px + 50%);
  transform: translateX(-50%);
  z-index: 50;
}

.exo__fab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #28a745 0%, #34c759 100%);
  box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.exo__fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1200px) {
  .exo__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .exo__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .exo__search {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .exo__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .exo__stats {
    grid-template-columns: 1fr;
  }

  .exo__grid {
    grid-template-columns: 1fr;
  }

  .exo__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .exo__search {
    width: 100%;
  }

  .exo__filters {
    flex-wrap: wrap;
  }

  .exo__fab {
    left: 50%;
  }
}
