/* ============================================================
   BAD SITE – Intentionally inaccessible styles
   Every problem here is a deliberate teaching example.
   DO NOT use any of these patterns in real projects.
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none !important; /* Issue #4 – destroys all keyboard focus visibility */
}

body {
  font-family: Georgia, 'Times New Roman', serif; /* Issue #5 – serif decorative font, poor for dyslexia */
  font-size: 11px;                                /* Issue #5 – tiny base font size */
  line-height: 1.15;                              /* Issue #5 – cramped line spacing */
  color: #aaaaaa;                                 /* Issue #1 – ~2.3:1 contrast on white. WCAG needs 4.5:1 */
  background: #ffffff;
}

/* ---- Navbar ---- */
.navbar {
  background: #7c6fcd;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar .site-title {
  font-family: 'Brush Script MT', 'Comic Sans MS', cursive; /* Issue #5 */
  font-size: 20px;
  color: #d8d0ff;  /* Issue #1 – light on light-purple bg */
  margin-right: auto;
}

.navbar a {
  color: #c4b8ff;            /* Issue #1 – ~2.1:1 on purple background */
  text-decoration: none;
  font-size: 11px;
  padding: 2px 4px;          /* Issue #10 – far too small click target */
  font-family: Georgia, serif;
}

.navbar a:hover { color: #fff; }
/* No :focus styles – covered by outline: none above */

.navbar img.logo {
  width: 36px;
  height: 36px;
  /* alt="" in HTML – Issue #3 */
}

/* ---- Login page ---- */
.login-wrapper {
  max-width: 360px;
  margin: 30px auto;
  padding: 15px;
}

.login-hero {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
  /* alt="" in HTML – Issue #3 */
}

.login-wrapper h1 {
  font-family: 'Brush Script MT', 'Comic Sans MS', cursive; /* Issue #5 */
  font-size: 18px;
  color: #c0b8e8;   /* Issue #1 */
  text-align: center;
  margin-bottom: 4px;
}

.login-wrapper .tagline {
  font-size: 9px;
  color: #cccccc;   /* Issue #1 – very low contrast */
  text-align: center;
  margin-bottom: 16px;
}

/* Issue #2 – no <label> elements; placeholders carry all label information */
.login-wrapper input[type="text"],
.login-wrapper input[type="password"] {
  width: 100%;
  padding: 5px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  font-size: 11px;
  color: #aaa;    /* Issue #1 */
  background: #fff;
  font-family: Georgia, serif;
}

.login-wrapper input::placeholder {
  color: #cccccc; /* Issue #2 – placeholder IS the label; it disappears on typing */
}

.login-btn {
  width: 100%;
  padding: 5px;
  background: #ddd8ff;
  color: #9888ee;  /* Issue #1 – purple on pale purple, ~2.5:1 */
  border: none;
  font-size: 11px;
  font-family: 'Brush Script MT', cursive; /* Issue #5 */
  font-size: 14px;
  cursor: pointer;
  margin-top: 4px;
}

.forgot-link {
  display: block;
  text-align: center;
  font-size: 8px;       /* Issue #10 – unclickably small */
  color: #cccccc;       /* Issue #1 */
  margin-top: 6px;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Dashboard layout ---- */
.dash-wrapper {
  display: grid;
  grid-template-columns: 155px 1fr 160px;
  gap: 3px;
  padding: 4px;
  /* Issue #6 – three columns of dense info; cognitive overload */
}

.sidebar, .main-col {
  padding: 5px;
}

.sidebar {
  background: #fafafa;
  border: 1px solid #eeeeee;
}

/* ---- Widgets ---- */
.widget {
  margin-bottom: 7px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #e8e8e8;
}

.widget-title {
  font-family: 'Brush Script MT', 'Comic Sans MS', cursive; /* Issue #5 */
  font-size: 13px;
  color: #c0b8e8;  /* Issue #1 */
  margin-bottom: 3px;
}

/* Issue #7 – status shown with colour alone; no text label, no icon */
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
}

.dot-green  { background: #55bb55; }
.dot-amber  { background: #cc9933; }
.dot-red    { background: #cc4444; }

.activity-row {
  font-size: 10px;
  color: #bbbbbb;   /* Issue #1 */
  padding: 2px 0;
  border-bottom: 1px solid #f5f5f5;
  line-height: 1.2;
}

.quick-link {
  display: block;
  font-size: 10px;
  color: #aaaaaa;   /* Issue #1 */
  text-decoration: none;
  padding: 1px 0;   /* Issue #10 – near-zero click target */
}

.quick-link:hover { color: #888; }

/* Issue #8 – no semantic HTML; headings are styled divs */
.section-heading {
  font-family: 'Brush Script MT', cursive; /* Issue #5 */
  font-size: 14px;
  color: #c0b8e8;  /* Issue #1 */
  margin-bottom: 4px;
}

/* ---- Course cards ---- */
.course-card {
  border: 1px solid #eeeeee;
  margin-bottom: 5px;
  font-size: 10px;
  color: #bbbbbb;   /* Issue #1 */
  overflow: hidden;
}

.course-card img {
  width: 100%;
  height: 55px;
  object-fit: cover;
  display: block;
  /* alt="" in HTML – Issue #3 */
}

.course-card-body {
  padding: 4px;
}

.progress-outer {
  background: #eeeeee;
  height: 4px;
  margin: 3px 0;
}

.progress-inner {
  height: 4px;
  background: #7c6fcd;
}

/* ---- Marquee / announcement ---- */
/* Issue #6 / #9 – auto-moving content increases cognitive load;
   no ARIA live region means screen readers won't announce it properly */
.marquee-bar {
  background: #f5f5f5;
  border: 1px solid #eeeeee;
  padding: 3px 6px;
  margin-bottom: 4px;
  font-size: 10px;
  color: #bbb;    /* Issue #1 */
  overflow: hidden;
  white-space: nowrap;
}

.marquee-inner {
  display: inline-block;
  animation: scroll-left 18s linear infinite;
}

@keyframes scroll-left {
  from { transform: translateX(100%); }
  to   { transform: translateX(-100%); }
}

/* ---- Schedule table ---- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  color: #bbbbbb;  /* Issue #1 */
}

th {
  background: #f0f0f0;
  padding: 2px 3px;
  text-align: left;
  font-weight: normal;
  color: #bbb;     /* Issue #1 */
}

td {
  padding: 2px 3px;
  border-bottom: 1px solid #f5f5f5;
}

/* ---- Footer ---- */
footer {
  font-size: 8px;   /* Issue #10 – unreadably small */
  color: #dddddd;   /* Issue #1 */
  text-align: center;
  padding: 6px;
  border-top: 1px solid #f0f0f0;
  margin-top: 8px;
}

/* ============================================================
   AUDIT PANEL – uses normal accessible styles so students
   can actually read the panel that describes the problems!
   ============================================================ */

.audit-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #b91c1c;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
  z-index: 9990;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}

.audit-btn:focus {
  outline: 3px solid #fbbf24 !important; /* Override the bad-site rule for panel controls */
}

.audit-panel {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  height: 100vh;
  background: #fff;
  border-left: 4px solid #b91c1c;
  z-index: 10000;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -6px 0 20px rgba(0,0,0,0.25);
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.5;
}

.audit-panel.open { right: 0; }

.audit-header {
  background: #b91c1c;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
}

.audit-header h2 {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.audit-header p {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

.close-btn {
  background: none;
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 8px;
  font-family: Arial, sans-serif;
}

.close-btn:focus { outline: 2px solid #fff !important; }

.panel-body {
  padding: 12px;
}

.clear-btn {
  display: block;
  width: 100%;
  padding: 8px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  cursor: pointer;
  margin-bottom: 12px;
}

.clear-btn:focus { outline: 2px solid #b91c1c !important; }

.audit-item {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.audit-item:hover { background: #fef2f2; }
.audit-item.active { background: #fef2f2; border-color: #b91c1c; }

.audit-item-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
}

.badge {
  background: #b91c1c;
  color: #fff;
  border-radius: 50%;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.item-title {
  font-weight: 700;
  font-size: 13px;
  color: #111;
  margin-bottom: 3px;
}

.item-desc {
  font-size: 12px;
  color: #374151;
  margin-bottom: 5px;
}

.item-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wcag-tag {
  font-size: 10px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.cat-tag {
  font-size: 10px;
  background: #f3f4f6;
  color: #374151;
  padding: 1px 6px;
  border-radius: 3px;
}

/* Highlight class applied to elements when an issue is clicked */
.a11y-highlight {
  outline: 3px solid #b91c1c !important;
  outline-offset: 3px !important;
  animation: pulse-issue 1.2s ease-in-out infinite;
}

@keyframes pulse-issue {
  0%, 100% { outline-color: #b91c1c; box-shadow: 0 0 0 0 rgba(185,28,28,0.4); }
  50%       { outline-color: #f87171; box-shadow: 0 0 0 6px rgba(185,28,28,0); }
}
