/* ============================================================
   COMPONENTS.CSS — DigiOpo
   Yhteiset komponentit: napit, tagit, kortit, navigaatio
   ============================================================ */

/* --- Napit ------------------------------------------------- */

.btn-primary {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #4338ca;
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e5e7eb;
  color: var(--text);
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.button-row {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

/* --- Tagit ------------------------------------------------- */

.tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.tag-default {
  background: #e5e7eb;
  color: #374151;
}

.tag-vahvuudet {
  background: var(--tag-vahvuudet);
}
.tag-opiskelu {
  background: var(--tag-opiskelu);
}
.tag-tet {
  background: var(--tag-tet);
}
.tag-urat {
  background: var(--tag-urat);
}
.tag-interactive {
  background: #c7d2fe;
  color: #312e81;
}
.tag-keskustelu {
  background: #d8b4fe;
  color: #3b0764;
}

/* --- Luokkakortit (etusivu) -------------------------------- */

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.class-card {
  padding: 28px 28px 28px 40px;
  border-radius: 14px;
  color: white;
  display: block;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}

.class-card h3 {
  margin-bottom: 10px;
  margin-left: 4px;
  font-size: 22px;
}

.class-card p {
  font-size: 14px;
  margin-left: 4px;
  opacity: 0.9;
}

.class-7 {
  background: #2563eb;
}
.class-8 {
  background: #7c3aed;
}
.class-9 {
  background: #16a34a;
}

.class-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* --- Tehtäväkortit (etusivu card-grid) --------------------- */

.card-grid,
.interactive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.course-card {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: block;
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.course-card h3 {
  margin-bottom: 8px;
}

.course-card p {
  font-size: 14px;
  color: var(--text-light);
}

/* --- Sivunavigaatio (edellinen/seuraava) ------------------- */

.page-navigation {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
}

.nav-link {
  background: var(--primary);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.nav-link:hover {
  background: var(--primary-hover);
}

/* --- Section label ----------------------------------------- */

.section-label {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

/* --- Navigaation alalinkit --------------------------------- */

.sub-link {
  display: block;
  font-size: 0.9em;
  opacity: 0.7;
  margin-left: 10px;
}

.sub-link.mission-link {
  color: #a16207;
  font-weight: 600;
  opacity: 1;
}

/* --- Back row ---------------------------------------------- */

.back-row {
  margin-top: 24px;
}

/* --- Keskustelutehtäväkortit -------------------------------- */
/* Liitä tämä components.css-tiedoston loppuun               */

.keskustelu-kortti:hover {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.18) !important;
  transform: translateY(-2px) !important;
}
/* --- Keskustelutehtäväkortit -------------------------------- */
/* Liitä tämä components.css-tiedoston loppuun               */

.keskustelu-kortti:hover {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.18) !important;
  transform: translateY(-2px) !important;
}

/* --- Vihkotehtäväkortit ------------------------------------ */
.vihko-kortti:hover {
  box-shadow: 4px 4px 14px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-2px) !important;
}
