/* Attend-Class student shell
   Shared visual foundation for non-exam student pages. Page templates can still
   layer their own class-specific styles after this file. */

:root {
  --accent-rgb: 59, 130, 246;
  --accent-hover-rgb: 37, 99, 235;
  --dark-accent-rgb: 96, 165, 250;
  --dark-accent-hover-rgb: 147, 197, 253;
  --sc-accent-rgb: var(--accent-rgb);
  --sc-accent: rgb(var(--sc-accent-rgb));
  --sc-text: #0f172a;
  --sc-text-muted: #64748b;
  --sc-surface: rgba(255, 255, 255, 0.9);
  --sc-surface-strong: #ffffff;
  --sc-card-bg: rgba(255, 255, 255, 0.86);
  --sc-card-border: rgba(148, 163, 184, 0.28);
  --sc-card-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --sc-radius-lg: 8px;
  --sc-radius-md: 8px;
  --sc-radius-sm: 8px;
  --ux-green-rgb: 34, 197, 94;
  --ux-amber-rgb: 245, 158, 11;
  --ux-red-rgb: 239, 68, 68;
  --ux-cyan-rgb: 6, 182, 212;
  --ux-slate-rgb: 100, 116, 139;
  --ac-visual-bottom-inset: 0px;
  --ac-visual-viewport-height: 100vh;
  --student-dock-gap: 12px;
  --student-dock-height: 92px;
  --student-dock-bottom: calc(var(--student-dock-gap) + env(safe-area-inset-bottom, 0px) + var(--ac-visual-bottom-inset, 0px));
  --student-content-bottom-padding: calc(var(--student-dock-height) + var(--student-dock-bottom) + 20px);
}

html,
body.student-shell {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.98)),
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.09), rgba(20, 184, 166, 0.06) 46%, rgba(245, 158, 11, 0.05)) !important;
  color: var(--sc-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.student-shell {
  overflow-x: hidden;
}

body.student-shell.dark-mode,
html.dark-mode body.student-shell {
  --sc-accent-rgb: var(--dark-accent-rgb);
  --sc-text: #f8fafc;
  --sc-text-muted: #cbd5e1;
  --sc-surface: rgba(15, 23, 42, 0.88);
  --sc-surface-strong: #0f172a;
  --sc-card-bg: rgba(15, 23, 42, 0.84);
  --sc-card-border: rgba(148, 163, 184, 0.22);
  --sc-card-shadow: 0 14px 34px rgba(2, 6, 23, 0.42);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98)),
    linear-gradient(135deg, rgba(var(--dark-accent-rgb), 0.14), rgba(20, 184, 166, 0.08) 46%, rgba(245, 158, 11, 0.06)) !important;
}

body.student-shell *,
body.student-shell *::before,
body.student-shell *::after {
  box-sizing: border-box;
}

body.student-shell .student-skip-link {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 2000;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--sc-surface-strong);
  color: var(--sc-accent);
  border: 1px solid var(--sc-card-border);
  box-shadow: var(--sc-card-shadow);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

body.student-shell .student-skip-link:focus {
  transform: translateY(0);
}

body.student-shell #height_div {
  width: min(100%, 1040px) !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 auto 48px !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--sc-text);
}

body.student-shell #student-main-content {
  width: min(100%, 920px);
  padding-inline: clamp(12px, 2vw, 24px) !important;
  padding-bottom: var(--student-content-bottom-padding) !important;
}

body.student-shell #headline {
  background: transparent !important;
  box-shadow: none !important;
}

body.student-shell .headtext {
  float: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  margin: 12px;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid var(--sc-card-border);
  background: var(--sc-card-bg);
  color: var(--sc-text);
  box-shadow: var(--sc-card-shadow);
  font-size: 1rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.student-shell a {
  color: var(--sc-accent);
}

body.student-shell a:hover {
  color: rgb(var(--accent-hover-rgb));
}

body.student-shell.dark-mode a,
html.dark-mode body.student-shell a {
  color: rgb(var(--dark-accent-rgb));
}

body.student-shell .messages {
  display: grid;
  gap: 8px;
  margin: 10px auto 14px;
  padding: 0;
  max-width: 720px;
}

body.student-shell .messages li,
body.student-shell .alert {
  border-radius: 8px;
  border: 1px solid rgba(var(--sc-accent-rgb), 0.18);
  background: rgba(var(--sc-accent-rgb), 0.08);
  color: var(--sc-text);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 10px 14px;
}

body.student-shell .messages li.success,
body.student-shell .alert-success {
  border-color: rgba(var(--ux-green-rgb), 0.28);
  background: rgba(var(--ux-green-rgb), 0.12);
}

body.student-shell .messages li.error,
body.student-shell .messages li.danger,
body.student-shell .alert-danger {
  border-color: rgba(var(--ux-red-rgb), 0.28);
  background: rgba(var(--ux-red-rgb), 0.1);
}

body.student-shell .messages li.warning,
body.student-shell .alert-warning {
  border-color: rgba(var(--ux-amber-rgb), 0.3);
  background: rgba(var(--ux-amber-rgb), 0.12);
}

body.student-shell .card,
body.student-shell .sc-card,
body.student-shell .border.rounded,
body.student-shell .tab-content,
body.student-shell .modal-content {
  border-radius: 8px !important;
  border: 1px solid var(--sc-card-border) !important;
  background: var(--sc-card-bg) !important;
  box-shadow: var(--sc-card-shadow) !important;
  color: var(--sc-text);
}

body.student-shell .card,
body.student-shell .sc-card {
  text-align: start;
}

body.student-shell .sc-card .text-center,
body.student-shell .card .text-center {
  text-align: center !important;
}

body.student-shell .card-header,
body.student-shell .modal-header {
  border-bottom: 1px solid rgba(var(--sc-accent-rgb), 0.12) !important;
  background: rgba(var(--sc-accent-rgb), 0.05) !important;
}

body.student-shell .card-footer,
body.student-shell .modal-footer {
  border-top: 1px solid rgba(var(--sc-accent-rgb), 0.12) !important;
  background: transparent !important;
}

body.student-shell .nav-tabs {
  width: auto;
  max-width: 100%;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--sc-card-border) !important;
  border-radius: 8px !important;
  background: var(--sc-card-bg);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

body.student-shell .nav-tabs::-webkit-scrollbar {
  display: none;
}

body.student-shell .nav-tabs .nav-link {
  border: 0 !important;
  border-radius: 6px !important;
  color: var(--sc-text-muted) !important;
  font-weight: 700;
  white-space: nowrap;
}

body.student-shell .nav-tabs .nav-link.active {
  color: #fff !important;
  background: rgb(var(--sc-accent-rgb)) !important;
  box-shadow: 0 6px 14px rgba(var(--sc-accent-rgb), 0.22);
}

body.student-shell .btn {
  min-height: 36px;
  border-radius: 999px !important;
  font-weight: 700 !important;
}

body.student-shell .btn-primary,
body.student-shell .sc-btn-primary,
body.student-shell .sc-btn-photo {
  border-color: transparent !important;
  background: linear-gradient(160deg, rgb(var(--sc-accent-rgb)), rgb(var(--accent-hover-rgb))) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(var(--sc-accent-rgb), 0.25) !important;
}

body.student-shell .btn-outline-primary,
body.student-shell .sc-btn-ghost {
  border: 1.5px solid rgba(var(--sc-accent-rgb), 0.28) !important;
  background: rgba(var(--sc-accent-rgb), 0.07) !important;
  color: var(--sc-accent) !important;
}

body.student-shell .btn-outline-secondary {
  border: 1.5px solid rgba(var(--ux-slate-rgb), 0.22) !important;
  background: rgba(255, 255, 255, 0.6) !important;
  color: var(--sc-text-muted) !important;
}

body.student-shell.dark-mode .btn-outline-secondary,
html.dark-mode body.student-shell .btn-outline-secondary {
  background: rgba(15, 23, 42, 0.48) !important;
}

body.student-shell .form-control,
body.student-shell .form-select,
body.student-shell input[type="text"],
body.student-shell input[type="email"],
body.student-shell input[type="password"],
body.student-shell input[type="number"],
body.student-shell textarea {
  border-radius: 8px !important;
  border: 1.5px solid rgba(var(--sc-accent-rgb), 0.18) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: var(--sc-text) !important;
  font-size: 16px;
}

body.student-shell.dark-mode .form-control,
body.student-shell.dark-mode .form-select,
body.student-shell.dark-mode input[type="text"],
body.student-shell.dark-mode input[type="email"],
body.student-shell.dark-mode input[type="password"],
body.student-shell.dark-mode input[type="number"],
body.student-shell.dark-mode textarea,
html.dark-mode body.student-shell .form-control,
html.dark-mode body.student-shell .form-select,
html.dark-mode body.student-shell input[type="text"],
html.dark-mode body.student-shell input[type="email"],
html.dark-mode body.student-shell input[type="password"],
html.dark-mode body.student-shell input[type="number"],
html.dark-mode body.student-shell textarea {
  background: rgba(15, 23, 42, 0.62) !important;
  color: var(--sc-text) !important;
}

body.student-shell .form-control:focus,
body.student-shell .form-select:focus,
body.student-shell input:focus,
body.student-shell textarea:focus {
  border-color: rgb(var(--sc-accent-rgb)) !important;
  box-shadow: 0 0 0 4px rgba(var(--sc-accent-rgb), 0.14) !important;
  outline: none !important;
}

body.student-shell label,
body.student-shell .form-label {
  color: var(--sc-text);
  font-weight: 700;
}

body.student-shell .table {
  color: var(--sc-text);
  vertical-align: middle;
}

body.student-shell .table > thead > tr > th {
  color: var(--sc-text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  border-bottom-color: rgba(var(--sc-accent-rgb), 0.14);
}

body.student-shell .table > tbody > tr > td {
  color: var(--sc-text);
  border-bottom-color: rgba(var(--sc-accent-rgb), 0.08);
}

body.student-shell .dropdown-menu {
  border-radius: 8px;
  border: 1px solid var(--sc-card-border);
  background: var(--sc-surface-strong);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  padding: 6px;
}

body.student-shell.dark-mode .dropdown-menu,
html.dark-mode body.student-shell .dropdown-menu {
  background: #0f172a;
}

body.student-shell .dropdown-item {
  border-radius: 6px;
  color: var(--sc-text);
  font-weight: 650;
}

body.student-shell .dropdown-item:hover,
body.student-shell .dropdown-item:focus {
  background: rgba(var(--sc-accent-rgb), 0.1);
  color: var(--sc-text);
}

@media (max-width: 575px) {
  body.student-shell #student-main-content {
    padding-inline: 10px !important;
  }

  body.student-shell #height_div {
    width: 100% !important;
    max-width: 100vw !important;
  }

  body.student-shell .card,
  body.student-shell .sc-card,
  body.student-shell .border.rounded {
    margin-inline: 0 !important;
  }

  body.student-shell .btn {
    min-height: 40px;
  }

  body.student-shell .table {
    font-size: 0.86rem;
  }
}
