@import url("./vendor/bootstrap-icons-1.11.2/bootstrap-icons.min.css");
@import url("./vendor/uialert.js/uialert.css");

:root {
  --altstore-tint-color: #018084;
  --tint-color: var(--color-primary);

  --color-bg: rgba(255, 255, 255, 1);
  --color-bg-secondary: rgba(235, 235, 235, 1);
  --color-separator: rgba(0, 0, 0, 0.15);
  --color-primary: rgba(0, 122, 254, 1);
  --color-transparent: rgba(255, 255, 255, 0.75);

  --color-bg-dark: rgb(26, 25, 27);
  --color-bg-dark-secondary: rgb(46, 45, 47);
  --color-separator-dark: rgba(255, 255, 255, 0.15);
  --color-primary-dark: rgba(11, 132, 254, 255);
  --color-transparent-dark: rgba(26, 25, 27, 0.75);
}
::-webkit-scrollbar-track {
    box-shadow: inset 0 0 0 grey;
    border-radius: 1px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
    background: transparent;
}
* {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  p {
    line-height: 1.375em;
  }
}

#uialert>#text>#title {
  font-weight: 600;
}

/* Dark appearance */
@media (prefers-color-scheme: dark) {
* {
  --color-primary: rgba(10, 132, 255, 1) !important;
}

  body,
  .uibanner,
  #loading,
  .uibanner>.content>div>.text-container {
    background-color: var(--color-bg-dark) !important;
  }

  p,
  h1,
  h2 {
    color: white !important;
  }

  #nav-bar {
    background-color: var(--color-transparent-dark) !important;
  }

  .uibanner,
  #nav-bar {
    border-color: var(--color-separator-dark) !important;
  }

  .app-header .background {
    opacity: 0.35 !important;
  }

  #more button {
    background: linear-gradient(to right, transparent, var(--color-bg-dark) 35%) !important;
  }

  #nav-bar #title>img,
  .app-header img,
  .screenshot {
    border-color: rgba(255, 255, 255, 0.2) !important;
  }

  .secondary-bg {
    background-color: var(--color-bg-dark-secondary) !important;
  }
}

.secondary-bg {
  background-color: white;
}

body.loading {
  overflow: hidden;
}

#loading {
  position: fixed;
  left: 0;
  right: 0;
  height: 100vh;
  margin: 0 auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--color-bg);
}

#loading img {
  width: 24px;
  opacity: 0.5;
}

#loading p {
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.35;
}

body {
  width: 100%;
}

@media screen and (min-device-width: 767px) {
  body {
    margin: 0 auto;
    max-width: 414px;
  }
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

#top {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
}

#main>p:first-of-type {
  text-transform: uppercase;
  font-weight: 500;
  font-size: 0.8em;
  opacity: 0.5;
  padding-left: 1rem;
  margin-top: 3.75rem;
}

/* Navigation bar */

#nav-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 0.1px solid var(--color-separator);
  background-color: var(--color-transparent);
  -webkit-backdrop-filter: saturate(100%) blur(30px);
  backdrop-filter: saturate(100%) blur(20px);
  max-width: 382px;
  min-width: 0;
  margin: 0 auto;
  padding: 0.25em 16px 0.25em 16px;
  z-index: 2;
}

#nav-bar.hide-border {
  border-bottom: none;
}

#nav-bar #title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 2.5em;
  margin: 0;
  overflow: hidden;
  transition: opacity 0.25s ease-in-out;
}

#nav-bar #title>p {
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#nav-bar #title>img {
  max-height: 2em;
  border-radius: 0.5em;
  border: 0.75px solid rgba(0, 0, 0, 0.1);
}

#nav-bar #back {
  cursor: pointer;
  margin-right: 6px;
}

#nav-bar #back .bi {
  margin-left: -8px;
  -webkit-text-stroke: 1px;
  font-size: 1.3em;
}

#nav-bar a {
  margin-left: 6px;
  text-align: right;
}

.nav-bar-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

/* Main */

#main {
  /* padding: 1em; */
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.item {
  margin: 1rem 0;
}

/* Section header */

.header {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 1rem;
}

/* News */

#news-items {
  display: grid;
  height: 100%;
  gap: 1em;
  grid-auto-columns: 95%;
  grid-auto-flow: column;
  overflow-x: scroll;
  padding: 1rem;
  padding-bottom: 0.3rem;
}

#news-items.one {
  grid-auto-columns: 100% !important;
}

#news .item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 1.5em;
  overflow: hidden;
  min-width: 100%;
  height: 100%;
  margin: 0;
}

#news .item>.text {
  margin: 1.5em;
  color: #fff;
  /* Limit to 3 lines */
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#news .item>.text>:not(:last-child) {
  margin-bottom: 0.275em;
}

#news .item>.text>p {
  font-size: 0.9em;
}

#news .item>.text>p:first-of-type {
  font-size: 0.8em;
  font-weight: 500;
  opacity: 0.75;
  text-transform: uppercase;
}

#news .item .image-wrapper {
  max-height: 15.15em;
  overflow: hidden;
}

#news img {
  width: 100%;
  height: auto;
  display: block;
}

.section {
  margin-top: 1rem;
}

/* App header */

#apps.section .item {
  margin: 0;
}

.app-header-container {
  padding: 1rem 1rem 0 1rem;
}

.app-header {
  position: relative;
  display: flex;
  border-radius: 1.5em;
  overflow: hidden;
}

.app-header>.content {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding: 1rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header img {
  display: block;
  border-radius: 14px;
  max-width: 64px;
  border: 0.75px solid rgba(0, 0, 0, 0.1);
}

.app-header .background {
  position: absolute;
  background-color: var(--tint-color);
  opacity: 0.2;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.app-header>.content>.right {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-left: 0.65em;
  min-width: 0;
}

.app-header>.content .text {
  margin-right: 0.5em;
  overflow: hidden;
}

.app-header>.content .text>.title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header>.content .text>.subtitle {
  opacity: 0.5;
  font-size: 0.85em;
  white-space: break-spaces;
}

.app-header-link {
  color: unset;
}

/* About */

#about a:visited {
  color: var(--tint-color)
}

#about.section .item {
  padding: 0 1rem;
}

#about p {
  word-wrap: break-word;
}

/* Buttons */

button.uibutton {
  min-width: 78px;
  height: 32px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  border-radius: 20px;
  color: white;
  background-color: var(--tint-color);
  cursor: pointer;
}

button.uibutton:active {
  opacity: 0.8;
}

/* Links */

a {
  cursor: pointer;
  text-decoration: none;
  color: var(--tint-color)
}

a>button {
  cursor: pointer;
}

@media (hover:hover) {
  a:hover,
  a#more button:hover,
  button#back:hover,
  a.permission-item:hover p.title {
    text-decoration: underline;
  }
  button.uibutton:hover,
  button#add-to-altstore:hover,
  div.news-item-wrapper a>div:hover,
  div.news-item-wrapper a:hover,
  a#edit:hover,
  a#source-code:hover,
  a.app-header-link:hover,
  a.app-header-link>div:hover,
  a.source-link:hover,
  div.source-container:hover {
    text-decoration: none;
    opacity: 0.75;
  }
}

#more button {
  min-width: 0 !important;
  margin-left: 2px !important;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  text-transform: none;
  border-radius: 4px;
  border: none;
  background: unset;
  color: var(--tint-color);
  cursor: pointer;
  position: absolute;
  bottom: 0px;
  right: 0;
  padding-left: 36px;
  background: linear-gradient(to right, transparent, var(--color-bg) 35%);
  line-height: 1.5em;
}

#more:hover {
  opacity: 1;
}

.header a,
#nav-bar #back {
  display: flex;
  align-items: center;
  font-size: 1.05em;
  font-weight: 450;
  border: none;
  background: unset;
  padding: 0;
  color: var(--tint-color);
}

.source-container {
  padding: 0.75rem 1rem 0 1rem;
}

.source {
  display: flex;
  align-items: center;
  /* margin: 0 1rem 0 1rem;
  margin-top: 0.75rem; */
  padding: 1rem;
  border-radius: 1.5rem;
  gap: 0.8rem;
  background-color: var(--tint-color);
}

#source>.header {
  margin-bottom: 0.25rem !important;
}

.source>img {
  max-width: 42px;
  max-height: 42px;
  border-radius: 10px;
}

.source>.right {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: white;
}

.source>.right>.text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.source>.right>.text>.title {
  font-weight: 600;
  font-size: 1rem !important;
  white-space: break-spaces;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source>.right>.text>.subtitle {
  opacity: 0.5;
  font-size: 0.85em;
  white-space: break-spaces;
}

.source>.right>.app-count {
  display: block;
  /* width: 1.5rem; */
  height: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  /* padding: 2px 12px; */
  min-width: 56px;
  height: 32px;
  padding: 0 12px;
  font-size: 15px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 64px;
  /* font-size: 0.85rem; */
  font-weight: 700;
  text-transform: uppercase;
  /* Prevent text from wrapping */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Badges */

.badge {
  margin-left: 0.05rem !important;
  margin-right: 0.05rem !important;
  padding: 0.5px 6.5px;
  font-size: 10px;
  line-height: 1.3333733333;
  font-weight: 700;
  border-radius: 12px;
  border-width: 1px;
  border-style: solid;
  box-sizing: border-box;
  white-space: nowrap;
  display: inline-block;
  background: transparent;
  text-transform: uppercase;
  vertical-align: middle;
  color: white;
  border-color: transparent;
}

.beta.badge {
  margin-bottom: 2px;
  background-color: #f5a10d;
}

.beta.badge::before {
  content: "Beta";
}

.small.badge {
  font-size: 8px;
}

/* uibanner */

.uibanner {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 1px;
  border-bottom: 0.1px solid var(--color-separator);
}

.uibanner {
  background: white;
  margin:auto;
  max-width:400px;
}

@keyframes fade {
  0%, 40%, 100% {
    opacity: 1;
  }
  50%, 90% {
    opacity: 0;
  }
}

.uibanner .icons {
  margin-left: 14px;
  display: grid;
  width: 30px;
  height: 30px;
}

.uibanner .icon {
  grid-column: 1;
  grid-row: 1;
  /* max-width: 30px; */
  width: 30px;
  border-radius: 7px;
  border: 0.75px solid rgba(0, 0, 0, 0.1);
}

.uibanner .icon:last-of-type {
  animation: fade 12s infinite;
}

.uibanner>.content {
  min-height: 28px;
  width: 100%;
  margin-left: 8px;
  padding: 8px 16px 8px 0px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.uibanner>.content>div {
  display: grid;
}

.uibanner>.content>div>.text-container {
  background-color: var(--color-bg);
  grid-column: 1;
  grid-row: 1;
}

.uibanner>.content .text-container:last-of-type {
  animation: fade 12s infinite;
}

.uibanner>.content .text-container>.title-text {
  padding-bottom: 0 !important;
  font-weight: 600;
  font-size: 12.95px !important;
}

.uibanner>.content .text-container>.detail-text {
  padding-top: 0 !important;
  font-size: 11px !important;
  font-weight: 400;
  /* line-height: 12px !important; */
  opacity: 0.55;
}

.uibanner>.content button {
  min-width: 68px !important;
  padding: 5px 13px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  border: none;
  border-radius: 20px;
  color: white;
  background-color: rgb(0, 122, 254);
  cursor: pointer;
}

.uibanner>.content a {
  margin-left: 6px;
  text-decoration: none;
  color: unset;
  font-weight: 600;

  color: white;
}