/* Copy to LLM Styles */
/* Modified from: https://github.com/leonardocustodio/mkdocs-copy-to-llm/blob/main/mkdocs_copy_to_llm/assets/css/copy-to-llm.css */

/* H1 and copy button wrapper */
.h1-copy-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.h1-copy-wrapper h1 {
  flex: 1;
  margin: 0;
}

/* Split button container */
.copy-to-llm-split-container {
  display: inline-flex;
  margin-left: auto;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: visible;
  position: relative;
}

.copy-to-llm-split-container:hover {
  background-color: var(--md-typeset-table-color--light);
}

/* Common styles for both parts */
.copy-to-llm-section {
  padding: 0.6em 0.9em;
  background-color: var(--secondary-bg-color);
  color: var(--md-default-fg-color);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 16px;
}

/* Left button (copy) */
.copy-to-llm-left {
  border-right: 1px solid var(--border-color);
  border-radius: 6px 0 0 6px;
}

.copy-to-llm-left:hover {
  background-color: var(--warm-brown);
  color: var(--cream);
}

/* Right button (dropdown) */
.copy-to-llm-right {
  padding: 0.6em 0.7em;
  border-radius: 0 6px 6px 0;
  position: relative;
  z-index: 1;
}

.copy-to-llm-right:hover,
.copy-to-llm-right.active {
  background-color: var(--warm-brown);
  color: var(--cream);
}

.copy-to-llm-right:focus {
  outline: none;
}

/* Icons */

/* Color of copy icon */
.copy-to-llm-section .copy-icon {
  width: 1.1em;
  height: 1.1em;
  fill: var(--md-default-fg-color);
  margin-right: 2px;
}

/* Color of copy icon on hover */
.copy-to-llm-section:hover .copy-icon {
  fill: var(--cream);
}

/* Color, size, and animation for chevron */
.copy-to-llm-section .chevron-icon {
  width: 1em;
  height: 1em;
  transition: transform 0.2s;
  fill: var(--md-default-fg-color);
}

/* Color of chevron while left button is hovered */
.copy-to-llm-section:hover .chevron-icon {
  fill: var(--cream);
}

/* Color of chevron while left button is active */
.copy-to-llm-right.active svg.chevron-icon {
  fill: var(--cream);
}

/* Dropdown menu */
.copy-to-llm-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background-color: var(--md-default-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  z-index: 2;
  display: none;
  transform: translateY(0);
  overflow: visible;
  padding: 0.25rem;
}

.copy-to-llm-dropdown.show {
  display: block;
}

.copy-to-llm-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.475rem 0.625rem;
  border: none;
  text-align: left;
  color: var(--md-default-fg-color);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.2;
}

.copy-to-llm-dropdown-item span {
  flex: 1;
}

.copy-to-llm-dropdown-item:hover {
  background-color: var(--warm-brown);
  color: var(--cream);
}

.copy-to-llm-dropdown-item:active {
  background-color: var(--warm-brown);
}

.copy-to-llm-dropdown-item svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: var(--md-default-fg-color);
}

.copy-to-llm-dropdown-item:hover svg {
  fill: var(--cream);
}

/* Loading spinner animation */
.copy-to-llm .loading-spinner {
  animation: spin 1s linear infinite;
}

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

/* Toast notification */
.copy-to-llm-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--md-default-fg-color);
  color: var(--md-default-bg-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
}

.copy-to-llm-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
  .h1-copy-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .h1-copy-wrapper h1 {
    width: 100%;
  }

  .copy-to-llm-split-container {
    margin-left: 0;
    margin-top: 0.5rem;
    position: relative;
  }

  .copy-to-llm-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    min-width: 200px;
    z-index: 10000;
  }
}