/* =========================================================
   ANSHA MONTESSORI LMS — COMPONENTS CSS
   Login page, quiz, lesson viewer, certificates, misc
   ========================================================= */

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(145deg, #071e24 0%, #0d2d35 35%, #0e3040 65%, #091a22 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%237c3aed' fill-opacity='0.04'%3E%3Crect x='10' y='10' width='20' height='20' rx='4'/%3E%3Crect x='50' y='50' width='20' height='20' rx='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-page::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  top: -150px; left: -150px;
  pointer-events: none;
}

.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  position: relative;
  color: var(--white);
}
.login-left .brand { text-align: center; margin-bottom: var(--space-10); }
.login-left .brand-logo {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: white;
  margin: 0 auto var(--space-4);
  box-shadow: 0 8px 24px rgba(124,58,237,0.4);
  border: 2px solid rgba(255,255,255,0.15);
}
.login-left .brand h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 6px; }
.login-left .brand p { color: rgba(255,255,255,0.75); font-size: 0.9rem; }

.login-features { display: flex; flex-direction: column; gap: var(--space-4); max-width: 340px; width: 100%; }
.login-feature {
  display: flex; align-items: flex-start; gap: var(--space-3);
  background: rgba(255,255,255,0.05);
  padding: var(--space-4);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.25s ease;
}
.login-feature:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(124,58,237,0.4);
  transform: translateX(4px);
}
.login-feature .feat-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(124,58,237,0.15));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #5eead4;
  flex-shrink: 0;
  border: 1px solid rgba(124,58,237,0.25);
}
.login-feature h4 { font-size: 0.875rem; color: var(--white); margin-bottom: 2px; font-weight: 600; }
.login-feature p { font-size: 0.775rem; color: rgba(255,255,255,0.6); line-height: 1.5; }

.login-right {
  width: 480px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-8);
  box-shadow: -12px 0 60px rgba(0,0,0,0.25);
  position: relative;
  z-index: 1;
}

.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; color: var(--gray-900); }
.login-box .login-sub { color: var(--gray-500); font-size: 0.9rem; margin-bottom: var(--space-8); }

.role-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: var(--space-6);
  gap: 4px;
}
.role-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.role-tab.active {
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-group { position: relative; }
.input-group .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); font-size: 1rem; pointer-events: none;
}
.input-group .form-control { padding-left: 40px; }

.input-group .pw-toggle {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  font-size: 0.875rem;
}
.input-group .pw-toggle:hover { color: var(--primary); }

.login-footer { margin-top: var(--space-6); text-align: center; font-size: 0.8125rem; color: var(--gray-500); }
.demo-creds {
  background: linear-gradient(135deg, var(--primary-light), #f0fdfb);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  font-size: 0.8rem;
}
.demo-creds .demo-title { font-weight: 700; color: var(--primary); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.demo-creds p { color: var(--gray-600); line-height: 1.9; }
.demo-creds code { background: rgba(124,58,237,0.1); color: var(--primary-dark); padding: 1px 7px; border-radius: 4px; font-family: monospace; font-size: 0.8rem; font-weight: 600; }

/* ---- Founder Featured Card ---- */
.founder-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  max-width: 340px;
  width: 100%;
  backdrop-filter: blur(6px);
}
.founder-photo-wrap {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.45);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.founder-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  display: block;
}
.founder-info { flex: 1; min-width: 0; }
.founder-badge {
  display: inline-block;
  background: rgba(245,158,11,0.25);
  color: #fde68a;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
  border: 1px solid rgba(245,158,11,0.3);
}
.founder-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 5px;
}
.founder-quote {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  line-height: 1.4;
}

/* ---- Co-Founder Strip ---- */
.cofounder-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 4px;
  max-width: 340px;
  width: 100%;
}
.cofounder-photo-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.cofounder-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.cofounder-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.cofounder-role {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .login-page { flex-direction: column; overflow: visible; min-height: 100vh; }

  /* Left panel: compact strip at top */
  .login-left {
    width: 100%;
    padding: 20px 18px 16px;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
  }

  /* Brand row */
  .login-left .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    margin-bottom: 14px;
  }
  .login-left .brand-logo {
    width: 46px; height: 46px;
    font-size: 1.2rem;
    margin: 0;
    flex-shrink: 0;
  }
  .login-left .brand h1 { font-size: 1.15rem; margin-bottom: 2px; }
  .login-left .brand p { font-size: 0.75rem; }

  /* Hide feature list on mobile — save space */
  .login-features { display: none; }

  /* Founder card: horizontal, compact */
  .founder-card {
    flex-direction: row;
    padding: 10px 12px;
    gap: 12px;
    margin-bottom: 8px;
  }
  .founder-photo-wrap { width: 64px; height: 64px; }
  .founder-badge { font-size: 0.55rem; padding: 2px 7px; }
  .founder-name { font-size: 0.78rem; }
  .founder-quote { display: none; }

  /* Co-founder: compact pill */
  .cofounder-strip { padding: 8px 12px; }
  .cofounder-photo-wrap { width: 40px; height: 40px; }
  .cofounder-name { font-size: 0.72rem; }
  .cofounder-role { font-size: 0.58rem; }

  /* Right panel full width */
  .login-right { width: 100%; box-shadow: none; }
}

/* ---- Lesson Viewer ---- */
.lesson-viewer { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-5); align-items: start; }

.video-container {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}
.video-container iframe { width: 100%; height: 100%; border: none; }

.lesson-sidebar { display: flex; flex-direction: column; gap: var(--space-4); }

.lesson-list { display: flex; flex-direction: column; gap: 2px; }
.lesson-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-4);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.lesson-item:hover { background: var(--primary-light); }
.lesson-item.active { background: var(--primary-light); border-color: var(--primary); }
.lesson-item.completed .lesson-num { background: var(--success); color: var(--white); }
.lesson-num {
  width: 28px; height: 28px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
  flex-shrink: 0;
  transition: var(--transition);
}
.lesson-info { flex: 1; min-width: 0; }
.lesson-info h4 { font-size: 0.8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-info span { font-size: 0.75rem; color: var(--gray-500); }

@media (max-width: 900px) {
  .lesson-viewer { grid-template-columns: 1fr; }
}

/* ---- Quiz Taker ---- */
.quiz-container { max-width: 720px; margin: 0 auto; }
.quiz-header {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.quiz-timer {
  font-size: 1.5rem; font-weight: 700;
  color: var(--primary);
  font-family: var(--font-heading);
}
.quiz-timer.warning { color: var(--warning); }
.quiz-timer.danger  { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.quiz-progress-info { font-size: 0.875rem; color: var(--gray-500); }
.question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.question-num { font-size: 0.8125rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-3); }
.question-text { font-size: 1.0625rem; font-weight: 600; color: var(--gray-900); margin-bottom: var(--space-5); line-height: 1.5; }
.options-list { display: flex; flex-direction: column; gap: var(--space-3); }
.option-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9375rem;
}
.option-item:hover { border-color: var(--primary); background: var(--primary-light); }
.option-item.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 500; }
.option-item.correct  { border-color: var(--success); background: var(--success-light); color: #065f46; }
.option-item.wrong    { border-color: var(--danger);  background: var(--danger-light);  color: #991b1b; }
.option-letter {
  width: 28px; height: 28px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.option-item.selected .option-letter { background: var(--primary); color: var(--white); }
.option-item.correct .option-letter  { background: var(--success); color: var(--white); }
.option-item.wrong .option-letter    { background: var(--danger);  color: var(--white); }

.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-4); }
.quiz-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.quiz-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  cursor: pointer;
  transition: var(--transition);
}
.quiz-dot.answered { background: var(--primary); }
.quiz-dot.current  { background: var(--accent); transform: scale(1.3); }

/* ---- Quiz Result ---- */
.result-card {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  margin: 0 auto;
}
.result-icon { font-size: 5rem; margin-bottom: var(--space-4); display: block; }
.result-score { font-size: 4rem; font-weight: 800; color: var(--primary); line-height: 1; }
.result-score span { font-size: 1.5rem; font-weight: 600; color: var(--gray-500); }
.result-label { font-size: 1rem; color: var(--gray-600); margin: var(--space-2) 0 var(--space-5); }
.result-stats { display: flex; justify-content: center; gap: var(--space-6); margin-bottom: var(--space-6); }
.result-stat { text-align: center; }
.result-stat .val { font-size: 1.5rem; font-weight: 700; }
.result-stat .lbl { font-size: 0.8rem; color: var(--gray-500); }

/* ---- Certificate ---- */
.certificate {
  border: 3px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  text-align: center;
  background: linear-gradient(135deg, #fffdf0, #fff);
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
}
.certificate::before {
  content: '';
  position: absolute; inset: 8px;
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: calc(var(--radius-xl) - 4px);
  pointer-events: none;
}
.cert-logo { font-size: 3rem; margin-bottom: var(--space-2); }
.cert-title { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.3em; color: var(--gray-500); text-transform: uppercase; margin-bottom: var(--space-4); }
.cert-main { font-size: 2.5rem; font-weight: 800; color: var(--primary); font-family: var(--font-heading); margin-bottom: var(--space-2); }
.cert-subtitle { font-size: 1.125rem; color: var(--gray-600); margin-bottom: var(--space-6); }
.cert-name { font-size: 2rem; font-weight: 700; color: var(--gray-900); border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 4px; margin-bottom: var(--space-6); font-family: var(--font-heading); font-style: italic; }
.cert-course { font-size: 1.25rem; font-weight: 600; color: var(--primary); margin-bottom: var(--space-4); }
.cert-date { font-size: 0.875rem; color: var(--gray-500); }
.cert-institute { font-size: 1rem; font-weight: 700; color: var(--gray-700); margin-top: var(--space-6); }

/* ---- Announcement / Notice Board ---- */
.notice-item {
  display: flex; gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--gray-100);
}
.notice-item:last-child { border-bottom: none; }
.notice-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}
.notice-dot.urgent { background: var(--danger); }
.notice-dot.info   { background: var(--info); }
.notice-content h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.notice-content p  { font-size: 0.8125rem; color: var(--gray-500); }
.notice-date { font-size: 0.75rem; color: var(--gray-400); margin-top: 4px; }

/* ---- Profile Page ---- */
.profile-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.profile-avatar-wrap { position: relative; }
.profile-avatar-wrap .avatar { border: 4px solid rgba(255,255,255,0.3); }
.profile-info h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.profile-info p { color: rgba(255,255,255,0.8); margin-bottom: var(--space-3); }
.profile-stats { display: flex; gap: var(--space-6); }
.profile-stat .val { font-size: 1.5rem; font-weight: 700; }
.profile-stat .lbl { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

/* ---- Fee Status ---- */
.fee-row td { vertical-align: middle; }
.fee-actions { display: flex; gap: var(--space-2); align-items: center; }

/* ---- Assignment Card ---- */
.assignment-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.assignment-card:hover { box-shadow: var(--shadow); }
.assignment-meta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-2) 0 var(--space-4); }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; gap: var(--space-2); justify-content: center; margin-top: var(--space-5); }
.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Loading Spinner ---- */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9990;
}

/* ---- Print (for certificates) ---- */
@media print {
  .sidebar, .top-header, .btn { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .certificate { box-shadow: none; border: 2px solid var(--accent); }
}
