/*
  Custom Styles for a Clean, Minimalist, and Accessible Design
  ---
  This stylesheet builds on Bootstrap to create a unique look and feel while adhering to accessibility best practices.
*/

/* --- Base & Typography --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #212529; /* Bootstrap's default body color for high contrast */
  background-color: #fff;
  padding-bottom: 100px; /* Add padding to the bottom of the body to prevent content from being hidden by the footer */
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  color: #111;
}

a {
  color: #0056b3;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

a:hover, a:focus {
  color: #003d80;
  text-decoration: underline;
}

/* --- Header & Footer --- */
.site-header {
  background-color: #f8f9fa; /* Lighter gray for subtle separation */
  border-color: #ced4da;
}

.site-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: #f8f9fa;
  border-color: #ced4da;
  z-index: 1000;
}

.site-header a, .site-footer a {
  color: #495057;
}

.site-header a:hover, .site-header a:focus,
.site-footer a:hover, .site-footer a:focus {
  color: #000;
}

.footer-link-small {
  font-size: 0.875rem;
}

/* --- Card Styling --- */
.card {
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover, .card:focus-within {
  border-color: #0056b3;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
}

/* --- Form Accessibility --- */
.form-control:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 0.25rem rgba(0, 86, 179, 0.25);
}

.btn-primary {
  background-color: #0056b3;
  border-color: #0056b3;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #003d80;
  border-color: #003366;
}

/* --- Accessibility Enhancements --- */
:focus-visible {
  outline: 3px solid #0056b3;
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Dark Mode --- */
[data-bs-theme="dark"] body {
  color: #dee2e6;
  background-color: #1a1a1a;
}

[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
  color: #f8f9fa;
}

[data-bs-theme="dark"] a {
  color: #8bb9fe;
}

[data-bs-theme="dark"] a:hover, [data-bs-theme="dark"] a:focus {
  color: #a8c7fa;
}

[data-bs-theme="dark"] .site-header, [data-bs-theme="dark"] .site-footer {
  background-color: #212529;
  border-color: #495057;
}

[data-bs-theme="dark"] .site-header a, [data-bs-theme="dark"] .site-footer a {
  color: #adb5bd;
}

[data-bs-theme="dark"] .site-header a:hover, [data-bs-theme="dark"] .site-header a:focus,
[data-bs-theme="dark"] .site-footer a:hover, [data-bs-theme="dark"] .site-footer a:focus {
  color: #f8f9fa;
}

[data-bs-theme="dark"] .card {
  background-color: #212529;
  border-color: #495057;
}

[data-bs-theme="dark"] .card:hover, [data-bs-theme="dark"] .card:focus-within {
  border-color: #8bb9fe;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #212529;
  border-color: #495057;
}

[data-bs-theme="dark"] .form-control {
  background-color: #343a40;
  border-color: #495057;
  color: #dee2e6;
}

[data-bs-theme="dark"] .form-select {
  background-color: #343a40;
  border-color: #495057;
  color: #dee2e6;
}

[data-bs-theme="dark"] .btn-primary {
  background-color: #8bb9fe;
  border-color: #8bb9fe;
  color: #121212;
}

[data-bs-theme="dark"] .btn-primary:hover, [data-bs-theme="dark"] .btn-primary:focus {
  background-color: #a8c7fa;
  border-color: #a8c7fa;
}

[data-bs-theme="dark"] .bg-light {
  background-color: #212529 !important;
}

[data-bs-theme="dark"] .text-dark {
  color: #f8f9fa !important;
}
