/* Agile1Tech QA Practice Portal
   Layered on top of Bootstrap 5.3 - only what the app itself needs. */

/* Brand palette sampled directly from img/logo_agileOneTech.png:
   #BE1522 red (the logo block), #000000 wordmark, #B3B2B2 arrow, white.
   White on the red measures 6.3:1, so it clears WCAG AA for body text. */
:root {
  --a1-accent: #be1522;
  --a1-accent-dark: #9b111c;
  --a1-accent-soft: rgba(190, 21, 34, .10);
  --a1-accent-ring: rgba(190, 21, 34, .18);
  --a1-grey: #b3b2b2;
  --a1-ink: #1b1b1f;
  --a1-muted: #6b7280;
  --a1-line: #e5e7eb;
  --a1-surface: #ffffff;
  --a1-bg: #f5f7fa;
  --a1-topbar-h: 60px;
  --a1-sidebar-w: 244px;
}

body {
  background: var(--a1-bg);
  color: var(--a1-ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.btn-primary,
.btn-primary:focus {
  --bs-btn-bg: var(--a1-accent);
  --bs-btn-border-color: var(--a1-accent);
  --bs-btn-hover-bg: var(--a1-accent-dark);
  --bs-btn-hover-border-color: var(--a1-accent-dark);
  --bs-btn-active-bg: var(--a1-accent-dark);
  --bs-btn-active-border-color: var(--a1-accent-dark);
  --bs-btn-disabled-bg: var(--a1-accent);
  --bs-btn-disabled-border-color: var(--a1-accent);
}

.btn-outline-primary {
  --bs-btn-color: var(--a1-accent-dark);
  --bs-btn-border-color: var(--a1-accent);
  --bs-btn-hover-bg: var(--a1-accent);
  --bs-btn-hover-border-color: var(--a1-accent);
  --bs-btn-active-bg: var(--a1-accent-dark);
  --bs-btn-active-border-color: var(--a1-accent-dark);
}

a { color: var(--a1-accent-dark); }

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--a1-accent);
  box-shadow: 0 0 0 .2rem var(--a1-accent-ring);
}

.form-check-input:checked {
  background-color: var(--a1-accent);
  border-color: var(--a1-accent);
}

/* The Agile1Tech logo, used in the top bar and on the guest cards. */
.brand-logo { height: 30px; width: auto; display: block; flex: 0 0 auto; }
.guest-brand .brand-logo { height: 40px; }

/* ------------------------------------------------------------------ guest */

.guest-body { background: linear-gradient(160deg, #1b1b1f 0%, #be1522 100%); min-height: 100vh; }

.guest-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.guest-card {
  width: 100%;
  max-width: 460px;
  background: var(--a1-surface);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .25);
}

.guest-card.is-wide { max-width: 940px; }

.guest-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--a1-ink);
  margin-bottom: 20px;
}

.guest-brand strong { display: block; font-size: 1.05rem; }
.guest-brand small { color: var(--a1-muted); }
.guest-foot { margin-top: 20px; color: rgba(255, 255, 255, .85); font-size: .875rem; }
.guest-foot a { color: #fff; }

/* ----------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--a1-topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--a1-surface);
  border-bottom: 1px solid var(--a1-line);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--a1-ink);
  text-decoration: none;
  white-space: nowrap;
}

.topbar-brand small { display: block; font-weight: 400; font-size: .7rem; color: var(--a1-muted); }

.topbar-search { position: relative; flex: 1 1 auto; max-width: 420px; margin-inline: auto; }
.topbar-search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--a1-muted); }
.topbar-search .form-control { padding-left: 34px; border-radius: 999px; background: var(--a1-bg); }

.topbar-icon { position: relative; color: var(--a1-ink); font-size: 1.2rem; padding: 6px; text-decoration: none; }
.topbar-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: .68rem;
  line-height: 17px;
  text-align: center;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--a1-ink);
}
.topbar-user:hover { background: var(--a1-bg); }

.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------- sidebar */

.app-shell { display: flex; align-items: flex-start; }

.sidebar {
  width: var(--a1-sidebar-w);
  flex: 0 0 var(--a1-sidebar-w);
  background: var(--a1-surface);
  border-right: 1px solid var(--a1-line);
}

@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: var(--a1-topbar-h);
    height: calc(100vh - var(--a1-topbar-h));
    overflow-y: auto;
  }
}

.sidebar .offcanvas-body { padding: 14px 10px; display: flex; flex-direction: column; min-height: 100%; }

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #45506b;
  font-size: .93rem;
}
.sidebar .nav-link:hover { background: var(--a1-bg); color: var(--a1-ink); }
.sidebar .nav-link.active { background: var(--a1-accent-soft); color: var(--a1-accent-dark); font-weight: 600; }
.sidebar .nav-link .bi { font-size: 1.05rem; width: 20px; text-align: center; }

.nav-section {
  padding: 16px 12px 6px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--a1-muted);
}

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--a1-line); }

/* ------------------------------------------------------------------- main */

.app-main { flex: 1 1 auto; min-width: 0; padding: 24px; }

@media (max-width: 575px) { .app-main { padding: 16px; } }

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-sub { margin: 4px 0 0; color: var(--a1-muted); font-size: .93rem; }

.card { border: 1px solid var(--a1-line); border-radius: 12px; }
.card-header { background: transparent; border-bottom: 1px solid var(--a1-line); font-weight: 600; }

/* ---------------------------------------------------------------- widgets */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--a1-surface);
  border: 1px solid var(--a1-line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(27, 27, 31, .08); color: inherit; }
.stat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--a1-accent-soft);
  color: var(--a1-accent-dark);
  font-size: 1.25rem;
  flex: 0 0 auto;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--a1-muted); font-size: .85rem; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.course-card { display: flex; flex-direction: column; height: 100%; }
.course-card .card-body { display: flex; flex-direction: column; flex: 1 1 auto; }
.course-card .course-desc { color: var(--a1-muted); font-size: .88rem; flex: 1 1 auto; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.filter-bar {
  background: var(--a1-surface);
  border: 1px solid var(--a1-line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

.empty-state { text-align: center; padding: 44px 16px; color: var(--a1-muted); }
.empty-state .bi { font-size: 2.4rem; display: block; margin-bottom: 8px; opacity: .55; }

.notification-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--a1-line); }
.notification-item.is-unread { background: rgba(190, 21, 34, .06); }
.notification-item:last-child { border-bottom: 0; }

.timeline-item { border-left: 2px solid var(--a1-line); padding: 0 0 18px 16px; margin-left: 8px; position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--a1-accent);
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }

.progress { height: 8px; background: var(--a1-line); }
.progress-bar { background: var(--a1-accent); }

.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--a1-muted); }
th.sortable a { text-decoration: none; color: inherit; white-space: nowrap; }
th.sortable a:hover { color: var(--a1-accent-dark); }

.app-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-top: 1px solid var(--a1-line);
  background: var(--a1-surface);
  color: var(--a1-muted);
  font-size: .85rem;
}

.field-error { color: #dc3545; font-size: .85rem; margin-top: 4px; }

/* Numbered walkthroughs and code samples, shared by the API docs and the SQL
   practice guide. */
ol.pm-steps { padding-left: 20px; margin-bottom: 0; }
ol.pm-steps li { margin-bottom: 9px; line-height: 1.55; font-size: .91rem; }
ol.pm-steps code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; color: #b5179e; }
ol.pm-steps ul { margin-top: 6px; }

pre.sample {
  background: #10233a;
  color: #dbe7f3;
  border-radius: 9px;
  padding: 14px 16px;
  font-size: .82rem;
  overflow-x: auto;
  margin: 0;
}

kbd { background: #33415580; font-size: .78em; }

/* -------------------------------------------------------- QA playground */

.pg-card { background: var(--a1-surface); border: 1px solid var(--a1-line); border-radius: 12px; padding: 18px; height: 100%; }
.pg-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.pg-card .pg-hint { font-size: .82rem; color: var(--a1-muted); margin-bottom: 12px; }
.pg-out {
  background: var(--a1-bg);
  border: 1px dashed var(--a1-line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .84rem;
  min-height: 42px;
  word-break: break-word;
}

.dropzone {
  border: 2px dashed var(--a1-line);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  color: var(--a1-muted);
}
.dropzone.is-over { border-color: var(--a1-accent); background: rgba(190, 21, 34, .07); }

.drag-token {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--a1-accent);
  color: #fff;
  cursor: grab;
  user-select: none;
}
