html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  font-weight: bold;
  justify-content: center;
  background-color: white;
  overflow-x: hidden !important;
  font-family: 'Montserrat', sans-serif;
}

body:has(#loader.show) {
  overflow: hidden;
}

#screen {
  width: 100%;
  background-color: white;
  padding: 10px 10px 90px 10px;
  min-height: calc(100vh - 100px);
}

@media (pointer: fine) {
  #screen {
    width: 600px;
    margin-top: 20px;
    border-radius: 14px;
    min-height: calc(100vh - 120px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
}

#header {
  display: flex;
  align-items: center;
  margin: 5px 2px 10px;
  justify-content: space-between;
}

#logo {
  height: 30px;
  margin: -2px 4px 0px -2px;
}

#title {
  font-size: 16px;
  color: tomato;
  margin-left: 0;
  margin-right: auto;
}

#refresh {
  color: #888888;
  font-size: 13px;
  vertical-align: middle;
}

#menu-section {
  display: flex;
  align-items: center;
  height: 18px;
}

#filter {
  display: none;
  min-width: 50px;
  font-size: 10px;
  /* margin-top: 2px; */
  color: #888888;
  margin-right: 8px;
  text-align: center;
  border-radius: 6px;
  vertical-align: top;
  padding: 2px 10px 0 6px;
  border: 2px solid #F0F0F0;
  background-color: #F0F0F0;
}

#filter.apply {
  display: inline-block;
}

#remove-filter {
  position: relative;
  font-size: 12px;
  color: tomato;
  float: left;
  top: -2px;
}

button, span, li {
  cursor: pointer;
  user-select: none;
}

* {
  user-select: none;
}

#menu-button{
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 18px;
  color: tomato;
  padding: 10px 14px 8px 16px;
}

#no-items {
  top: 40%;
  left: 50%;
  z-index: -1;
  color: #AAAAAA;
  margin-top: 50px;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
}

#loader {
  visibility: hidden;
  position: absolute;
  margin-top: 50px;
  background-color: white;
  width: 100%;
  height: calc(100vh - 60px);
  z-index: 95;
}

#loader.show {
  visibility: visible;
}

#loader.alexa #spin {
  border: 6px solid #F9F9F9;
  border-top: 6px solid #05A0D1;
}

@media (pointer: fine) {
  #loader {
    margin-top: 70px;
    width: 610px;
  }
}

#spin {
  margin-top: 28vh;
  margin-left: auto;
  margin-right: auto;
  border: 6px solid #F9F9F9;
  border-top: 6px solid tomato;
  border-radius: 50%;
  width: 75px;
  height: 75px;
  animation: spin 1.5s linear infinite;
}

#loader img {
  content: url("/images/alexa.png");
  height: 64px;
  visibility: hidden;
  position: absolute;
  margin-top: 30vh;
  margin-left: auto;
  margin-right: auto;
  left: 0;
  right: 0;
}

#loader.alexa img {
  visibility: visible;
}

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

* {
  -webkit-tap-highlight-color: transparent;
}


/***** LISTS *************************/

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: white;
  border: 1px solid #DDDDDD;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.1s ease;
  cursor: pointer;
  color: #4B4B4B;
}

li.selected {
  background-color: #F0F0F0;
}

@media (pointer: fine) {
  li:hover {
    background-color: #F9F9F9;
  }
}

li i, li span i {
  font-size: 18px;
}

.item-text {
  flex-grow: 1;
  margin-right: 10px;
  font-size: 14px;
}

#active-list,
#checked-list {
  margin-bottom: 20px;
}

.drag-handle {
  cursor: grab;
  font-size: 16px;
  color: #AAAAAA;
  margin-top: 2px;
  margin-right: 10px;
}

.drag-handle:active {
  cursor: grabbing;
}

.tags {
  margin-right: 4px;
}

/* .tag {
  font-size: 12px;
  color: transparent;
  margin-right: 10px;
  margin-bottom: 4px;
} */

.tag {
  height: 16px;
  opacity: 0.75;
  margin-right: 10px;
  margin-bottom: -2px;
}

/* li:not([data-stores=""]) .tag {
  color: tomato;
} */

#checked-list li {
  background-color: #E0E0E0;
  color: #888888;
}

#checked-list li.selected {
  background-color: #C0C0C0;
  color: #888888;
}

#checked-list li .item-text {
  text-decoration: line-through;
}

#checked-list li:not([data-stores=""]) .tag {
  /* color: #888888 !important; */
  opacity: 0.5; 
  filter: grayscale(1);
}


/***** MODAL *************************/

#modal {
  position: fixed;
  bottom: env(safe-area-inset-bottom);
  left: 1px;
  right: 1px;
  height: 35px;
  z-index: 99;
  background-color: white;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px 20px 24px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
  transition: height 0.3s ease;
}

@media (pointer: fine) {
  #modal {
    margin-left: auto;
    margin-right: auto;
    width: 580px;
  }
}

#input-group {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

#input-group input {
  flex: 1;
  color: #4B4B4B;
  padding: 10px;
  border-radius: 25px;
  font-weight: bold;
  border: 2px solid #888888;
  margin-right: 10px;
  padding-inline-end: 38px;
}

#input-group input.error {
  animation: input-error 2s 1;
}

@keyframes input-error
{
    0%      {border-color:#888888;}
    25%     {border-color:#FF6B6B;}
    75%     {border-color:#FF6B6B;}
    100%    {border-color:#888888;}
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  appearance: none;
}

#input-group input:focus-visible {
  outline: none;
}

#add-button {
  background-color: tomato;
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

/* #modal.checked #add-button {
  pointer-events: none; 
  background-color: #AAAAAA;
} */

body:has(#loader.show) #add-button, 
body:has(#loader.alexa) #add-button {
  pointer-events: none; 
  background-color: #E0E0E0;
}

#modal.checked {
  background-color: #F0F0F0;
}

#modal.checked .store,
#modal.checked input:disabled {
  pointer-events: none;
  background-color: #E0E0E0;
}

#modal.checked .store.checked {
  border-color: #888888;
  background-color: #888888;
}

#modal.checked .store i {
  color: #E0E0E0;
}

#modal.checked .store img {
  opacity: 0.5; 
  filter: grayscale(1);
}

#modal input::placeholder {
  color: #AAAAAA;
}

.store {
  display: flex;
  margin: 10px 0;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 8px 6px;
  text-align: left;
  color: #888888;
  border-radius: 6px;
  background-color: #F0F0F0;
  /* border: solid 2px #F0F0F0; */
}

.store.checked {
  color: white;
  background-color: #FF6347BF;
}

.store.checked .fa-solid {
  color: white !important;
}

/* .store .fa-store {
  color: tomato;
  margin-top: 1px;
  margin-left: 2px;
  margin-right: 8px;
} */

.store img {
  height: 14px;
  opacity: 0.75;
  margin-top: -1px;
  margin-left: 2px;
  margin-right: 8px;
}

/* .store.checked img {
  filter: grayscale(1);
} */

.store .fa-check {
  margin-left: auto;
  margin-top: 1px;
  margin-right: 0;
  color: #F0F0F0;
}

.store .fa-filter {
  margin-left: auto;
  margin-top: 1px;
  margin-right: 0;
  color: #E9E9E9;
}

#expand-button {
  color: #4B4B4B;
  background-color: transparent;
  border: none;
  position: absolute;
  right: 68px;
  margin-top: 4px;
  margin-bottom: 2px;
  font-size: 18px;
  padding: 10px 14px;
}

#expand-button sup {
  color: transparent;
  position: absolute;
  top: -2px;
  right: 8px;
}

@media (pointer: fine) {
  #expand-button sup {
    top: 0px;
  }
}

#modal:not(.expanded) #expand-button.stores-selected sup {
  color: tomato;
}

#delete-button {
  display: none;
  color: #FF6B6B;
  background-color: transparent;
  border: none;
  width: 100%;
  font-weight: bold;
  font-size: 10px;
  margin-top: 10px;
}

#delete-button i {
  font-size: 12px;
}


/***** SIDE MENU *************************/

#side-menu {
  top: 0;
  right: -360px;
  z-index: 100;
  height: 100%;
  width: 280px;
  position: fixed;
  padding: 12px 14px 0 12px;
  background-color: #F9F9F9;
  transition: transform 0.5s ease;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

#side-menu.open {
  transform: translateX(-360px);
}

@media (pointer: fine) {
  #side-menu {
    opacity: 0;
    right: unset;
    z-index: -100;
    margin-top: 20px;
    box-shadow: none;
    margin-left: auto;
    position: absolute;
    border-radius: 14px;
    margin-right: -640px;
    max-height: calc(100vh - 32px);
    transition: transform 0.5s ease, opacity 0.5s ease, z-index 0.25s ease;
  }
  
  #side-menu.open {
    opacity: 1;
    z-index: 100;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transform: translateX(-164px);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  }
}

#side-menu .store {
  padding: 8px 8px;
  background-color: #E9E9E9;
  /* border: solid 2px #E9E9E9; */
}

#side-menu .store img {
  height: 16px;
  margin-top: -1px;
}

#side-menu .store.checked {
  color: white;
  background-color: #FF6347BF;
}

.toggle-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  outline: none;
}

.toggle-text {
  margin-top: 3px;
  font-size: 10px;
  color: #AAAAAA;
  margin-right: 4px;
}

.toggle-span {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #E9E9E9;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 16px;
  border: none;
}

.toggle-span:before {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-span {
  background-color: #FF6347BF;
}

input:checked + .toggle-span:before {
  -webkit-transform: translateX(14px);
  -ms-transform: translateX(14px);
  transform: translateX(14px);
}

#close-menu {
  left: -14px;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: tomato;
  font-weight: bold;
  padding: 8px 14px;
  margin-top: -4px;
  position: relative;
  margin-bottom: -14px;
  background-color: transparent;
}

.separator:has(+ #sort-date) {
  margin-bottom: 8px;
}

#side-menu .sort {
  font-size: 12px;
  color: #888888;
  border: none;
  font-weight: bold;
  background-color: transparent;
  text-align: left;
  min-width: 300px;
  top: -4px;
  margin-bottom: 10px;
}

#side-menu .sort i {
  font-size: 14px;
  color: #FF6347BF;
}

#side-menu .option {
  border: none;
  color: tomato;
  font-weight: bold;
  background-color: transparent;
  text-align: left;
  min-width: 300px;
  margin-bottom: 24px;
}

#clear-checked:has(+.open) {
  color: #E0E0E0;
}

#clear-confirmation {
  visibility: hidden;
  margin-top: -20px;
  transform: translateY(-20px);
  transition: visibility 0.25s, transform 0.5s ease;
}

#clear-confirmation.open {
  visibility: visible;
  transform: translateY(10px);
}

#clear-confirm.option {
  color: #71BF84;
  min-width: initial;
  margin-right: 16px;
}

#clear-cancel.option {
  color: #888888;
  min-width: initial;
}

#stores-filter {
  margin-bottom: 28px;
}

.separator {
  display: flex;
  font-size: 10px;
  color: #AAAAAA;
  margin-top: 4px;
  margin-bottom: 18px;
}

.separator hr {
  position: relative;
  display: inline-block;
  margin-bottom: 4px;
  border: 1.4px solid #E0E0E0;
}

.separator > hr:first-of-type {
  flex-grow: 1;
  margin-right: 5px;
}

.separator > hr:last-of-type {
  width: 2%;
  margin-left: 5px;
}

#version {
  visibility: hidden;
  position: absolute;
  color: #AAAAAA;
  font-size: 10px;
  bottom: 32px;
  right: 24px;
}

#version.show {
  visibility: visible;
}


/***** TOAST NOTIFICATIONS *************************/

.toast {
  top: 20px;
  width: 84vw;
  z-index: 100;
  max-width: 84vw;
  position: fixed;
  margin-left: auto;
  border-radius: .5rem;
  background: #FFFFFF;
  padding: 0.5rem 0.75rem;
  transform: translateY(110%);
  box-shadow: -1px 1px 10px rgba(0, 0, 0, 0.3);
}

@media (pointer: fine) {
  .toast {
    top: 45px;
    width: 450px;
    max-width: 450px;
  }
}

.toast.animated {
    animation: slideIn 0.3s ease-in-out forwards, fadeOut 0.25s ease-in-out forwards 2s;
}

.toast.static {
    animation: slideIn 0.3s ease-in-out forwards;
}

.toast.closing {
    animation: slideOut 0.5s ease-in-out forwards;
}

.toast-message {
  flex: 1;
  font-size: 12px;
  color: white;
  padding: 0.5rem 1.5rem 0.5rem 0.25rem;
  margin-bottom: 3px;
}

.toast-progress {
  position: absolute;
  display: block;
  bottom: -2px;
  left: 0;
  height: 4px;
  width: 100%;
  background-color: white;
  opacity: 0.25;
  animation-name: toastProgress;
  animation-duration: 0s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

.toast-content-wrapper {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  position: absolute;
  right: 4px;
  margin-top: 1px;
  margin-bottom: 4px;
}

  .close-btn > button {
      display: flex;
      border: none;
      padding: 0 .15rem;
      background-color: transparent;
      border-bottom-left-radius: .5rem;
  }

  .close-btn > * > i {
    font-size: 18px;
    color: white;
    opacity: 0.7;
  }

.toast-icon {
  display: flex;
  align-items: center;
  line-height: 1;
  padding: 0.35rem;
  margin-bottom: 4px;
  font-size: 14px;
}

  .toast-icon > * > i {
    display: flex;
    color: white;
  }

.toast.toast-success {
  background: #71BF84;
}

.toast.toast-info {
  background: #05A0D1;
}

.toast.toast-warning {
  background: #FFC85E;
  /* text-shadow: 0px 1px 2px #0000001A; */
}

.toast.toast-remove {
  background: #FF6B6B;
}

.toast.toast-error {
  background: #FF6B6B;
}

  .toast-error .toast-progress {
    background-color: white;
  }

@keyframes slideIn {
  0% {
    transform: translateY(-110%);
  }

  75% {
    transform: translateY(10%);
  }

  100% {
    transform: translateY(0%);
  }
}

@keyframes slideOut {
  0% {
    transform: translateY(0%);
  }

  25% {
    transform: translateY(10%);
  }

  100% {
    transform: translateY(-200%);
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes toastProgress {
  0% {
    width: 100%;
  }

  100% {
    width: 0%;
  }
}
