/* =====================================================================
   STUDENT PORTAL & LMS STYLESHEET (portal.css)
   ===================================================================== */

.portal-layout {
  display: flex;
  min-height: calc(100vh - 75px);
  background-color: #F8FAFC;
}

/* Sidebar */
.portal-sidebar {
  width: 260px;
  background-color: #0F172A;
  color: #94A3B8;
  padding: 2rem 1.25rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.portal-user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #1E293B;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #0284C7, #0D9488);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  overflow: hidden;
}

.user-meta .user-name {
  font-weight: 700;
  color: #FFFFFF;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-meta .user-tier {
  font-size: 0.75rem;
  color: #38BDF8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portal-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: auto;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: #94A3B8;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.portal-nav-link:hover {
  background-color: #1E293B;
  color: #FFFFFF;
}

.portal-nav-link.active {
  background-color: #0284C7;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.portal-nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.portal-sidebar-footer {
  padding-top: 1.5rem;
  border-top: 1px solid #1E293B;
}

/* Main Content Area */
.portal-main {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

/* Dashboard Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.metric-icon.blue { background: #E0F2FE; color: #0284C7; }
.metric-icon.teal { background: #CCFBF1; color: #0D9488; }
.metric-icon.amber { background: #FEF3C7; color: #D97706; }
.metric-icon.purple { background: #F3E8FF; color: #9333EA; }

.metric-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
}

.metric-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Video Lessons Grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #BAE6FD;
}

.video-thumb {
  background: #0F172A;
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.video-play-btn {
  width: 56px;
  height: 56px;
  background: rgba(2, 132, 199, 0.9);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.video-card:hover .video-play-btn {
  transform: scale(1.1);
  background: #0284C7;
}

.video-duration {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.video-badge-status {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-completed {
  background-color: #10B981;
  color: #FFFFFF;
}

.badge-in-progress {
  background-color: #F59E0B;
  color: #FFFFFF;
}

.badge-new {
  background-color: #64748B;
  color: #FFFFFF;
}

.video-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-topic {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
}

.video-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.video-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex: 1;
}

/* Video Player Page */
.player-container {
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  box-shadow: var(--shadow-xl);
  margin-bottom: 1.5rem;
}

.player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

/* Practice Exam Questions */
.quiz-container {
  max-width: 850px;
}

.question-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.question-number {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
}

.question-marks {
  background: #FEF3C7;
  color: #B45309;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.question-prompt {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  white-space: pre-line;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: #334155;
  background: #FFFFFF;
}

.option-item:hover {
  border-color: #38BDF8;
  background: #F0F9FF;
}

.option-item.selected {
  border-color: var(--color-accent);
  background: #E0F2FE;
  color: #0369A1;
}

.option-item input[type="radio"] {
  accent-color: var(--color-accent);
  width: 18px;
  height: 18px;
}

/* Feedback & Mark Scheme Box */
.feedback-box {
  display: none;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border-left: 4px solid transparent;
}

.feedback-box.correct {
  display: block;
  background: #ECFDF5;
  border-color: var(--color-success);
  color: #065F46;
}

.feedback-box.incorrect {
  display: block;
  background: #FEF2F2;
  border-color: var(--color-danger);
  color: #991B1B;
}

.feedback-explanation {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Admin Table */
.data-table-container {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

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

.data-table th {
  background: #F8FAFC;
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: #334155;
}

.data-table tr:hover td {
  background: #F8FAFC;
}

.progress-bar-bg {
  width: 100px;
  height: 8px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-teal);
  border-radius: var(--radius-full);
}

/* Responsive Portal Layout */
@media (max-width: 900px) {
  .portal-layout {
    flex-direction: column;
  }
  .portal-sidebar {
    width: 100%;
    padding: 1.25rem;
  }
  .portal-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .portal-main {
    padding: 1.5rem;
  }
}
