/* ============================================================
   Shared component styles — Shikshawith design system.
   Loaded globally by root-config (index.ejs) so every
   micro-frontend (app, quiz, network, web, public…) can use
   these classes for a consistent look.

   NOTE: keep this file in sync with each MFE's local copy
   (e.g. app-ui/src/scss/global.scss `.g-card` section).
   ============================================================ */

/* ── Grid cards ─────────────────────────────────────────────
   Gentle uplift for legacy grid cards still using bootstrap
   `.card`. Scoped to the shared grid view so modals / dashboard
   / form cards are untouched. */
.gridview-container .card {
  border: 1px solid #e8ecf2;
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gridview-container .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.1);
  border-color: #d6e0ee;
}

/* Reusable modern card design (opt-in). Use `.g-card` instead of
   `.card`. Accent color is driven per-card via `--g-accent`. */
.g-card {
  --g-accent: #5472ff;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.g-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.1);
  border-color: color-mix(in srgb, var(--g-accent) 45%, #e8ecf2);
}

.g-card__accent {
  height: 4px;
  background: color-mix(in srgb, var(--g-accent) 85%, black);
}

.g-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 1rem 1.1rem 0.9rem;
}

.g-card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1a2233;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.g-card__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2457ff;
  background: #eaf2ff;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.g-card__count i {
  font-size: 0.72rem;
  opacity: 0.85;
}

.g-card__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--g-accent) 75%, black);
  background: color-mix(in srgb, var(--g-accent) 18%, white);
  border: 1px solid color-mix(in srgb, var(--g-accent) 35%, white);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.g-card__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e8ecf2;
  background: #f7f9fc;
  padding: 4px;
}

.g-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.g-card__meta-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: #5a6478;
  min-width: 0;
}

.g-card__meta-row span {
  min-width: 0;
}

.g-card__meta-icon {
  width: 1rem;
  text-align: center;
  color: #98a2b3;
  flex-shrink: 0;
}

.g-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.45rem;
  margin-top: 0.85rem !important;
  border-top: 1px solid #f0f2f6;
}

.g-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #98a2b3;
}

.g-card__stat i {
  font-size: 1rem;
}

.g-card__stat.is-active {
  color: #12b76a;
}

.g-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

.g-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: #667085;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.g-card__action:hover {
  background: #f1f4f9;
  color: #2457ff;
}

.g-card__action .text-danger,
.g-card__action .text-success {
  color: inherit !important;
}

.g-card__action i {
  font-size: 0.95rem;
}

@media (max-width: 400px) {
  .g-card__body {
    padding: 0.85rem 0.9rem;
  }

  .g-card__title {
    font-size: 0.95rem;
  }
}
