@keyframes placeholder {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.panel-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.preset-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: workspaceLeafIn 320ms cubic-bezier(0.1, 0, 0.1, 1.25) both;
  border: 1px solid var(--background-modifier-border);
  border-radius: 24px;
  background-color: var(--background-primary);
  padding: 16px;
}
.preset-panel p {
  flex: 1;
  text-align: left;
}
.preset-panel picture {
  position: relative;
  cursor: zoom-in;
  border-radius: 8px;
  background-color: var(--background-secondary);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.preset-panel picture img {
  display: block;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.15));
  transition: 320ms cubic-bezier(0.1, 0, 0.1, 1.25);
  margin-top: 16px;
  margin-left: 16px;
  border-radius: 4px;
  width: 200%;
  user-select: none;
}
.preset-panel picture:hover img {
  transform: translateX(-4px) translateY(-4px);
}
.preset-panel picture.loading img {
  transform: translateY(32px);
  opacity: 0;
}

.preset-panel picture .preset-img-loader {
  position: absolute;
  z-index: 1;
  animation: placeholder 1s linear infinite;
  transition: 320ms;
  inset: 0;
  background: linear-gradient(90deg, var(--background-secondary), var(--background-primary), var(--background-secondary));
  background-size: 200% 100%;
}
.preset-panel picture:not(.loading) .preset-img-loader {
  opacity: 0;
}

.preset-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preset-info p,
.preset-info a {
  color: var(--text-faint);
}

.preset-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--background-modifier-border);
  border-radius: 24px;
  background-color: var(--background-primary);
  padding: 8px;
}
.preset-search {
  flex: 1;
  outline: none;
  border: none;
  background-color: transparent;
  height: -webkit-fill-available;
  font-size: 1em;
  text-indent: 8px;
}
.preset-search:not(:placeholder-shown)::-webkit-search-cancel-button {
  opacity: 1;
  cursor: pointer;
}
.preset-filter {
  transition: 320ms cubic-bezier(0.1, 0, 0.1, 1.25);
  border: none;
}
.preset-filter:active {
  transform: scale(0.75);
  opacity: 0.75;
}

/* Lightbox */

.lightbox-overlay {
  display: flex;
  position: fixed;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  perspective: 240px;
  opacity: 0;
  z-index: 9999;
  transition: 320ms;
  cursor: zoom-out;
  inset: 0;
  background-color: var(--background-secondary);
  pointer-events: none;
}
.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-img {
  transition: 320ms cubic-bezier(0.1, 0, 0.1, 1.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.lightbox-title {
  transition: 320ms cubic-bezier(0.1, 0, 0.1, 1.25);
  color: var(--text-faint);
}
.lightbox-overlay:not(.active) .lightbox-img {
  transform: scale(0.95) rotateX(-1deg);
  opacity: 0;
  filter: blur(4px);
}
.lightbox-overlay:not(.active) .lightbox-title {
  transform: translateY(-32px);
  opacity: 0;
  filter: blur(4px);
}

/* Settings Replica */
.setting {
  border-radius: 16px 16px 0 0;
  background: var(--background-secondary);
}
.setting-sidebar,
.setting-content {
  border-right: none;
  background-color: transparent;
}
.sidebar-section {
  gap: 0;
}
.sidebar-title {
  padding: 8px 16px;
  font-size: 0.85rem;
}
.sidebar-link.is-active {
  display: flex;
  align-items: center;
  background-color: transparent;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 1rem;
}
.sidebar-link::before {
  position: absolute;
  margin-left: -12px;
  border-radius: 100vh;
  background-color: var(--text-normal);
  width: 4px;
  height: 4px;
  content: "";
}
.setting-search {
  border-radius: 8px;
}
.setting-actions button {
  border-radius: 100vh;
  padding: 0 12px;
}
.setting-actions button:first-child {
  animation: pulse 3s infinite alternate;
}
