html {
  height: 100%;
}

.loading {
  padding-top: 1rem;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.search {
  width: 100%;
  padding: 1rem;
  display: flex;
  justify-content: center;
  font-size: 1rem;
  position: sticky;
  top: 0;
  background: #FFFFFF90;
  border-bottom: 1px solid #00000020;
  -webkit-backdrop-filter: blur(1rem);
  backdrop-filter: blur(1rem);
  z-index: 1;
}

.search input {
  margin: 0;
}

#apps {
  --padding: 8px;
  --icon: 64px;

  width: 100%;
  margin: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

#apps .ellipse {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#apps header {
  text-align: center;
}

/* Search */ 

#search_field {
  border-radius: 50px;
  min-width: 50%;
  max-width: 100%;
}

#app_container {
  max-width: 1300px;
  display: flex;
  flex-wrap: wrap;
  place-content: flex-start center;
  height: 100%;
  width: 100%;
}

.app {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: initial;
  border-bottom: 1px solid #00000020;
  height: fit-content;
  background: none;
  text-align: left;
  font-size: 1rem;
  gap: 0.9rem;
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}
a.app {
  color: var(--text);
}

#apps img {
  width: var(--icon);
  min-width: var(--icon);
  height: var(--icon);
  margin-right: calc(var(--padding));
}

#apps .title {
  font-weight: bold;
  line-height: 1.3;
}

#apps .description {
  max-height: 60px;
  line-height: 1.2;
  font-size: 0.9rem;
}

#apps .props {
  width: 100%;
}

#apps .author {
  opacity: 0.8;
  font-size: .9rem;
}

#footer {
  text-align: center;
  margin-top: 3em;
  margin-bottom: 2em;
}

#footer a {
  padding: .5em;
}

/*
  -------
  Buttons 
  -------
*/

button, .button {
  text-align: center;
  margin: 0;
  padding-left: 1rem;
  padding-right: 1rem;
}

button.ghost, .button.ghost {
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
}

/*
  -------
  Dialogs 
  -------
*/

dialog {
  font-size: 1rem;
  color: var(--text);
  padding: 2rem;
  background: var(--bg);
  min-height: 100vh;
  margin: 0;
  width: 100%;
  border: none;
  gap: 1rem;
}

dialog .app-container {
  display: flex;
  gap: var(--padding);
}

dialog .button-container {
  display: flex;
  gap: var(--padding);
  width: 100%;
  flex-direction: column;
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog .metadata {
  display: flex;
  flex-direction: column;
}

dialog .additional-info {
  display: flex;
  flex-direction: column;
}

/*
  -------
  Tabs 
  -------
*/

#tabs {
  position: sticky;
  bottom: 0;
  padding: 1rem;
  background: #FFFFFF95;
  border-top: 1px solid #00000020;
  -webkit-backdrop-filter: blur(1rem);
  backdrop-filter: blur(1rem);
  display: flex;
  gap: 1rem;
  width: 100%;
}

#tabs > button {
  width: 100%;
  background: transparent;
  color: black;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  transition: all .3s;
  border: 1px solid transparent;
}

#tabs > button:hover {
  filter: brightness(1.9);
  background: #00000010;
}

#tabs > button:active, #tabs > button.active {
  background: #00000020;
  border: 1px solid #00000050;
}

#tabs > button > svg {
  width: calc(var(--icon) / 2);
  height: calc(var(--icon) / 2);
}

@media screen and (width >= 670px) {
  #search_field {
    max-width: 80%;
  }

  .app {
    width: 300px;
    gap: .3rem;
    border-radius: var(--padding);
    border: none;
    padding: .8rem;
    margin: .5rem;
  }

  dialog {
    margin: auto;
    margin-top: 2rem;
    min-width: calc(640px - (15px * 2));
    max-width: calc(640px - (15px * 2));
    min-height: auto;
    box-shadow: 0 19px 38px rgb(0 0 0 / 12%);
    border-radius: var(--padding);
  }

  dialog .button-container {
    display: flex;
    gap: var(--padding);
    width: fit-content;
    flex-direction: row;
  }
}

@media (prefers-color-scheme: dark) {
  .app {
    border-color: #FFFFFF20;
  }

  .search {
    background: #00000095;
    border-bottom: 1px solid #00000020;
  }

  #tabs {
    position: sticky;
    bottom: 0;
    padding: 1rem;
    background: #00000095;
    border-top: 1px solid #00000020;
    backdrop-filter: blur(1rem);
    display: flex;
    gap: 1rem;
  }
  
  #tabs > button {
    width: 100%;
    background: transparent;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
    transition: all .3s;
    border: 1px solid transparent;
  }
  
  #tabs > button:hover {
    filter: brightness(1.9);
    background: #FFFFFF10;
  }
  
  #tabs > button:active,  #tabs > button.active {
    background: #FFFFFF30;
    border: 1px solid #FFFFFF30;
  }
}