/* =====================================================================
   AI Content Detection System — QR Demo Portal
   Shared stylesheet for demo.html, admin-demo.html, lecturer-demo.html,
   student-demo.html
   Pure CSS3 (works alongside Bootstrap 5). Mobile-first, glassmorphism,
   dark-blue gradient theme.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. ROOT VARIABLES
   Central place to tweak the theme colours / sizing.
   --------------------------------------------------------------------- */
:root {
  --bg-navy-1: #020617;   /* deepest navy, top-left of gradient   */
  --bg-navy-2: #0b1636;   /* mid navy                              */
  --bg-navy-3: #13285c;   /* lighter navy-blue                     */
  --bg-blue-4: #1e40af;   /* accent blue, bottom-right of gradient */

  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);

  --text-primary: #f4f7ff;
  --text-muted: #b9c4e0;

  --accent: #60a5fa;       /* light blue accent for icons/links   */
  --accent-2: #93c5fd;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --transition-fast: 0.2s ease;
  --transition-med: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------------
   2. RESET & BASE
   --------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  /* Dark blue gradient background, subtly animated for a premium feel */
  background: linear-gradient(
    135deg,
    var(--bg-navy-1) 0%,
    var(--bg-navy-2) 35%,
    var(--bg-navy-3) 70%,
    var(--bg-blue-4) 100%
  );
  background-size: 200% 200%;
  animation: gradientShift 18s ease infinite;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

a {
  text-decoration: none;
}

/* ---------------------------------------------------------------------
   3. DECORATIVE BACKGROUND ORBS
   Purely cosmetic blurred circles that float slowly, reinforcing the
   glassmorphism look. No images required — pure CSS.
   --------------------------------------------------------------------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: floatOrb 14s ease-in-out infinite;
}

.orb-1 {
  width: 340px;
  height: 340px;
  top: -80px;
  left: -100px;
  background: #2563eb;
  animation-delay: 0s;
}

.orb-2 {
  width: 260px;
  height: 260px;
  bottom: -60px;
  right: -60px;
  background: #38bdf8;
  animation-delay: 3s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  top: 45%;
  right: 10%;
  background: #4f46e5;
  opacity: 0.25;
  animation-delay: 6s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(20px, -25px) scale(1.08); }
}

/* ---------------------------------------------------------------------
   4. LAYOUT SHELL
   --------------------------------------------------------------------- */
.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.brand {
  text-align: center;
  margin-bottom: 2.25rem;
}

.brand-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 1rem;
  font-size: 1.75rem;
  color: var(--accent-2);
}

.brand h1 {
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: 0.2px;
}

.brand p {
  color: var(--text-muted);
  margin: 0;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
}

.badge-fyp {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: var(--accent-2);
}

/* ---------------------------------------------------------------------
   5. GLASSMORPHISM CARD (generic container used on every page)
   --------------------------------------------------------------------- */
.glass-card {
  width: 100%;
  max-width: 560px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 2rem;
}

@media (min-width: 576px) {
  .glass-card {
    padding: 2.5rem;
  }
}

/* ---------------------------------------------------------------------
   6. DASHBOARD SELECT BUTTONS (demo.html)
   Large, touch-friendly, stacked full-width buttons.
   --------------------------------------------------------------------- */
.dashboard-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 84px;
  padding: 1rem 1.4rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition-med),
              background var(--transition-fast),
              box-shadow var(--transition-med);
}

.dashboard-btn:last-child {
  margin-bottom: 0;
}

.dashboard-btn:hover,
.dashboard-btn:focus-visible {
  background: var(--glass-bg-hover);
  transform: scale(1.035) translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
}

.dashboard-btn:active {
  transform: scale(0.985);
}

.dashboard-btn .icon-wrap {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(96, 165, 250, 0.15);
  color: var(--accent-2);
}

/* Distinct accent per role — purely a visual cue, same interaction */
.dashboard-btn.role-admin .icon-wrap    { background: rgba(248, 113, 113, 0.16); color: #fca5a5; }
.dashboard-btn.role-lecturer .icon-wrap { background: rgba(52, 211, 153, 0.16);  color: #6ee7b7; }
.dashboard-btn.role-student .icon-wrap  { background: rgba(96, 165, 250, 0.16);  color: #93c5fd; }

.dashboard-btn .btn-text {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-btn .btn-text .title {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
}

.dashboard-btn .btn-text .subtitle {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.dashboard-btn .chevron {
  flex: 0 0 auto;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.dashboard-btn:hover .chevron {
  transform: translateX(4px);
  color: var(--accent-2);
}

/* ---------------------------------------------------------------------
   7. BACK BUTTON (every video page)
   --------------------------------------------------------------------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  margin-bottom: 1.5rem;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.back-btn:hover,
.back-btn:focus-visible {
  background: var(--glass-bg-hover);
  transform: translateX(-3px);
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------
   8. VIDEO PLAYER CARD (admin/lecturer/student demo pages)
   --------------------------------------------------------------------- */
.video-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  aspect-ratio: 16 / 9;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.video-missing-alert {
  display: none; /* toggled on by JS if the video fails to load */
  margin-top: 1rem;
}

.video-meta {
  margin-top: 1.25rem;
}

.video-meta h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.video-meta p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.9rem;
}

.role-pill.admin    { background: rgba(248, 113, 113, 0.16); color: #fca5a5; }
.role-pill.lecturer { background: rgba(52, 211, 153, 0.16);  color: #6ee7b7; }
.role-pill.student  { background: rgba(96, 165, 250, 0.16);  color: #93c5fd; }

/* ---------------------------------------------------------------------
   9. FOOTER
   --------------------------------------------------------------------- */
.page-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0 1rem 1.5rem;
}

/* ---------------------------------------------------------------------
   10. FADE-IN ANIMATION
   Applied via the .fade-in class; .fade-in-1/2/3/4 stagger the delay.
   Uses animation-fill-mode so content is visible even without JS.
   --------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}

.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.18s; }
.fade-in-3 { animation-delay: 0.30s; }
.fade-in-4 { animation-delay: 0.42s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .orb { animation: none; }
  .fade-in { animation: none; opacity: 1; transform: none; }
  .dashboard-btn:hover { transform: none; }
}

/* ---------------------------------------------------------------------
   11. RESPONSIVE TWEAKS (mobile-first; these are refinements for
   larger screens — base styles above already work on small phones)
   --------------------------------------------------------------------- */
@media (max-width: 380px) {
  .dashboard-btn { padding: 0.85rem 1rem; min-height: 76px; }
  .dashboard-btn .icon-wrap { width: 44px; height: 44px; font-size: 1.25rem; }
}

@media (min-width: 992px) {
  .glass-card { max-width: 620px; }
}
