/* Dashboard styles */

.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 72px);
  background: #f8fafc;
}
@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}

.dashboard-sidebar {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 2rem 1.5rem;
}
@media (max-width: 900px) {
  .dashboard-sidebar { border-right: 0; border-bottom: 1px solid #e2e8f0; padding: 1.25rem; }
}

.dashboard-user {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}
.dashboard-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--skymed-100, #d4e3f5);
  color: var(--skymed, #598dd1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
}
.dashboard-user-name { font-size: 1rem; font-weight: 700; color: #0f172a; margin-bottom: 0.25rem; }
.dashboard-user-mail { font-size: 0.85rem; color: #64748b; }

.dashboard-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #475569;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.sidebar-nav-item:hover { background: #f1f5f9; color: var(--skymed, #598dd1); }
.sidebar-nav-item.active {
  background: var(--skymed-100, #d4e3f5);
  color: var(--skymed-800, #2d5494);
}
.sidebar-nav-item--logout {
  margin-top: 1rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
  color: #94a3b8;
}
.sidebar-nav-item--logout:hover { color: #dc2626; background: #fef2f2; }

.dashboard-main {
  padding: 2.5rem 2rem;
}
@media (max-width: 768px) {
  .dashboard-main { padding: 1.5rem 1rem; }
}

.dashboard-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}
.dashboard-subtitle {
  color: #64748b;
  margin: 0 0 2rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
}
.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.875rem;
}
.stat-card-icon--blue   { background: #d4e3f5; color: var(--skymed, #598dd1); }
.stat-card-icon--green  { background: #d1fae5; color: #059669; }
.stat-card-icon--yellow { background: #fef3c7; color: #d97706; }
.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 0.375rem;
}
.stat-card-label { font-size: 0.875rem; color: #64748b; }

.dashboard-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.dashboard-section-head h2 {
  font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0;
}

.empty-state {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 3rem 1.5rem;
  text-align: center;
}
.empty-icon {
  width: 64px; height: 64px;
  background: #f1f5f9; color: #94a3b8;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
}
.empty-state h3 { font-size: 1.125rem; color: #0f172a; margin: 0 0 0.5rem; }
.empty-state p { color: #64748b; margin: 0 0 1.5rem; }

.enrollment-list { display: flex; flex-direction: column; gap: 1rem; }
.enrollment-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
}
@media (max-width: 640px) {
  .enrollment-card { grid-template-columns: 1fr; }
}
.enrollment-image {
  border-radius: 8px;
  overflow: hidden;
  height: 100px;
}
@media (max-width: 640px) {
  .enrollment-image { height: 160px; }
}
.enrollment-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.enrollment-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.5rem;
}
.enrollment-title {
  font-size: 1rem; font-weight: 700; color: #0f172a; text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.enrollment-title:hover { color: var(--skymed, #598dd1); }
.enrollment-status {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem; font-weight: 600;
  border-radius: 999px;
}
.enrollment-status--active { background: #d4e3f5; color: var(--skymed-800, #2d5494); }
.enrollment-status--completed { background: #d1fae5; color: #065f46; }
.enrollment-meta {
  display: flex; gap: 0.875rem; font-size: 0.85rem; color: #64748b;
  margin-bottom: 0.875rem;
}
.enrollment-progress { margin-bottom: 0.875rem; }
.progress-head {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: #64748b;
  margin-bottom: 0.375rem;
}
.progress-head strong { color: #0f172a; }
.progress-bar {
  height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--skymed, #598dd1), var(--skymed-700, #3a6bb5));
  border-radius: 999px;
  transition: width 0.4s;
}
.enrollment-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.enrollment-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  text-decoration: none;
}

/* Certificates grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.cert-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.cert-card:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.cert-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: var(--skymed-100, #d4e3f5); color: var(--skymed, #598dd1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.cert-card h3 {
  font-size: 1rem; font-weight: 700; color: #0f172a;
  margin: 0 0 0.25rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cert-number { font-size: 0.85rem; color: #64748b; margin: 0 0 0.625rem; }
.cert-meta { display: flex; gap: 0.625rem; align-items: center; flex-wrap: wrap; }
.cert-date { font-size: 0.85rem; color: #94a3b8; }

/* Profile */
.profile-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.profile-card h2 {
  font-size: 1.125rem; font-weight: 700; color: #0f172a;
  margin: 0 0 1rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.profile-field label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.profile-field p {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

/* ----- Edit profile form ----- */
.profile-card--form .skymed-profile-form > div + div { margin-top: 1rem; }

.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1.25rem;
}
.profile-avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #2d5494, #1e3a8a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.18);
}
.profile-avatar-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.profile-avatar-initial {
  color: #fff;
  font-size: 2.25rem;
  font-weight: 700;
}

.dashboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1rem;
  background: #f8fafc;
}
.profile-fieldset > legend {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
  padding: 0 0.5rem;
}
.profile-fieldset .form-item {
  margin-bottom: 0.75rem;
}
.profile-fieldset .form-item:last-child { margin-bottom: 0; }
.profile-fieldset label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.25rem;
}
.profile-fieldset .form-required {
  color: #dc2626;
  text-decoration: none;
}
.profile-fieldset input[type="text"],
.profile-fieldset input[type="tel"],
.profile-fieldset input[type="email"],
.skymed-profile-form input[type="text"],
.skymed-profile-form input[type="tel"],
.skymed-profile-form input[type="email"],
.skymed-profile-form input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.profile-fieldset input:focus,
.skymed-profile-form input:focus {
  outline: none;
  border-color: #598dd1;
  box-shadow: 0 0 0 4px rgba(89, 141, 209, 0.12);
}
.profile-fieldset .description,
.skymed-profile-form .description {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.skymed-profile-form .form-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}
.skymed-profile-form .form-submit {
  padding: 0.85rem 1.6rem;
  background: linear-gradient(135deg, #2d5494, #1e3a8a);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.skymed-profile-form .form-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(45, 84, 148, 0.45);
}

@media (max-width: 640px) {
  .profile-avatar-section { flex-direction: column; align-items: flex-start; }
}

/* Enroll form on course detail */
.enroll-form { margin: 0; }
.enroll-form button {
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* ============= LESSON PAGE ============= */
.lesson-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 72px);
  background: #fff;
}
@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: 1fr; }
}

.lesson-sidebar {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 2rem 1.25rem;
}
.lesson-sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin: 1.5rem 0 0.75rem;
}
.lesson-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.lesson-sidebar-list li a,
.lesson-sidebar-list li > span {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  color: #475569;
  font-size: 0.875rem;
  text-decoration: none;
  line-height: 1.4;
}
.lesson-sidebar-list li a:hover { background: #e2e8f0; color: var(--skymed, #598dd1); }
.lesson-sidebar-list li.active a {
  background: var(--skymed-100, #d4e3f5);
  color: var(--skymed-800, #2d5494);
  font-weight: 600;
}
.lesson-sidebar-list .num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: #cbd5e1; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.lesson-sidebar-list li.active .num { background: var(--skymed, #598dd1); }
.lesson-sidebar-list .ttl { flex: 1; }
.lesson-sidebar-list .badge-online {
  background: #dc2626; color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}
.lesson-sidebar-test { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #e2e8f0; }

.lesson-main {
  padding: 2.5rem 2.5rem 4rem;
  max-width: 900px;
}
@media (max-width: 768px) {
  .lesson-main { padding: 1.5rem 1rem 3rem; }
}

.lesson-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem;
}
.lesson-meta {
  display: flex; gap: 0.625rem; align-items: center;
  margin-bottom: 1.5rem;
  color: #64748b; font-size: 0.875rem;
}

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.video-wrap iframe {
  position: absolute;
  inset: 0; width: 100%; height: 100%;
  border: 0;
}

.lesson-body {
  color: #334155;
  line-height: 1.8;
  margin-bottom: 2rem;
}
.lesson-materials-title {
  font-size: 1.125rem; font-weight: 700; color: #0f172a;
  margin: 2rem 0 0.875rem;
}
.lesson-materials { list-style: none; padding: 0; margin: 0 0 2rem; }
.lesson-materials li {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.lesson-materials a { color: var(--skymed, #598dd1); text-decoration: none; }
.lesson-materials a:hover { text-decoration: underline; }

.lesson-nav {
  display: flex; justify-content: space-between;
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
  gap: 1rem;
}

.lesson-live-block {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.lesson-locked-block {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 2rem;
}
.lesson-locked-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.lesson-locked-block h2 { font-size: 1.5rem; color: #0f172a; margin: 0 0 0.5rem; }
.lesson-locked-block p { color: #64748b; margin: 0 0 1rem; }
.lesson-locked-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--skymed, #598dd1) !important;
  margin: 1rem 0 1.5rem !important;
}

/* Curriculum on course detail */
.course-curriculum {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid #e2e8f0;
}
.course-curriculum h2 {
  font-size: 1.5rem; font-weight: 700; color: #0f172a;
  margin: 0 0 1.25rem;
}
.lessons-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
  counter-reset: lesson-counter;
}
.lesson-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.lesson-row--locked { background: #f8fafc; }
.lesson-row--test { background: var(--skymed-50, #eef4fb); border-color: var(--skymed-200, #b8d2ed); }
.lesson-row-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--skymed-100, #d4e3f5); color: var(--skymed, #598dd1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem;
}
.lesson-row-info { flex: 1; }
.lesson-row-info strong { display: block; color: #0f172a; font-size: 0.95rem; }
.lesson-row-type { font-size: 0.85rem; color: #64748b; }
.lesson-row-lock { color: #94a3b8; font-size: 1.25rem; }
.btn-sm { padding: 0.375rem 0.875rem !important; font-size: 0.85rem !important; }
.btn-success { background: #16a34a; color: #fff; border: 0; }
.btn-success:hover { background: #15803d; color: #fff; }

/* ============= TEST PAGE ============= */
.test-page { padding: 2.5rem 0 5rem; background: #f8fafc; min-height: calc(100vh - 72px); }
.test-page .container { max-width: 800px; }

.test-header {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.test-header h1 { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin: 0 0 0.75rem; }
.test-meta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; font-size: 0.875rem; color: #64748b; }
.test-meta span { display: inline-flex; align-items: center; gap: 0.375rem; }

.test-timer {
  position: sticky;
  top: 1rem;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.125rem;
  text-align: center;
  margin-bottom: 1.5rem;
  z-index: 10;
  transition: background 0.3s;
}
.test-timer.warning {
  background: #dc2626;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.question-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.question-num { font-size: 0.8rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; margin-bottom: 0.5rem; }
.question-text { font-size: 1.0625rem; font-weight: 600; color: #0f172a; margin: 0 0 1.25rem; line-height: 1.5; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: #f8fafc;
  border: 2px solid transparent;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.option:hover { background: #f1f5f9; border-color: #cbd5e1; }
.option input { margin-top: 0.25rem; flex-shrink: 0; }
.option input:checked ~ .option-letter {
  background: var(--skymed, #598dd1);
  color: #fff;
  border-color: var(--skymed, #598dd1);
}
.option:has(input:checked) {
  background: var(--skymed-50, #eef4fb);
  border-color: var(--skymed, #598dd1);
}
.option-letter {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: #fff; border: 2px solid #cbd5e1;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; color: #64748b;
  transition: all 0.2s;
}
.option-text { flex: 1; color: #334155; line-height: 1.5; }

.test-submit { margin-top: 2rem; text-align: center; }

.test-passed-banner,
.test-failed-banner {
  background: #fff;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
}
.test-passed-banner { border: 2px solid #16a34a; }
.test-failed-banner { border: 2px solid #dc2626; }
.test-passed-icon,
.test-failed-icon { font-size: 4rem; margin-bottom: 1rem; }
.test-passed-banner h2 { color: #15803d; }
.test-failed-banner h2 { color: #991b1b; }

.muted { color: #94a3b8; }

/* ====== Diia verification block ====== */
.profile-card--diia.is-verified {
  border: 1px solid #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 60%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.08);
}
.diia-verified-wrap { margin-top: 1rem; }
.diia-verified-badge {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: #dcfce7;
  color: #166534;
  padding: .65rem .9rem;
  border-radius: 10px;
  font-size: .95rem;
  margin-bottom: 1rem;
}
.diia-verified-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.diia-verified-date {
  display: block;
  color: #16a34a;
  opacity: 0.85;
  font-weight: 500;
  font-size: .78rem;
  margin-top: .15rem;
}
.diia-verified-data {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 1rem;
}
.diia-verified-row {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  font-size: .92rem;
  line-height: 1.4;
  flex-wrap: wrap;
}
.diia-verified-label {
  color: #64748b;
  font-weight: 500;
  min-width: 110px;
  font-size: .82rem;
}
.diia-verified-value {
  color: #0f1f3d;
  font-weight: 600;
  flex: 1;
}
.diia-verified-mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: .02em;
}
.diia-verified-note {
  margin: 0;
  color: #64748b;
  font-size: .82rem;
  line-height: 1.5;
}
