/* ================================================================
   SOLE Student Portal — Premium Design System & Styles
   Designed to match reference dashboard layout with high visual fidelity
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* Color Palette */
  --sidebar-bg: #0b0f19;
  --sidebar-surface: #111827;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-grad: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  --sidebar-active-glow: 0 4px 20px rgba(99, 102, 241, 0.35);

  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --hero-grad: linear-gradient(135deg, #1e1b4b 0%, #2e1065 40%, #312e81 100%);
  --hero-glow: 0 10px 30px rgba(49, 46, 129, 0.25);

  --accent-purple: #7c3aed;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-blue: #0284c7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --sidebar-width: 260px;
  --header-height: 72px;
  --transition-fast: 0.18s ease;
  --transition-base: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--body-bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================================================================
   App Layout
   ================================================================ */
.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: transform var(--transition-base);
}

.sidebar-brand {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand img {
  height: 42px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
}

.sidebar-brand-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.sidebar-brand-text span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-indigo);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 10px 12px 4px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--sidebar-text);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-hover);
}

.nav-item:hover svg {
  opacity: 1;
}

.nav-item.active {
  background: var(--sidebar-active-grad);
  color: #ffffff;
  box-shadow: var(--sidebar-active-glow);
  font-weight: 600;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
}

.nav-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  color: #f43f5e;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.nav-logout:hover {
  background: rgba(244, 63, 94, 0.1);
}

/* Main Area */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
}

/* Topnav */
.app-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.user-profile-menu:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.user-avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e1b4b 0%, #6366f1 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-meta-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-meta-id {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Page Content */
.page-container {
  padding: 28px 32px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ================================================================
   Dashboard Specific Styles (Matching Reference Screenshot)
   ================================================================ */

/* Hero Section Grid */
.dashboard-hero-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 20px;
}

.student-hero-card {
  background: var(--hero-grad);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: #ffffff;
  box-shadow: var(--hero-glow);
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.student-hero-card::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  border-radius: 999px;
  pointer-events: none;
}

.student-hero-avatar-box {
  width: 96px;
  height: 96px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  flex-shrink: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.student-hero-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.student-hero-name {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.student-hero-course {
  font-size: 0.86rem;
  color: #cbd5e1;
  font-weight: 500;
  margin-top: -10px;
}

.student-hero-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 14px;
}

.hero-meta-col {
  display: flex;
  flex-direction: column;
}

.hero-meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 2px;
}

.hero-meta-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

/* Status Card */
.status-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.status-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #f5f3ff;
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.status-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.status-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.status-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #059669;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.status-pill-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #10b981;
}

.status-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Stat Cards Row */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.stat-pill-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-pill-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-pill-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-pill-icon.purple {
  background: #ede9fe;
  color: #7c3aed;
}

.stat-pill-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.stat-pill-icon.blue {
  background: #e0f2fe;
  color: #0284c7;
}

.stat-pill-icon.amber {
  background: #fef3c7;
  color: #d97706;
}

.stat-pill-icon.indigo {
  background: #e0e7ff;
  color: #4f46e5;
}

.stat-pill-info {
  display: flex;
  flex-direction: column;
}

.stat-pill-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-pill-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

/* Tables Section */
.content-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.content-card-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
}

.content-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.content-card-action {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  gap: 4px;
}

.content-card-action:hover {
  text-decoration: underline;
}

/* Custom Table */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.sole-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.sole-table th {
  background: #f8fafc;
  padding: 14px 24px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--card-border);
}

.sole-table td {
  padding: 16px 24px;
  font-size: 0.86rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.sole-table tbody tr:hover {
  background: #f8fafc;
}

.sole-table tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  padding: 48px 24px !important;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-paid {
  background: #dcfce7;
  color: #15803d;
}

.badge-pending {
  background: #fef3c7;
  color: #b45309;
}

.badge-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-course {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-ebook {
  background: #e0f2fe;
  color: #0369a1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.btn-primary {
  background: var(--sidebar-active-grad);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--card-border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Alerts */
.alert-box {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Footer */
.app-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--card-border);
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
}

/* ================================================================
   Secure Video Classroom Player & Anti-Piracy Watermark
   ================================================================ */
.video-classroom-wrap {
  display: grid;
  grid-template-columns: 2.8fr 1.2fr;
  gap: 24px;
}

.video-player-container {
  background: #000000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xl);
  aspect-ratio: 16 / 9;
}

.video-player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Dynamic Anti-Piracy Floating Watermark */
.video-watermark-overlay {
  position: absolute;
  top: 18%;
  left: 20%;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  pointer-events: none;
  user-select: none;
  z-index: 20;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  transition: top 3s ease, left 3s ease;
}

.video-meta-bar {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-lecture-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.video-course-crumb {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Curriculum Drawer */
.curriculum-drawer {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 700px;
}

.curriculum-drawer-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  font-weight: 700;
  font-size: 0.95rem;
}

.curriculum-drawer-body {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}

.playlist-lecture-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.playlist-lecture-item:hover {
  background: #f1f5f9;
}

.playlist-lecture-item.active {
  background: #ede9fe;
  color: var(--accent-purple);
  font-weight: 600;
}

.playlist-lecture-item.completed .lec-status-icon {
  color: #10b981;
}

/* Responsive */
@media (max-width: 1200px) {
  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }

  .stat-cards-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .video-classroom-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
    width: 100%;
  }

  .stat-cards-row {
    grid-template-columns: 1fr;
  }

  .student-hero-card {
    flex-direction: column;
    text-align: center;
  }

  .student-hero-meta-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================================================
   Page & Media Loading Animation (Matching Reference Screenshot)
   ================================================================ */
.page-preloader {
  position: fixed;
  inset: 0;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  opacity: 1;
  visibility: visible;
}

.page-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid #f1f5f9;
  border-top-color: #2c68e0;
  border-right-color: #2c68e0;
  animation: sole-spin 0.85s linear infinite;
}

@keyframes sole-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Video Player In-Stream Buffering Overlay */
.video-buffer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
}

.video-buffer-overlay.active {
  display: flex;
}

.video-buffer-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  animation: sole-spin 0.8s linear infinite;
}