/* ==========================================================================
   Custom Bootstrap-like CSS
   Components: Typography, Accordion, Modal, Container, Lists (ul/ol)
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Root variables & reset
   -------------------------------------------------------------------------- */
:root {
  --bs-blue: #0d6efd;
  --bs-gray-100: #f8f9fa;
  --bs-gray-200: #e9ecef;
  --bs-gray-300: #dee2e6;
  --bs-gray-600: #6c757d;
  --bs-gray-900: #212529;
  --bs-body-color: #212529;
  --bs-body-bg: #fff;
  --bs-border-color: #dee2e6;
  --bs-border-radius: 0.375rem;
  --bs-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--bs-font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  -webkit-text-size-adjust: 100%;
}

/* --------------------------------------------------------------------------
   1. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
  color: inherit;
}

h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Display headings — larger, lighter marketing-style headings */
.display-1 { font-size: 5rem;   font-weight: 300; line-height: 1.2; }
.display-2 { font-size: 4.5rem; font-weight: 300; line-height: 1.2; }
.display-3 { font-size: 4rem;   font-weight: 300; line-height: 1.2; }
.display-4 { font-size: 3.5rem; font-weight: 300; line-height: 1.2; }
.display-5 { font-size: 3rem;   font-weight: 300; line-height: 1.2; }
.display-6 { font-size: 2.5rem; font-weight: 300; line-height: 1.2; }

/* Lead paragraph */
.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

small, .small { font-size: 0.875em; }
mark, .mark  { padding: 0.1875em; background-color: #fff3cd; }

.text-muted    { color: var(--bs-gray-600) !important; }
.text-primary  { color: var(--bs-blue) !important; }
.text-center   { text-align: center !important; }
.text-end      { text-align: right !important; }
.text-start    { text-align: left !important; }
.fw-bold       { font-weight: 700 !important; }
.fw-light      { font-weight: 300 !important; }
.fst-italic    { font-style: italic !important; }
.text-decoration-underline { text-decoration: underline !important; }

blockquote,
.blockquote {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  padding-left: 1rem;
  border-left: 0.25rem solid var(--bs-gray-300);
}

a {
  color: var(--bs-blue);
  text-decoration: underline;
}
a:hover { color: #0a58ca; }

hr {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid var(--bs-border-color);
  opacity: 0.25;
}

/* --------------------------------------------------------------------------
   2. Container
   -------------------------------------------------------------------------- */
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl {
  width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  margin-right: auto;
  margin-left: auto;
}

/* Responsive fixed-width breakpoints (matches Bootstrap 5) */
@media (min-width: 576px)  { .container, .container-sm { max-width: 540px; } }
@media (min-width: 768px)  { .container, .container-sm, .container-md { max-width: 720px; } }
@media (min-width: 992px)  { .container, .container-sm, .container-md, .container-lg { max-width: 960px; } }
@media (min-width: 1200px) { .container, .container-sm, .container-md, .container-lg, .container-xl { max-width: 1140px; } }
@media (min-width: 1400px) { .container, .container-sm, .container-md, .container-lg, .container-xl { max-width: 1320px; } }

/* .container-fluid always spans full width */

/* --------------------------------------------------------------------------
   3. Lists (ul, ol)
   -------------------------------------------------------------------------- */
ul, ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

ul ul, ul ol, ol ul, ol ol {
  margin-bottom: 0;
}

/* Remove bullets/numbers and padding */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}
.list-unstyled > li { margin-bottom: 0.25rem; }

/* Inline list — items sit side by side */
.list-inline {
  padding-left: 0;
  list-style: none;
}
.list-inline-item {
  display: inline-block;
}
.list-inline-item:not(:last-child) {
  margin-right: 0.5rem;
}

/* List group — bordered, stacked items */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: var(--bs-border-radius);
  list-style: none;
}
.list-group-item {
  position: relative;
  display: block;
  padding: 0.5rem 1rem;
  color: var(--bs-body-color);
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.125);
}
.list-group-item + .list-group-item {
  border-top-width: 0;
}
.list-group-item:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.list-group-item:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
.list-group-item.active {
  z-index: 2;
  color: #fff;
  background-color: var(--bs-blue);
  border-color: var(--bs-blue);
}

/* --------------------------------------------------------------------------
   4. Accordion
   -------------------------------------------------------------------------- */
.accordion {
  --bs-accordion-border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

.accordion-item {
  color: var(--bs-body-color);
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
}
.accordion-item:first-of-type {
  border-top-left-radius: var(--bs-border-radius);
  border-top-right-radius: var(--bs-border-radius);
}
.accordion-item:not(:first-of-type) {
  border-top: 0;
}
.accordion-item:last-of-type {
  border-bottom-left-radius: var(--bs-border-radius);
  border-bottom-right-radius: var(--bs-border-radius);
}

.accordion-header {
  margin: 0;
}

.accordion-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--bs-body-color);
  text-align: left;
  background-color: #fff;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.accordion-button:hover {
  background-color: var(--bs-gray-100);
}
/* Expanded state */
.accordion-button:not(.collapsed) {
  color: #0c63e4;
  background-color: #e7f1ff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}
/* Chevron indicator */
.accordion-button::after {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  content: "";
  background-repeat: no-repeat;
  background-size: 1.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transition: transform 0.2s ease-in-out;
}
.accordion-button:not(.collapsed)::after {
  transform: rotate(-180deg);
}

/* Collapsible region */
.accordion-collapse {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}
.accordion-collapse.show {
  max-height: 500px;
}

.accordion-body {
  padding: 1rem 1.25rem;
}

/* --------------------------------------------------------------------------
   5. Modal
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}
.modal.show {
  display: block;
}

/* Dimmed backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  opacity: 0;
  transition: opacity 0.15s linear;
}
.modal-backdrop.show {
  opacity: 0.5;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
  transform: translateY(-50px);
  transition: transform 0.3s ease-out;
}
.modal.show .modal-dialog {
  transform: none;
}
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  outline: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.modal-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.5;
}
.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--bs-border-color);
}

/* Close (x) button */
.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  color: #000;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: var(--bs-border-radius);
  opacity: 0.5;
  cursor: pointer;
}
.btn-close:hover { opacity: 0.75; }

/* --------------------------------------------------------------------------
   Buttons (helper, used by the demo)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius);
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn-primary   { color: #fff; background-color: var(--bs-blue); border-color: var(--bs-blue); }
.btn-primary:hover { background-color: #0b5ed7; border-color: #0a58ca; }
.btn-secondary { color: #fff; background-color: var(--bs-gray-600); border-color: var(--bs-gray-600); }
.btn-secondary:hover { background-color: #5c636a; }

/* --------------------------------------------------------------------------
   Demo page helpers (not part of the framework)
   -------------------------------------------------------------------------- */
.demo-section { padding: 2rem 0; border-bottom: 1px solid var(--bs-gray-200); }
.demo-section h2 { color: var(--bs-blue); }