
:root {
  --dropdown-top-offset: 5px;
  --dropdown-left-offset: 0;
  --dropdown-width-offset: 0;
}

.fabric-view {
  padding: 2rem;
  background-color: var(--background-primary);
  border-left: 1px solid var(--border-color);
}

.fabric-logo-container {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

@keyframes pulse {
  0%, 50%, 100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  25%, 75% {
    transform: scale(1);
    opacity: 1;
  }
}

.fabric-logo-container.loading .fabric-logo {
  animation: pulse 4s infinite ease-in-out;
}

.fabric-loading-text {
  position: absolute;
  bottom: -0.625rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fabric-logo-container.loading .fabric-loading-text {
  opacity: 1;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.fabric-loading-text::after {
  content: '|';
  animation: blink 1s infinite;
  margin-left: 0.125rem;
}

.fabric-logo {
  max-width: 100%;
  height: auto;
  max-height: 28.125rem;
  transition: all 0.3s ease;
}

.fabric-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.25rem;
  color: var(--text-normal);
}

.fabric-content {
  background-color: var(--background-secondary);
  border-radius: 0.625rem;
  padding: 1.25rem 1.25rem 3.125rem 1.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 43.75rem;
  margin: 0 auto;
  position: relative;
}

.fabric-refresh-button,
.fabric-sync-button {
  position: absolute;
  bottom: 0.625rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.fabric-refresh-button {
  right: 0.625rem;
}

.fabric-sync-button {
  right: 3.125rem;
}

.fabric-refresh-button:hover,
.fabric-sync-button:hover {
  color: var(--text-accent);
}

.fabric-buttons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.625rem;
  width: 100%;
  max-width: 28.125rem;
}

.fabric-button {
  flex: 1;
  padding: 0.9375rem;
  border: none;
  border-radius: 0.3125rem;
  background-color: var(--interactive-accent);
  color: var(--text-on-accent);
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  margin: 0 0.625rem;
  position: relative;
  overflow: hidden;
}

.fabric-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.fabric-button:hover::before {
  width: 200%;
  height: 200%;
}

.fabric-button:first-child {
  margin-left: 0;
}

.fabric-button:last-child {
  margin-right: 0;
}

.fabric-button:hover {
  background-color: var(--interactive-accent-hover);
  box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.1);
}

.fabric-button.clipboard {
  background: rgb(171, 118, 209);
  transition: background 0.3s ease;
  margin: 0;
}

.fabric-button.current-note {
  background: rgb(60, 62, 149);
}

.fabric-button.clipboard:hover,
.fabric-button.current-note:hover {
  box-shadow: 0 0 0.625rem rgba(107, 63, 160, 0.5), 0 0 1.25rem rgba(76, 127, 210, 0.5);
}

.fabric-inputs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  width: 100%;
}

.fabric-input,
.fabric-dropdown-input,
.fabric-output-note-input {
  width: 100%;
  max-width: 28.125rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.3125rem;
  background-color: var(--background-primary);
  color: var(--text-normal);
  transition: box-shadow 0.3s ease;
  box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.1);
}

.fabric-input.active,
.fabric-dropdown-input.active,
.fabric-output-note-input.active {
  box-shadow: 0 0 0.625rem rgba(107, 63, 160, 0.5), 0 0 1.25rem rgba(76, 127, 210, 0.5);
}

.fabric-dropdown {
  width: 100%;
  max-width: 28.125rem;
  max-height: 12.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scroll-behavior: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.3125rem;
  background-color: var(--background-primary);
  color: var(--text-normal);
  margin-top: 11.875rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  position: absolute;
  z-index: 100;
}

.fabric-dropdown-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  background-color: var(--background-primary);
  border-radius: 0.3125rem;
  width: 100%;
}

.fabric-dropdown-option.selected {
  background: linear-gradient(to right, #6B3FA0, #4C7FD2);
  color: var(--text-on-accent);
}

.fabric-progress-spinner {
  border: 0.25rem solid var(--border-color);
  border-top-color: var(--interactive-accent);
  border-radius: 50%;
  width: 1.875rem;
  height: 1.875rem;
  animation: spin 2s linear infinite;
  display: none;
  margin: 0 auto;
}

.fabric-progress-spinner.active {
  display: block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.theme-light .fabric-input,
.theme-light .fabric-dropdown-input,
.theme-light .fabric-output-note-input,
.theme-light .fabric-dropdown {
  color: var(--text-normal);
}

.fabric-content {
  position: relative;
  padding-top: 2.5rem;
}

.fabric-yt-toggle-container {
  position: absolute;
  top: 0.625rem;
  left: 0.625rem;
  display: flex;
  align-items: center;
}

.fabric-yt-toggle {
  position: relative;
  width: 1.875rem;
  height: 1.0625rem;
  background-color: #ccc;
  border-radius: 1.0625rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.fabric-yt-toggle.active {
  background-color: #2196F3;
}

.fabric-yt-toggle-slider {
  position: absolute;
  height: 0.8125rem;
  width: 0.8125rem;
  left: 0.25rem;
  bottom: 0.125rem;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.fabric-yt-toggle.active .fabric-yt-toggle-slider {
  transform: translateX(0.625rem);
}

.fabric-yt-label {
  margin-left: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-normal);
}

.fabric-yt-link-list {
  max-height: 18.75rem;
  overflow-y: auto;
  margin-bottom: 0.625rem;
  border: 1px solid var(--background-modifier-border);
  border-radius: 0.25rem;
}

.fabric-yt-link {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--background-modifier-border);
}

.fabric-yt-link:last-child {
  border-bottom: none;
}

.fabric-yt-link.is-selected {
  background: linear-gradient(to right, #6B3FA0, #4C7FD2);
  color: var(--text-on-accent);
}

.fabric-yt-link:hover:not(.is-selected) {
  background-color: var(--background-modifier-hover);
}

.fabric-yt-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
}

.fabric-ts-toggle-container {
  position: absolute;
  top: 2.1rem;
  left: 0.625rem;
  display: flex;
  align-items: center;
}

.fabric-ts-toggle {
  position: relative;
  width: 1.875rem;
  height: 1.0625rem;
  background-color: #ccc;
  border-radius: 1.0625rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.fabric-ts-toggle.active {
  background-color: #2196F3;
}

.fabric-ts-toggle-slider {
  position: absolute;
  height: 0.8125rem;
  width: 0.8125rem;
  left: 0.25rem;
  bottom: 0.125rem;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.fabric-ts-toggle.active .fabric-ts-toggle-slider {
  transform: translateX(0.625rem);
}

.fabric-ts-label {
  margin-left: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-normal);
}

.fabric-ts-link-list {
  max-height: 18.75rem;
  overflow-y: auto;
  margin-bottom: 0.625rem;
  border: 1px solid var(--background-modifier-border);
  border-radius: 0.25rem;
}

.fabric-ts-link {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--background-modifier-border);
}

.fabric-ts-link:last-child {
  border-bottom: none;
}

.fabric-ts-link.is-selected {
  background: linear-gradient(to right, #6B3FA0, #4C7FD2);
  color: var(--text-on-accent);
}

.fabric-ts-link:hover:not(.is-selected) {
  background-color: var(--background-modifier-hover);
}

.fabric-ts-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
}

.skip-button,
.run-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--text-on-accent);
  position: relative;
  overflow: hidden;
}

.skip-button {
  background: rgb(60, 62, 149);
}

.run-button {
  background: linear-gradient(to right, #6B3FA0, #4C7FD2);
}

.skip-button::before,
.run-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.skip-button:hover::before,
.run-button:hover::before {
  width: 200%;
  height: 200%;
}

.run-button:hover {
  box-shadow: 0 0 0.625rem rgba(107, 63, 160, 0.5), 0 0 1.25rem rgba(76, 127, 210, 0.5);
}

.skip-button:hover {
  box-shadow: 0 0 0.625rem rgba(63, 42, 86, 0.5), 0 0 1.25rem rgba(46, 80, 119, 0.5);
}

@keyframes swipeUp {
  0% {
    transform: rotateX(45deg) translateY(0.3125rem);
    opacity: 0;
  }
  100% {
    transform: rotateX(0deg) translateY(0);
    opacity: 1;
  }
}

.fabric-default-model {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9em;
  color: var(--text-muted);
  opacity: 0.8;
}

.fabric-default-model .model-name {
  transition: color 0.5s ease;
  display: inline-block;
}

.fabric-default-model .model-name.updating {
  animation: swipeUp 0.5s ease-out;
  color: var(--text-accent);
}

#model-dropdown {
  top: 22%;
  max-height: 9.375rem;
}

.fabric-button-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.625rem;
}

.fabric-icon-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fabric-icon-button:hover {
  background-color: var(--interactive-hover);
  color: var(--text-accent);
}

.fabric-icon-button svg {
  width: 1.5625rem;
  height: 1rem;
  color: var(--text-muted);
}

.fabric-icon-button:hover svg {
  color: var(--text-accent);
}

.fabric-confirm-deletion {
  padding: 1rem;
  max-width: 18.75rem;
}

.fabric-confirm-deletion h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.fabric-confirm-deletion p {
  margin-bottom: 1rem;
}

.fabric-confirm-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.fabric-confirm-buttons button {
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.fabric-confirm-buttons button:first-child {
  background-color: var(--interactive-accent);
  color: var(--text-on-accent);
}

.fabric-confirm-buttons button:last-child {
  background-color: var(--interactive-normal);
}

.fabric-button.tavily {
  background: linear-gradient(to right, #6B3FA0, #4C7FD2); 
}

.fabric-button.clipboard,
.fabric-button.tavily {
  flex: 0.5;
}

.fabric-tavily-modal {
  background-color: var(--background-primary);
  border-radius: 10px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
}

.fabric-tavily-modal .modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--text-normal);
  text-align: center;
}

.fabric-tavily-modal .fabric-tavily-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--background-secondary);
  color: var(--text-normal);
  font-size: 1rem;
  margin-bottom: 20px;
  transition: box-shadow 0.3s ease;
}

.fabric-tavily-modal .fabric-tavily-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--interactive-accent);
}

.fabric-tavily-modal .fabric-tavily-button-container {
  display: flex;
  justify-content: flex-end;
}

.fabric-tavily-modal .fabric-tavily-search-button {
  background: linear-gradient(to right, #6B3FA0, #4C7FD2);
  color: var(--text-on-accent);
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.fabric-tavily-modal .fabric-tavily-search-button:hover {
  box-shadow: 0 0 10px rgba(107, 63, 160, 0.5), 0 0 20px rgba(76, 127, 210, 0.5);
}

.fabric-tavily-modal .fabric-tavily-search-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.fabric-tavily-modal .fabric-tavily-search-button:hover::before {
  width: 300%;
  height: 300%;
}
.community-patterns-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.25rem;
  color: var(--text-normal);
}

.community-patterns-search {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.3125rem;
  background-color: var(--background-primary);
  color: var(--text-normal);
  transition: box-shadow 0.3s ease;
  box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  margin-top: 1rem;
}

.community-patterns-results {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  margin-top: 1rem;
}

.community-pattern-item {
  background-color: var(--background-secondary);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  min-height: 2rem;
  width: 100%;
}

.community-pattern-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex-grow: 1;
  overflow: hidden;
  text-align: left;
}

.community-pattern-title {
  font-size: 0.8125rem;
  font-weight: bold;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-pattern-description {
  color: var(--text-muted);
  font-size: 0.6875rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-pattern-buttons {
  display: flex;
  gap: 0.25rem;
}

.community-pattern-download,
.community-pattern-update,
.community-pattern-uninstall {
  padding: 0.125rem 0.25rem;
  font-size: 0.6875rem;
  min-width: 3rem;
  border: none;
  border-radius: 0.1875rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.community-pattern-download {
  background-color: var(--interactive-accent);
  color: var(--text-on-accent);
}

.community-pattern-update {
  background-color: var(--text-accent);
  color: var(--text-on-accent);
}

.community-pattern-uninstall {
  background-color: var(--text-error);
  color: var(--text-on-accent);
}

.community-pattern-download:hover,
.community-pattern-update:hover,
.community-pattern-uninstall:hover {
  opacity: 0.8;
}

.fabric-icon-button.community-patterns {
  position: absolute;
  bottom: 0.625rem;
  right: 5.6rem;
  background-color: var(--interactive-normal);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.fabric-icon-button.community-patterns:hover {
  color: var(--text-on-accent);
}

.community-patterns-button-container {
  display: flex;
  gap: 0.5rem; /* Space between buttons */
  margin-bottom: 1rem; /* Space below the button container */
}

.fabric-button.community-patterns-update-all,
.fabric-button.community-patterns-refresh {
  background-color: var(--interactive-normal);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.fabric-button.community-patterns-update-all:hover,
.fabric-button.community-patterns-refresh:hover {
  color: var(--text-accent);
}