/* ==========================================================================
   UK CARE LEARNING PLATFORM - LEARNER PORTAL STYLES
   Visual Direction: Modern SaaS Dashboard matching NavikX EdTech reference
   ========================================================================== */

.learner-app {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-light);
  color: var(--text-main);
  overflow-x: hidden;
}

/* ==========================================================================
   LEARNER SIDEBAR
   ========================================================================== */
.learner-sidebar {
  width: 260px;
  background-color: var(--primary-navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1050;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: 4px 0 16px rgba(7, 27, 73, 0.1);
}

.learner-sidebar::-webkit-scrollbar {
  width: 5px;
}

.learner-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-brand-box {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-box .brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
}

.sidebar-nav-container {
  padding: 16px 12px;
  flex-grow: 1;
}

.sidebar-nav-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  padding: 12px 14px 6px 14px;
}

.sidebar-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav-item {
  margin-bottom: 3px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.sidebar-nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-nav-link:hover i {
  color: var(--golden-accent);
}

.sidebar-nav-link.active {
  background-color: var(--royal-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(49, 86, 217, 0.35);
}

.sidebar-nav-link.active i {
  color: #ffffff;
}

.sidebar-user-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #F87171;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* ==========================================================================
   MAIN LEARNER CONTENT AREA
   ========================================================================== */
.learner-main {
  flex-grow: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Learner Top Navigation */
.learner-topbar {
  height: 72px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.25rem;
  cursor: pointer;
}

.topbar-search-box {
  width: 340px;
  position: relative;
}

.topbar-search-box input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: var(--bg-light);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.topbar-search-box input:focus {
  border-color: var(--royal-blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(49, 86, 217, 0.15);
}

.topbar-search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-icon-btn:hover {
  background: var(--royal-blue-light);
  color: var(--royal-blue);
}

.badge-unread-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #ffffff;
}

/* User Profile Pill in Topbar */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--royal-blue);
}

.user-pill-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}

.user-pill-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary-navy);
}

.user-pill-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Learner Body Container */
.learner-content-body {
  padding: 30px;
  flex-grow: 1;
}

/* ==========================================================================
   DASHBOARD CARDS & STATS
   ========================================================================== */
.learner-welcome-header {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.welcome-text-group h2 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.welcome-text-group p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.95rem;
}

/* Overall Progress Ring Widget */
.progress-ring-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-light);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.progress-ring-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-ring-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--royal-blue);
  line-height: 1;
}

/* 4 KPI Stat Cards */
.kpi-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

.kpi-icon-blue { background: var(--royal-blue-light); color: var(--royal-blue); }
.kpi-icon-cyan { background: var(--info-light); color: var(--info); }
.kpi-icon-green { background: var(--success-light); color: var(--success); }
.kpi-icon-gold { background: var(--golden-light); color: #D99B00; }

.kpi-info-box .kpi-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.kpi-info-box .kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary-navy);
  line-height: 1;
  margin: 0;
}

/* Continue Learning Featured Card */
.continue-learning-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 20px;
  align-items: center;
}

.continue-course-thumb {
  width: 130px;
  height: 95px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.continue-course-info {
  flex-grow: 1;
}

.continue-course-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 4px;
}

.continue-module-name {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.progress-bar-wrapper {
  margin-bottom: 14px;
}

.progress-custom {
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  overflow: hidden;
}

.progress-bar-royal {
  background: linear-gradient(90deg, var(--royal-blue) 0%, #60A5FA 100%);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   COURSE LEARNING PLAYER
   ========================================================================== */
.player-container {
  display: flex;
  gap: 24px;
  margin-top: 10px;
}

.player-main-col {
  flex: 1 1 70%;
  min-width: 0;
}

.player-sidebar-col {
  flex: 0 0 340px;
  max-width: 360px;
}

/* Mock Video View */
.video-frame-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-frame-box img.video-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.video-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #ffffff;
}

.video-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}

.video-progress-filled {
  width: 45%;
  height: 100%;
  background: var(--golden-accent);
  border-radius: 4px;
}

.video-buttons-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-control-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  padding: 4px;
}

.video-control-btn:hover {
  color: var(--golden-accent);
  transform: scale(1.1);
}

.lesson-info-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.lesson-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--success-light);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 14px;
}

/* Course Modules Sidebar */
.course-modules-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.course-modules-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-accordion-item {
  border-bottom: 1px solid var(--border-light);
}

.module-title-btn {
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  background: transparent;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s ease;
}

.module-title-btn:hover {
  background: var(--bg-subtle);
}

.lesson-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 10px 32px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.lesson-item-link:hover {
  background: var(--bg-light);
  color: var(--royal-blue);
}

.lesson-item-link.active {
  background: var(--royal-blue-light);
  color: var(--royal-blue);
  font-weight: 600;
}

.lesson-item-link.completed i {
  color: var(--success);
}

/* ==========================================================================
   EXAMINATION & ASSESSMENT SYSTEM
   ========================================================================== */
.exam-container {
  max-width: 1000px;
  margin: 0 auto;
}

.exam-header-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.exam-timer-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--warning-light);
  color: #B45309;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1.05rem;
}

.exam-timer-box.timer-pulsing {
  animation: pulseGlow 1.5s infinite;
}

.exam-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 36px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 28px;
  line-height: 1.5;
}

.exam-choice-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exam-choice-option:hover {
  border-color: var(--royal-blue);
  background-color: var(--royal-blue-light);
}

.exam-choice-option.selected {
  border-color: var(--royal-blue);
  background-color: var(--royal-blue-light);
  box-shadow: 0 0 0 1px var(--royal-blue);
}

.choice-radio {
  width: 20px;
  height: 20px;
  accent-color: var(--royal-blue);
  flex-shrink: 0;
}

.choice-label-text {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-main);
  margin: 0;
}

/* Question Overview Grid */
.question-grid-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.question-number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.btn-qnum {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-light);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-qnum.active {
  border-color: var(--royal-blue);
  background: var(--royal-blue);
  color: #ffffff;
}

.btn-qnum.answered {
  background: var(--royal-blue-light);
  border-color: var(--royal-blue);
  color: var(--royal-blue);
}

/* ==========================================================================
   CERTIFICATE DESIGN & PREVIEW
   ========================================================================== */
.certificate-preview-wrapper {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.certificate-document {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  aspect-ratio: 1.414 / 1; /* Standard A4 landscape ratio */
  background: #FFFFFF;
  border: 12px solid #071B49;
  outline: 4px solid #FFC928;
  outline-offset: -8px;
  padding: 45px 50px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(7, 27, 73, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.certificate-document::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(#071B49 0.75px, transparent 0.75px);
  background-size: 24px 24px;
  opacity: 0.04;
  pointer-events: none;
}

.cert-header-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cert-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.cert-statement {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}

.cert-recipient {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  font-weight: 700;
  color: var(--royal-blue);
  border-bottom: 2px solid var(--golden-accent);
  display: inline-block;
  padding: 0 30px 4px 30px;
  margin-bottom: 14px;
}

.cert-course-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 18px;
}

.cert-footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 14px;
}

.cert-meta-item {
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cert-signature-box {
  text-align: center;
}

.cert-signature-img {
  font-family: 'Playfair Display', cursive, serif;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--primary-navy);
  border-bottom: 1px solid var(--primary-navy);
  padding: 0 20px 4px 20px;
}

.cert-signature-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.cert-qr-box {
  text-align: right;
}

.cert-qr-img {
  width: 65px;
  height: 65px;
  border: 1px solid var(--border-color);
  padding: 3px;
  background: #ffffff;
}

/* Print Rules */
@media print {
  body * {
    visibility: hidden;
  }
  .certificate-document, .certificate-document * {
    visibility: visible;
  }
  .certificate-document {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-width: 8px !important;
    box-shadow: none !important;
  }
}
