/* =====================================================
   Summit Homework — Modern SaaS UI Redesign
   Visual only — no functionality changes
   ===================================================== */

/* ===== DESIGN TOKENS ===== */
:root {
  --sh-font: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --sh-primary: #2563EB;
  --sh-primary-dark: #1D4ED8;
  --sh-primary-light: #DBEAFE;

  --sh-bg: #F8FAFC;
  --sh-surface: #FFFFFF;
  --sh-text: #111827;
  --sh-text-secondary: #6B7280;
  --sh-text-muted: #9CA3AF;
  --sh-border: #E5E7EB;
  --sh-border-dark: #D1D5DB;

  --sh-success: #16A34A;
  --sh-success-light: #DCFCE7;
  --sh-success-dark: #166534;
  --sh-warning: #F59E0B;
  --sh-warning-light: #FEF3C7;
  --sh-warning-dark: #92400E;
  --sh-danger: #DC2626;
  --sh-danger-light: #FEE2E2;
  --sh-danger-dark: #991B1B;

  --sh-radius-sm: 8px;
  --sh-radius: 14px;
  --sh-radius-pill: 9999px;

  --sh-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.05);
  --sh-shadow-md: 0 4px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  --sh-shadow-lg: 0 8px 16px rgba(0,0,0,0.10), 0 16px 48px rgba(0,0,0,0.08);

  --sh-space-xs: 8px;
  --sh-space-sm: 16px;
  --sh-space-md: 24px;
  --sh-space-lg: 32px;
  --sh-space-xl: 48px;

  --sh-nav-height: 64px;
  --sh-sidebar-width: 280px;
}

/* ===== BASE ===== */
html {
  overflow-y: scroll;
}

body {
  font-family: var(--sh-font);
  background: var(--sh-bg);
  color: var(--sh-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-weight: 400;
  font-size: 16px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sh-text);
}

h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

p { font-size: 16px; color: var(--sh-text-secondary); }

small, .small, .text-muted {
  font-size: 14px !important;
  color: var(--sh-text-muted) !important;
}

/* ===== CONTAINER ===== */
.main-container-90 {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--sh-space-lg);
  width: 100%;
}

.container-fluid {
  max-width: 1600px;
  margin: 0 auto;
}

/* ===== NAVBAR ===== */
.navbar.bg-dark {
  background: #1E293B !important;
  height: var(--sh-nav-height);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  padding: 0 var(--sh-space-md);
}

.navbar.bg-dark > .container-fluid {
  padding: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar-brand {
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

.navbar-brand img {
  height: 40px !important;
  width: auto;
}

.navbar-toggler {
  border: none;
  padding: var(--sh-space-xs);
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-dark .navbar-nav {
  align-items: center;
  gap: 2px;
}

.navbar-dark .navbar-nav .nav-link {
  font-weight: 500;
  font-size: 15px;
  padding: 10px 16px !important;
  border-radius: var(--sh-radius-sm);
  transition: all 0.2s ease;
  color: rgba(255,255,255,0.8) !important;
  position: relative;
}

.navbar-dark .navbar-nav .nav-link:hover {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

.navbar-dark .navbar-nav .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.10) !important;
}

.navbar-dark .navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 16px;
  right: 16px;
  height: 3px;
  background: #fff;
  border-radius: 3px;
}

/* User dropdown in navbar */
.navbar .dropdown-toggle {
  display: flex;
  align-items: center;
  font-weight: 500;
}

.navbar .dropdown-menu {
  border: none;
  box-shadow: var(--sh-shadow-md);
  border-radius: var(--sh-radius-sm);
  padding: 4px;
  margin-top: 8px;
  min-width: 180px;
}

.navbar .dropdown-item {
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease;
}

.navbar .dropdown-item:hover {
  background: var(--sh-primary-light);
  color: var(--sh-primary);
}

/* ===== SIDEBAR (index.php layout) ===== */
.sidebar {
  width: var(--sh-sidebar-width);
  flex-shrink: 0;
}

.layout {
  display: flex;
  align-items: flex-start;
  gap: var(--sh-space-md);
}

/* ===== CARDS / PANELS ===== */
.panel {
  background: var(--sh-surface);
  border-radius: var(--sh-radius);
  border: 1px solid var(--sh-border);
  box-shadow: var(--sh-shadow-sm);
  padding: var(--sh-space-md);
  margin-bottom: var(--sh-space-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-shadow-md);
}

.card {
  background: var(--sh-surface);
  border-radius: var(--sh-radius);
  border: 1px solid var(--sh-border);
  box-shadow: var(--sh-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-shadow-md);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--sh-border);
  padding: var(--sh-space-sm) var(--sh-space-md);
  font-weight: 700;
  font-size: 16px;
}

.card-body {
  padding: var(--sh-space-md);
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--sh-surface);
  border-radius: var(--sh-radius);
  border: 1px solid var(--sh-border);
  box-shadow: var(--sh-shadow-sm);
  padding: var(--sh-space-md);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-shadow-md);
}

.stat-card .stat-icon {
  font-size: 28px;
  margin-bottom: var(--sh-space-xs);
  display: block;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--sh-text);
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--sh-text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ===== BUTTONS ===== */
.btn {
  font-weight: 600;
  border-radius: var(--sh-radius-sm);
  padding: 12px 20px;
  transition: all 0.15s ease;
  font-size: 14px;
  line-height: 1.2;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.10);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--sh-primary);
  border-color: var(--sh-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--sh-primary-dark);
  border-color: var(--sh-primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--sh-surface);
  border: 1px solid var(--sh-border-dark);
  color: var(--sh-text);
}

.btn-secondary:hover {
  background: #F3F4F6;
  border-color: var(--sh-border-dark);
  color: var(--sh-text);
}

.btn-success {
  background: var(--sh-success);
  border-color: var(--sh-success);
  color: #fff;
}

.btn-success:hover {
  background: #15803D;
  border-color: #15803D;
  color: #fff;
}

.btn-danger {
  background: var(--sh-danger);
  border-color: var(--sh-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #fff;
}

.btn-outline-primary {
  color: var(--sh-primary);
  border: 1px solid var(--sh-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--sh-primary);
  color: #fff;
}

.btn-outline-secondary {
  color: var(--sh-text-secondary);
  border: 1px solid var(--sh-border-dark);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: #F3F4F6;
  border-color: var(--sh-border-dark);
  color: var(--sh-text);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* Search button — make it a prominent primary action */
.btn-search {
  background: var(--sh-primary);
  border-color: var(--sh-primary);
  color: #fff;
  font-weight: 600;
}

.btn-search:hover {
  background: var(--sh-primary-dark);
  border-color: var(--sh-primary-dark);
  color: #fff;
}

/* Delete button — larger hover feedback */
.btn-delete {
  padding: 8px 16px;
  transition: all 0.15s ease;
}

.btn-delete:hover {
  background: var(--sh-danger-light) !important;
  color: var(--sh-danger) !important;
}

/* ===== FORMS ===== */
.form-control,
.form-select {
  height: 44px;
  border-radius: var(--sh-radius-sm);
  padding: 12px;
  border: 1px solid var(--sh-border-dark);
  font-family: var(--sh-font);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: var(--sh-surface);
  color: var(--sh-text);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--sh-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--sh-text-muted);
}

.form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--sh-text);
  margin-bottom: 6px;
}

.form-text {
  font-size: 13px;
  color: var(--sh-text-muted);
}

textarea.form-control {
  height: auto;
  min-height: 100px;
}

/* ===== TABLES ===== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.table thead th {
  background: #F8FAFC;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sh-text-secondary);
  padding: 16px 12px;
  border-bottom: 2px solid var(--sh-border);
  white-space: nowrap;
}

.table tbody tr {
  transition: background 0.15s ease;
  height: 60px;
}

.table tbody tr:nth-child(even) {
  background: #FAFAFA;
}

.table tbody tr:hover {
  background: #F3F4F6;
}

.table tbody td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--sh-border);
  color: var(--sh-text);
}

.table-sm th,
.table-sm td {
  padding: 8px 10px;
}

.table-bordered {
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  overflow: hidden;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--sh-border);
}

/* ===== BADGES ===== */
.sh-badge,
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--sh-radius-pill);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.sh-badge-success,
.badge-success {
  background: var(--sh-success-light);
  color: var(--sh-success-dark);
}

.sh-badge-warning,
.badge-warning {
  background: var(--sh-warning-light);
  color: var(--sh-warning-dark);
}

.sh-badge-danger,
.badge-danger {
  background: var(--sh-danger-light);
  color: var(--sh-danger-dark);
}

.sh-badge-info,
.badge-info {
  background: var(--sh-primary-light);
  color: var(--sh-primary-dark);
}

.sh-badge-neutral,
.badge-secondary {
  background: #F3F4F6;
  color: var(--sh-text-secondary);
}

/* ===== ALERTS ===== */
.alert {
  border: none;
  border-radius: var(--sh-radius-sm);
  padding: 16px 20px;
  font-weight: 500;
  font-size: 14px;
}

.alert-success {
  background: var(--sh-success-light);
  color: var(--sh-success-dark);
}

.alert-danger {
  background: var(--sh-danger-light);
  color: var(--sh-danger-dark);
}

.alert-warning {
  background: var(--sh-warning-light);
  color: var(--sh-warning-dark);
}

.alert-info {
  background: var(--sh-primary-light);
  color: var(--sh-primary-dark);
}

/* ===== COURSE TABS (Year level pill buttons) ===== */
.course-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: var(--sh-radius-sm);
  border: 1px solid var(--sh-border-dark);
  background: var(--sh-surface);
  color: var(--sh-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
  min-width: 120px;
  text-align: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.course-tab:hover {
  text-decoration: none;
  background: #F3F4F6;
  border-color: var(--sh-border-dark);
  color: var(--sh-text);
}

.course-tab-active {
  background: var(--sh-primary);
  border-color: var(--sh-primary);
  color: #fff;
}

.course-tab-active:hover {
  background: var(--sh-primary-dark);
  border-color: var(--sh-primary-dark);
  color: #fff;
}

/* Year filter buttons */
.btn-group .btn-outline-secondary.mb-1,
.btn-group .btn.mb-1 {
  border-radius: var(--sh-radius-sm) !important;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
}

/* ===== DETAILS / ACCORDION ===== */
details.course-details {
  border-radius: var(--sh-radius-sm);
  border: 1px solid var(--sh-border);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

details.course-details summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
  background: #FAFAFA;
  transition: background 0.15s ease;
}

details.course-details summary:hover {
  background: #F3F4F6;
}

details.course-details[open] {
  border-color: var(--sh-border-dark);
}

details.course-details[open] summary {
  background: #EEF2FF;
  border-bottom: 1px solid var(--sh-border);
}

/* ===== YEAR SECTION CARDS ===== */
.year-section-card {
  border-radius: var(--sh-radius);
  border: 1px solid var(--sh-border);
  overflow: hidden;
  box-shadow: var(--sh-shadow-sm);
}

.year-section-card .card-header {
  border-bottom: 1px solid var(--sh-border);
  padding: 12px 16px;
  background: #FAFAFA;
}

/* ===== EXERCISE CARDS ===== */
.exercise-card {
  border-radius: var(--sh-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--sh-border);
}

.exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-shadow-md);
}

.exercise-card-pass {
  background: var(--sh-success-light);
  border-color: #BBF7D0;
}

.exercise-card-fail {
  background: var(--sh-warning-light);
  border-color: #FDE68A;
}

/* ===== QUIZ INLINE CARDS ===== */
.quiz-inline-card {
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  transition: box-shadow 0.15s ease;
}

.quiz-inline-card:hover {
  box-shadow: var(--sh-shadow-sm);
}

.quiz-inline-card .card-body {
  padding: 8px 12px;
}

/* ===== LOGIN PAGE ===== */
.login-panel {
  border: none;
  padding: var(--sh-space-lg);
  border-radius: var(--sh-radius);
  background: var(--sh-surface);
  box-shadow: var(--sh-shadow-lg);
  width: 400px;
}

.login-panel h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 24px;
  margin-bottom: var(--sh-space-md);
}

/* ===== TEST QUESTIONS ===== */
.question {
  margin-bottom: var(--sh-space-md);
  padding: var(--sh-space-md);
  border: 2px solid var(--sh-border);
  border-radius: var(--sh-radius);
  background: var(--sh-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.question:hover {
  border-color: var(--sh-border-dark);
}

.question.correct {
  border-color: var(--sh-success);
  background: var(--sh-success-light);
}

.question.incorrect {
  border-color: var(--sh-danger);
  background: var(--sh-danger-light);
}

.result-summary {
  padding: var(--sh-space-sm) var(--sh-space-md);
  background: var(--sh-primary-light);
  border-radius: var(--sh-radius);
  margin-bottom: var(--sh-space-md);
  border-left: 4px solid var(--sh-primary);
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: var(--sh-space-xl) var(--sh-space-md);
  background: var(--sh-surface);
  border-radius: var(--sh-radius);
  border: 1px dashed var(--sh-border);
}

.empty-state .empty-icon {
  font-size: 48px;
  color: var(--sh-text-muted);
  margin-bottom: var(--sh-space-sm);
  display: block;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--sh-text);
  margin-bottom: var(--sh-space-xs);
}

.empty-state p {
  font-size: 15px;
  color: var(--sh-text-muted);
  margin: 0;
}

/* ===== OVERDUE ROWS ===== */
tr.overdue {
  background: var(--sh-danger-light) !important;
}

tr.overdue td {
  background: inherit;
}

/* ===== WRONG ANSWER HIGHLIGHT ===== */
.wrong-answer {
  background: var(--sh-danger-light) !important;
  font-weight: 600;
  border: 2px solid #FCA5A5 !important;
}

/* ===== MODALS ===== */
.modal-content {
  border: none;
  border-radius: var(--sh-radius);
  box-shadow: var(--sh-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--sh-border);
  background: #FAFAFA;
  border-radius: var(--sh-radius) var(--sh-radius) 0 0;
  padding: var(--sh-space-sm) var(--sh-space-md);
}

.modal-body {
  padding: var(--sh-space-md);
}

.modal-footer {
  border-top: 1px solid var(--sh-border);
  padding: var(--sh-space-sm) var(--sh-space-md);
}

/* ===== LINKS ===== */
a {
  color: var(--sh-primary);
  transition: color 0.15s ease;
}

a:hover {
  color: var(--sh-primary-dark);
}

/* ===== PROGRESS BARS ===== */
.progress {
  border-radius: var(--sh-radius-pill);
  background: #E5E7EB;
  height: 8px;
}

.progress-bar {
  border-radius: var(--sh-radius-pill);
}

/* ===== LIST GROUP ===== */
.list-group-item {
  border: none;
  border-bottom: 1px solid var(--sh-border);
  padding: 12px 16px;
  transition: background 0.15s ease;
}

.list-group-item:first-child {
  border-radius: var(--sh-radius-sm) var(--sh-radius-sm) 0 0;
}

.list-group-item:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--sh-radius-sm) var(--sh-radius-sm);
}

.list-group-item:hover {
  background: #F9FAFB;
}

.list-group-item.active {
  background: var(--sh-primary);
  border-color: var(--sh-primary);
}

/* ===== PAGINATION ===== */
.page-link {
  border: none;
  border-radius: var(--sh-radius-sm);
  margin: 0 2px;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  transition: all 0.15s ease;
  color: var(--sh-text-secondary);
}

.page-link:hover {
  background: var(--sh-primary-light);
  color: var(--sh-primary);
}

.page-item.active .page-link {
  background: var(--sh-primary);
  color: #fff;
}

/* ===== DROPDOWNS ===== */
.dropdown-menu {
  border: none;
  box-shadow: var(--sh-shadow-md);
  border-radius: var(--sh-radius-sm);
  padding: 4px;
}

.dropdown-item {
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--sh-primary-light);
  color: var(--sh-primary);
}

/* ===== TOOLTIPS ===== */
.tooltip-inner {
  border-radius: var(--sh-radius-sm);
  font-weight: 500;
  font-size: 13px;
  padding: 6px 10px;
}

/* ===== HR ===== */
hr {
  border: 0;
  height: 1px;
  background: var(--sh-border);
  margin: var(--sh-space-md) 0;
}

.tests-divider {
  border: 0;
  height: 2px;
  background: var(--sh-border);
  margin: var(--sh-space-md) 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .main-container-90 {
    padding: var(--sh-space-sm);
  }

  .sidebar {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .main-container-90 {
    padding: var(--sh-space-xs);
  }

  .sidebar {
    width: 100%;
  }

  .layout {
    flex-direction: column;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }
  h4 { font-size: 16px; }

  .panel {
    padding: var(--sh-space-sm);
  }

  .course-tab {
    min-width: 100px;
    font-size: 13px;
    padding: 8px 14px;
  }

  .table thead {
    position: static;
  }

  .stat-card .stat-value {
    font-size: 24px;
  }

  .navbar.bg-dark {
    height: auto;
    min-height: var(--sh-nav-height);
  }

  .navbar-dark .navbar-nav {
    padding: var(--sh-space-xs) 0;
  }

  .navbar-dark .navbar-nav .nav-link.active::after {
    display: none;
  }
}

/* ===== PRINT ===== */
@media print {
  body {
    background: #fff;
  }

  .panel, .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .navbar, .btn, .no-print {
    display: none !important;
  }
}

/* ===== MISC HELPERS ===== */
.flex-gap-1 { gap: 8px; }
.flex-gap-2 { gap: 16px; }
.flex-gap-3 { gap: 24px; }


