/* ========================================
   Goodwill Learning Centre - Dashboard Styles
   ======================================== */

/* --- Auth loading state: hide sidebar content until role is confirmed --- */
body.auth-loading #studentSidebarSection,
body.auth-loading #adminSidebarSection,
body.auth-loading [id$="Link"] {
  display: none !important;
}
body.auth-loading .sidebar-nav::after {
  content: '';
  display: block;
  padding: 1rem;
  margin: 0.5rem;
  height: 200px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--muted) 25%, transparent 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: sidebar-shimmer 1.5s infinite;
}
@keyframes sidebar-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Dashboard Header --- */
.dashboard-header {
  margin-bottom: 2.5rem;
}

.dashboard-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-header-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.dashboard-header-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.dashboard-header-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
}

.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-header-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.dashboard-header-date i {
  color: var(--primary);
}

/* --- Stat Cards --- */
.stat-card-value {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.stat-card-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-card-icon-wrap {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.stat-card-info {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.125rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 0;
}

.stat-card-value small {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: 0;
}

/* Stat card color themes */
.stat-card.stat-blue::before { background: linear-gradient(90deg, #3B82F6, #2563EB); }
.stat-card.stat-blue .stat-card-icon-wrap { background: rgba(37, 99, 235, 0.12); color: #2563EB; }
.stat-card.stat-blue .stat-card-value { color: #1D4ED8; }

.stat-card.stat-purple::before { background: linear-gradient(90deg, #8B5CF6, #7C3AED); }
.stat-card.stat-purple .stat-card-icon-wrap { background: rgba(124, 58, 237, 0.12); color: #7C3AED; }
.stat-card.stat-purple .stat-card-value { color: #6D28D9; }

.stat-card.stat-green::before { background: linear-gradient(90deg, #34D399, #059669); }
.stat-card.stat-green .stat-card-icon-wrap { background: rgba(5, 150, 105, 0.12); color: #059669; }
.stat-card.stat-green .stat-card-value { color: #047857; }

.stat-card.stat-orange::before { background: linear-gradient(90deg, #FB923C, #EA580C); }
.stat-card.stat-orange .stat-card-icon-wrap { background: rgba(234, 88, 12, 0.12); color: #EA580C; }
.stat-card.stat-orange .stat-card-value { color: #C2410C; }

.stat-card.stat-pink::before { background: linear-gradient(90deg, #F472B6, #DB2777); }
.stat-card.stat-pink .stat-card-icon-wrap { background: rgba(219, 39, 119, 0.12); color: #DB2777; }
.stat-card.stat-pink .stat-card-value { color: #BE185D; }

.stat-card.stat-teal::before { background: linear-gradient(90deg, #2DD4BF, #0D9488); }
.stat-card.stat-teal .stat-card-icon-wrap { background: rgba(13, 148, 136, 0.12); color: #0D9488; }
.stat-card.stat-teal .stat-card-value { color: #0F766E; }

/* --- Section Headers --- */
.section-header-with-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-header-with-line h2 {
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
}

.section-header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* --- Quick Actions --- */
.quick-actions-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.quick-action-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.quick-action-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.quick-action-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.quick-action-card:hover::after {
  opacity: 1;
}

.quick-action-card-inner {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.quick-action-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.quick-action-card:hover .quick-action-icon {
  transform: scale(1.1);
}

.quick-action-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--foreground);
}

.quick-action-card:hover .quick-action-label {
  color: var(--primary);
}

/* Quick action icon colors cycle */
.qa-color-1 .quick-action-icon { background: rgba(37, 99, 235, 0.12); color: #2563EB; }
.qa-color-1::after { background: #2563EB; }
.qa-color-2 .quick-action-icon { background: rgba(124, 58, 237, 0.12); color: #7C3AED; }
.qa-color-2::after { background: #7C3AED; }
.qa-color-3 .quick-action-icon { background: rgba(5, 150, 105, 0.12); color: #059669; }
.qa-color-3::after { background: #059669; }
.qa-color-4 .quick-action-icon { background: rgba(234, 88, 12, 0.12); color: #EA580C; }
.qa-color-4::after { background: #EA580C; }
.qa-color-5 .quick-action-icon { background: rgba(219, 39, 119, 0.12); color: #DB2777; }
.qa-color-5::after { background: #DB2777; }
.qa-color-6 .quick-action-icon { background: rgba(13, 148, 136, 0.12); color: #0D9488; }
.qa-color-6::after { background: #0D9488; }
.qa-color-7 .quick-action-icon { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.qa-color-7::after { background: #F59E0B; }
.qa-color-8 .quick-action-icon { background: rgba(239, 68, 68, 0.12); color: #EF4444; }
.qa-color-8::after { background: #EF4444; }
.qa-color-9 .quick-action-icon { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.qa-color-9::after { background: #3B82F6; }
.qa-color-10 .quick-action-icon { background: rgba(16, 185, 129, 0.12); color: #10B981; }
.qa-color-10::after { background: #10B981; }
.qa-color-11 .quick-action-icon { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }
.qa-color-11::after { background: #8B5CF6; }

/* --- Recent Enrollments Table --- */
.enrollments-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.enrollments-card:hover {
  box-shadow: var(--shadow-md);
}

.enrollments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), transparent);
}

.enrollments-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.enrollments-header-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.enrollments-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.enrollments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.enrollments-table thead th {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  background: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.enrollments-table tbody td {
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.enrollments-table tbody tr:last-child td {
  border-bottom: none;
}

.enrollments-table tbody tr {
  transition: background-color 0.15s ease;
}

.enrollments-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.enrollments-table tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.3);
}

.enrollments-table tbody tr:nth-child(even):hover {
  background: rgba(37, 99, 235, 0.04);
}

.enrollment-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.enrollment-status i {
  font-size: 0.5rem;
}

.enrollment-status.status-active {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.enrollment-status.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #D97706;
}

.enrollment-status.status-completed {
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
}

.enrollment-status.status-cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

.enrollment-student {
  font-weight: 600;
  color: var(--foreground);
}

.enrollment-course {
  color: var(--muted-foreground);
}

.enrollment-date {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

/* Empty state for enrollments */
.enrollments-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted-foreground);
}

.enrollments-empty i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

/* --- Page greeting animation --- */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-header-inner {
  animation: fadeSlideDown 0.4s ease both;
}

.stats-grid > .stat-card {
  animation: fadeSlideDown 0.4s ease both;
}

.stats-grid > .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid > .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid > .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid > .stat-card:nth-child(4) { animation-delay: 0.2s; }
.stats-grid > .stat-card:nth-child(5) { animation-delay: 0.25s; }
.stats-grid > .stat-card:nth-child(6) { animation-delay: 0.3s; }

.quick-card {
  display: block;
  transition: border-color 0.2s ease;
}

.quick-card:hover {
  border-color: var(--primary);
}

.quick-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-card-title {
  font-weight: 500;
  margin-top: 0.75rem;
}

.quick-card-desc {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Continue watching */
.continue-card {
  cursor: pointer;
}

/* Recent updates */
.update-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.update-item:last-child {
  border-bottom: none;
}

.update-title {
  font-weight: 500;
}

.update-date {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Follow us */
.follow-card {
  display: block;
}

.follow-card:hover {
  border-color: var(--primary);
}

/* Available classes */
.class-card .grade-badge {
  display: inline-block;
  font-size: 0.75rem;
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--accent-foreground);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
}

.class-card .class-title {
  font-weight: 600;
  margin-top: 0.5rem;
}

.class-card .class-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.class-card .class-schedule {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.class-card .class-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.class-card .class-price {
  font-weight: 700;
  color: var(--primary);
}

/* Study materials */
.material-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
}

.material-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.material-info {
  flex: 1;
  min-width: 0;
}

.material-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-course {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lesson view */
.lesson-video-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background-color: var(--secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}

.video-locked {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background-color: var(--secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}

.lesson-sidebar-item {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lesson-sidebar-item:hover {
  background-color: rgba(241, 245, 249, 0.6);
}

.lesson-sidebar-item.active {
  background-color: var(--secondary);
  border-color: var(--accent);
}

.lesson-sidebar-item .lesson-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson-sidebar-item .lesson-title {
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-sidebar-item .lesson-views {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Embed video */
.video-embed {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #000;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}
