//////////////////////////////
// Popup Styles
//////////////////////////////

@import "popup.scss";
@import "../icons/bootstrap-icons.css";

//////////////////////////////
// Card & Size Modifications
//////////////////////////////

html, body {
  min-height: 34rem;
  position: relative;
  overflow-x: hidden;
}

#card-navigation {
  border-bottom-width: 0 !important;
}

.card-body {
  padding: 0;
}

.card-footer {
  position: sticky;
  bottom: 0;
  width: 100%;
}

.card-offcanvas {
  --bs-card-cap-padding-y: .5rem;
  --bs-card-cap-padding-x: 1rem;
  --bs-card-cap-bg: rgba(var(--bs-body-color-rgb), .03);
  --bs-card-border-width: var(--bs-border-width);
  --bs-card-border-color: var(--bs-border-color-translucent);
  --bs-card-border-radius: var(--bs-border-radius);
}

.card-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.card-offcanvas-header .btn-close {
  margin-right: -0.5rem;
}

.card-offcanvas-body {
  padding: 1rem 1rem;
}

.tiny {
  font-size: 0.7em;
}

//////////////////////////////
// List Styles
//////////////////////////////

.list-group-flush > .list-group-item {
  padding: 0.5rem 0.75rem;
}

.list-group-border-last > .list-group-item:last-child {
  border-bottom-width: 1px;
}

.list-group-no-border > .list-group-item {
  border: none;
  padding-bottom: 0;
}

.list-group-item-action {
  padding: 0.5rem 0.75rem;
  border-top: none;
}

.text-overflow-hide, .text-overflow-hide > * {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25rem;
}

//////////////////////////////
// Grid View Styles
//////////////////////////////

#grid-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0 auto;
  max-width: 800px;
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.25rem;
  border: none;
  position: relative;
  cursor: pointer;
  height: 85px;
  width: 95px;

  .site-icon, .list-group-item-name {
    transition: opacity 0.2s ease-in-out;
  }

  &:hover {
    .site-icon, .list-group-item-name {
      opacity: 0.7;
    }
  }

  .icon-container {
    width: 36px;
    height: 36px;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .site-icon {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .letter-icon {
    width: 100%;
    height: 100%;
  }

  .list-group-item-name {
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1.2;
    max-height: none;
    overflow: visible;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    width: 100%;
    white-space: normal;
  }

  .grid-item-buttons {
    display: none;
    position: fixed;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 0.25rem;
    z-index: 1000;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    min-width: 90px;

    .btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      margin-bottom: 0.125rem;
      padding: 0.25rem;
      font-size: 0.875rem;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  &.active .grid-item-buttons {
    display: block;
  }
}

.grid-status {
  padding: 0.5rem 0.75rem;
}

//////////////////////////////
// Search Styles
//////////////////////////////

#search-box {
  transition: visibility 0.18s linear, opacity 0.18s linear;
  visibility: visible;
  opacity: 1;
}

#search-box.invisible {
  visibility: hidden;
  opacity: 0;
}

//////////////////////////////
// Image Icon
//////////////////////////////

.site-icon {
  height: 32px;
  width: 32px;
}

//////////////////////////////
// Letter Icon
//////////////////////////////

.letter-icon {
  background-color: #505050;
}

.letter-icon::before {
  content: attr(data-letter);
  text-transform: uppercase;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  height: 32px;
  width: 32px;
  font-size: 1.2rem;
}

//////////////////////////////
// Navigation Colors
//////////////////////////////

#card-navigation {
  --bs-nav-link-color: #555d65;
  --bs-nav-link-hover-color: #3e4449;
}

@media (prefers-color-scheme: dark) {
  #card-navigation {
    --bs-nav-link-color: #b9b9b9;
    --bs-nav-link-hover-color: #b0b0b0;
  }
}
