html,
body {
  height: 100%;
  margin: 0;
}
#elm-main {
  height: 100vh;
}

.recipe-option.trigger-pulse {
  animation: highlight-pulse 2s ease-out;
}

.recipe-option {
  outline: none;
}

/* Markdown content styling */
.markdown-content pre {
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 0.375rem;
  padding: 1rem;
  overflow-x: auto;
}

.markdown-content code {
  color: #f8f9fa;
  background-color: transparent;
}

.markdown-content pre code {
  display: block;
  color: #f8f9fa;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95em;
  line-height: 1.5;
}

.markdown-content p code {
  background-color: #2d2d2d;
  color: #f8f9fa;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.button {
  display: inline-block;
  padding: 0.1em 0.4em;
  background-color: transparent;
  color: white !important;
  text-align: center;
  text-decoration: none;
  border-radius: 5px;
  border: solid 1px gray;
  margin: 0;
  font-size: 0.8rem;
}

.button.copy {
  opacity: 0.7;
}

.button.copy:before {
  content: "⿻ Copy";
}

.button.copy.active:before {
  content: "⿻ Copied ✓";
}

.button.copy.active {
  background-color: #256929;
  opacity: 1;
}

.button.copy.active:hover {
  background-color: #256929;
  opacity: 1;
}

.button.copy:hover {
  background-color: transparent;
  opacity: 1;
  border: solid 1px gray;
}

.m-app-card {
  transition: background-color 0.15s ease-in-out;
}

.m-app-card:hover {
  background-color: #f8f9fa;
}

[data-bs-theme="dark"] .m-app-card:hover {
  background-color: #2a3036;
}

/* Hide the annoying border around search bar that bootstrap adds */
.form-control:focus {
  box-shadow: none !important;
  border-color: royalblue;
}

/* Default: small screens */
.m-app-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(
    auto-fit,
    minmax(max(200px, 100%), 1fr)
  ); /* 1 column */
}

/* 320px+ allow multiple and allow them to stretch to full width */
@media (min-width: 321px) {
  .m-app-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* for large screens use auto-fill to avoid auto-fit stretching each app card too wide */
@media (min-width: 900px) {
  .m-app-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* hide the native summary icon */
details.accordion-item > summary {
  list-style: none;
}
details.accordion-item > summary::-webkit-details-marker {
  display: none;
}

/* remove the default blue outline on click */
details.accordion-item > summary:focus {
  box-shadow: none;
}

/* make the Bootstrap arrow react to the native <details> open/closed state */
details.accordion-item:not([open]) > summary.accordion-button::after {
  transform: none;
}

details.accordion-item[open] > summary.accordion-button::after {
  transform: rotate(-180deg); /* Points up when open */
}

/* navbar */

.brand-text {
  max-width: 200px;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  margin-left: 0.5rem;
}

.navbar-toggler-icon {
  transition:
    transform 0.3s ease-in-out,
    filter 0.3s ease-in-out;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .brand-text {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
  }
}

/* remove bootstrap default behavior */
[data-bs-theme="dark"] .navbar-toggler-icon {
  --bs-navbar-toggler-icon-bg: "";
}

a:link {
  text-decoration: none;
}

/* permalinks */
.anchor-link {
  padding: 0 0.175rem;
  font-weight: 400;
  color: #0d6efd80;
  text-decoration: none;
  opacity: 0;
  transition:
    color 0.15s ease-in-out,
    opacity 0.15s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  .anchor-link {
    transition: none;
  }
}
.anchor-link:after {
  content: "#";
}
.anchor-link:focus,
.anchor-link:hover,
:hover > .anchor-link,
:target > .anchor-link {
  color: #0d6efd;
  text-decoration: none;
  opacity: 1;
}

/* box containers */
.box-container {
  background-color: #f6f6ff;
  padding: 10px;
  margin: 10px 0;
  font-size: 14px;
  border-radius: 3px;
}

[data-bs-theme="dark"] .box-container {
  background-color: #28283f;
}

.box-container {
  outline: none;
}

.box-container.target-highlight.trigger-pulse {
  animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0px rgba(0, 0, 0, 0);
    background-color: transparent;
  }
  10% {
    /* Adjust these colors to match your app's theme */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.1);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(59, 130, 246, 0);
    background-color: transparent;
  }
}
