:root {
  --lms-bg: #f8fafc;
  --lms-surface: #fff;
  --lms-line: #e5e7eb;
  --lms-text: #0f172a;
  --lms-accent: rgb(23 123 254);
}

/* LMS general */
.lms-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.lms-card {
  background: var(--lms-surface);
  border: 1px solid var(--lms-line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 6%);
  padding: 20px;
}

.lms-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.lms-title {
  font-size: clamp(20px, 2.4vw, 28px);
  margin: 0 0 12px;
  color: var(--lms-text);
}

.lms-sub {
  color: #475569;
  margin: 0 0 24px;
}

/* module card */
.lms-module {
  border: 1px solid var(--lms-line);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lms-module .name {
  font-weight: 600;
}

.lms-module .meta {
  font-size: 12px;
  color: #64748b;
}

.lms-module .actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.lms-btn {
  appearance: none;
  border: 1px solid var(--lms-line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.lms-btn.primary {
  border-color: transparent;
  background: var(--lms-accent);
  color: #fff;
}

/* player */
.lms-player {
  background: var(--lms-bg);
  min-height: 60vh;
  padding: 12px;
}

.lms-player .block {
  background: #fff;
  border: 1px solid var(--lms-line);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}

/* === Shared Module Preview Card (same as admin preview) === */
.module-preview-card {
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgb(0 0 0 / 6%), 0 0 0 2px var(--mod-accent, #177BFE) inset;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .12s ease;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  position: relative;
}

.module-preview-card:hover {
  box-shadow: 0 12px 28px rgb(0 0 0 / 12%), 0 0 0 2px var(--mod-accent, #177BFE) inset;
}

.module-preview-card .mpc-accent {
  height: 6px;
  background: var(--mod-accent, #177BFE);
}

.module-preview-card .mpc-body {
  padding: 14px 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.module-preview-card .mpc-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 84px;
}

.module-preview-card .mpc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: color-mix(in srgb, var(--mod-accent, #177BFE) 85%, #000 0%);
}

@supports not (background: color-mix(in srgb, #000, #fff)) {
  .module-preview-card .mpc-icon {
    background: var(--mod-accent, #177BFE);
  }
}

.module-preview-card .mpc-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  margin: 6px 0 0;
  color: #111;
  min-height: 2.4em;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-preview-card .mpc-sub {
  font-size: .75rem;
  color: #6b7280;
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-preview-card .mpc-subtitle {
  margin: 4px 0 8px;
  font-size: 14px;
  color: #666;
  line-height: 1.4;
  min-height: calc(1.4em * 5);
  display: -webkit-box;
  line-clamp: 5;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-preview-card .mpc-desc {
  margin: 10px 0 4px;
  color: #374151;
  font-size: .9rem;
}

.module-preview-card .mpc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
  min-height: 28px;
}

.module-preview-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
}

.module-preview-card .badge-free {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.module-preview-card .badge-paid {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.module-preview-card .badge-schools {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.module-preview-card .mpc-actions {
  margin-top: auto;
  display: flex;
  justify-content: center;
}

.module-preview-card .btn.primary {
  background: var(--mod-accent, #177BFE);
  border-color: var(--mod-accent, #177BFE);
  color: #fff;
}

/* Skeleton specifics */
.module-preview-card .mpc-icon-wrap {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: #F3F8FF;
  overflow: hidden;
}

.module-preview-card .mpc-cta {
  margin-top: 6px;
  margin-left: auto;
  margin-right: auto;
  width: auto;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--mod-accent, #177BFE);
  color: #fff;
  font-weight: 800;
  border: 1px solid var(--mod-accent, #177BFE);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.module-preview-card .mpc-cta:hover {
  opacity: .95;
}

.module-preview-card .mpc-cta:focus-visible {
  outline: 2px solid #0b6ad8;
  outline-offset: 2px;
}

/* Grid container for dashboard modules */

.dashboard-wrap .modules-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
  place-items: stretch;
}

.dashboard-wrap .modules-grid .module-preview-card {
  height: 100%;
}

/* Dashboard header and spacing */

.dashboard-wrap {
  margin-top: 24px;
  margin-bottom: 48px;
}

.dashboard-wrap .dashboard-head {
  text-align: center;
  margin-bottom: 12px;
}

.dashboard-wrap .dashboard-head h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  margin: 0 0 6px;
}

.dashboard-wrap .dashboard-head .hint {
  color: #64748b;
  font-size: 14px;
}

.dashboard-wrap .dashboard-modules {
  margin-top: 16px;
}

/* Subtle line above footer */
#footer-szkoly {
  border-top: 1px solid #e9eef5;
}
