/* AE Course Manager — Global CSS Custom Properties
   All UI-SPEC design tokens. No component-specific rules in this file.
   Component scoped styles live in *.razor.css isolation files. */

:root {
  /* Color tokens */
  --color-surface: #F8F9FA;
  --color-surface-raised: #FFFFFF;
  --color-sidebar-bg: #0f2d59;
  --color-sidebar-text: #FFFFFF;
  --color-sidebar-active: rgba(2, 195, 154, 0.18);
  --color-header-bg: #FFFFFF;
  --color-border: #DEE2E6;
  --color-text-primary: #212529;
  --color-text-muted: #6C757D;
  --color-accent: #02c39a;
  --color-accent-dark: #0f2d59;
  --color-destructive: #DC3545;
  --color-success: #198754;
  --color-warning: #FFC107;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-size-body: 15px;
  --font-size-label: 13px;
  --font-size-sm: 12px;
  --font-size-heading: 20px;
  --font-size-display: 28px;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;

  /* Spacing scale (multiples of 4px) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout dimensions */
  --sidebar-width: 240px;
  --header-height: 100px;
  --input-height: 40px;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
}

/* Base reset & body styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  background-image: url('/images/bg.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  margin: 0;
  padding: 0;
}

/* Focus ring — accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Override Blazor default template styles that conflict with design system */
.valid.modified:not([type=checkbox]) {
  outline: 1px solid var(--color-success);
}

.invalid {
  border-color: var(--color-destructive) !important;
  outline: none;
}

.validation-message {
  color: var(--color-destructive);
  font-size: var(--font-size-label);
  margin-top: var(--space-xs);
}

.blazor-error-boundary {
  background: var(--color-destructive);
  color: #fff;
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-3xl);
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}

/* ---- Button styles (global — shared by all pages) ---- */
.btn {
  height: var(--input-height);
  padding: 0 var(--space-lg);
  border-radius: 50px;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  border: none;
  min-height: 44px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-dark);
  box-shadow: 0 4px 14px rgba(2, 195, 154, 0.35);
}

.btn--primary:hover:not(:disabled) {
  background: #00d4a6;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 195, 154, 0.5);
  color: var(--color-accent-dark);
}

.btn--primary:disabled {
  background: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--secondary {
  background: white;
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-border);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--color-surface);
  border-color: var(--color-accent-dark);
  color: var(--color-accent-dark);
  transform: translateY(-1px);
}

.btn--destructive {
  background: var(--color-destructive);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.btn--destructive:hover:not(:disabled) {
  background: #B02A37;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.35);
}

.btn--destructive:disabled {
  background: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ---- Form field styles (global — shared by all forms) ---- */
.form-field {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.form-label .required {
  color: var(--color-destructive);
}

.form-input {
  width: 100%;
  height: var(--input-height);
  padding: var(--space-sm) 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-body);
  font-family: var(--font-family);
  background: white;
  color: var(--color-text-primary);
  box-sizing: border-box;
}

.form-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-color: transparent;
}

.form-input.invalid {
  border-color: var(--color-destructive);
}

textarea.form-input {
  height: auto;
  min-height: 80px;
  resize: vertical;
}

/* ---- Year picker widget (scoped no-JS-rule exception — see year-picker.js header comment) ---- */
.year-picker-input {
  cursor: pointer;
  background-color: white;
}

.year-picker-popup {
  position: absolute;
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 4px 14px rgba(15, 45, 89, 0.18);
  font-family: var(--font-family);
}

.year-picker-option {
  padding: var(--space-sm) 12px;
  font-size: var(--font-size-body);
  color: var(--color-text-primary);
  cursor: pointer;
}

.year-picker-option:hover {
  background: var(--color-sidebar-active);
  color: var(--color-accent-dark);
}

/* ---- Session expired prompt ---- */
.session-expired-prompt {
  background: var(--color-warning);
  color: var(--color-text-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-md);
}

.session-expired-prompt a {
  color: var(--color-accent);
  margin-left: var(--space-xs);
}

/* ---- Skip navigation link (global — must not be scoped so it works across layouts) ---- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: white;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 var(--border-radius-sm) 0;
}

.skip-link:focus {
  top: 0;
}

/* ---- Responsive utility helper for page headers ---- */
.responsive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}

@media (max-width: 576px) {
  .responsive-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .responsive-header .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---- Responsive table wrapper (data-table list pages) ---- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-bottom: var(--space-md);
}

/* ---- Sidebar Navigation Link Styles ---- */
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-sidebar-text) !important;
  text-decoration: none;
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-semibold);
  transition: background 0.1s;
  width: 100%;
}

.sidebar-nav .nav-item:hover {
  background: var(--color-sidebar-active);
}

.sidebar-nav .nav-item:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.sidebar-nav .nav-item--active {
  background: var(--color-sidebar-active) !important;
}

/* ---- Global page heading (B-04) ---- */
.page-heading {
  font-size: var(--font-size-heading);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-lg) 0;
  line-height: 1.25;
}

/* ---- Full-width button modifier ---- */
.btn--full-width {
  width: 100%;
}

/* ---- Loading indicator with spinner (W-05) ---- */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-label);
  padding: var(--space-lg) 0;
}

.loading-indicator::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Form layout (shared across admin/form pages) ---- */
.form-card {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: var(--space-xl);
  max-width: 740px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

@media (max-width: 576px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-md);
}

.form-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: calc(var(--space-xs) * -1);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: var(--space-xl) 0 var(--space-md) 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
  align-items: center;
}

.page-back {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-label);
}

.page-back a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.page-back a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.btn--small {
  height: 32px;
  min-height: 32px;
  padding: 0 var(--space-md);
  font-size: var(--font-size-sm);
}

.feature-card {
  margin: 0 !important;
  padding: 0 !important;
}

.feature-card img {
  width: 360px;
  border-radius: 8px 8px 0px 0px;
}

.feature-details {
  padding: 20px
}

.feature-card--vocational[b-ivf4p7l18l] {
  background-color: #0dcaf05c !important;
}