:root {
    --color-primary: #2ecc71;
    --color-secondary: #3498db;
    --color-background: #fdfdfd;
    --color-background-hover: #f5f5f5;
    --color-border: #f0f0f0;
    --color-text: #202020;
    --color-red: #e74c3c;
    --color-highlight: #f1c40f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #27ae60;
        --color-secondary: #2980b9;
        --color-background: #1e1e1e;
        --color-background-hover: #2c2c2c;
        --color-border: #333333;
        --color-text: #f0f0f0;
    }
}

.table-primary-color {
    color: var(--color-primary);
}

.table-secondary-color {
    color: var(--color-secondary);
}

.list {
    display: flex;
    flex-direction: column;
    margin: 1rem;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .list {
        margin: 0.5rem;
    }
}

.list-item {
    display: flex;
    flex-direction: column;
    opacity: 1;
    max-height: 200px;
    transition: opacity 0.3s ease 0.7s, max-height 0.3s ease 0.7s;
}

.list-item:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

.list-item-content {
    display: flex;
    justify-content: start;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 1rem;
    align-items: center;
    color: var(--color-text);
    transition: padding-left 0.1s ease, padding-right 0.1s ease;
}

.list-item-accessory.left > .list-item-content {
  padding-left: 7px;
}

.list-item-accessory.right > .list-item-content {
  padding-right: 7px;
}

.list-item-content > .image {
    width: 70px;
    height: 70px;
    border-radius: 4px;
    object-fit: contain;
    background-color: #fff;
}

.list-item-content > img.placeholder, .list-item-content > img[src*="shippingbox.svg"] {
    height: 40px;
    margin: 15px 15px 15px 20px;
}

@media (prefers-color-scheme: dark) {
    .list-item-content > img.placeholder, .list-item-content > img[src*="shippingbox.svg"]  {
        filter: brightness(0) invert(1);
    }
}

.list-item-content > .text > .primary {
    font-size: 1.1rem;
    padding: 5px;
    margin: 0;
}

.list-item-content > .text > .secondary {
    font-size: 0.8rem;
    padding: 0px 5px 5px 5px;
    margin: 0;
}

.list-item-accessory {
    display: flex;
    gap: 0.5rem;
}

.list-item-accessory.left {
    border-left: 7px solid var(--color-primary);
}

.list-item-accessory.left.in-stock {
    border-left: 7px solid var(--color-primary);
}

.list-item.list-item-accessory.left.in-stock.animated > .list-item-content {
    animation: pulseGreen 2s;
}

.list-item-accessory.left.out-of-stock {
    border-left: 7px solid var(--color-red);
}

.list-item.list-item-accessory.left.out-of-stock.animated > .list-item-content {
    animation: pulseRed 2s;
}

@keyframes pulseGreen {
    0% {
        background-color: var(--color-background);
    }
    50% {
        background-color: var(--color-primary);
    }
    100% {
        background-color: var(--color-background);
    }
}

@keyframes pulseRed {
    0% {
        background-color: var(--color-background);
    }
    50% {
        background-color: var(--color-red);
    }
    100% {
        background-color: var(--color-background);
    }
}

.list-item-accessory.right {
    border-right: 7px solid var(--color-secondary);
}

/* main element should always snap into view */
.list-item-content {
  background-color: var(--color-background);
  transition: background-color 0.1s ease;
}

.list-item-content:hover {
  background-color: var(--color-background-hover);
}

/* Remove animation: Turn item background red, then animate height to 0 and opacity to 0 */
.list-item.deleting .list-item-content {
  background-color: var(--color-red);
  transition: background-color 0.3s ease;
}

.list-item.deleting {
  opacity: 0;
  max-height: 0;
}

.list-item.animate-in {
  opacity: 0;
  max-height: 0;
  animation: fadeInExpand 0.3s ease forwards;
}

@keyframes fadeInExpand {
  to {
    opacity: 1;
    max-height: 100px; /* or whatever the max height should be */
  }
}

.list-item.highlight .list-item-content {
  animation: highlight 5s ease forwards;
}

@keyframes highlight {
  0% {
    background-color: var(--color-background);
  }
  10% {
    background-color: var(--color-highlight);
  }

  70% {
    background-color: var(--color-highlight);
  }

  100% {
    background-color: var(--color-background);
  }
}