#pageContent {
  display: flex;
  height: 100%;
  width: 100%;
  gap: 5px;
}

#openAside {
  display: none;
}

#filterHeaderLeftLines,
#filterHeaderRightLines {
  display: none;
}



#sidebar {
  min-width: 100px;
  overflow-y: auto;
}

a {
  text-decoration: none;
  color: #000;
}


.softwareListGrid,
.emulatorListGrid {
  flex: 1;
  height: 100%;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, max-content));
  justify-content: center;
  gap: 20px;

  padding: 10px;
  background-color: #CFCFCF;

  overflow-y: auto;
  overflow-x: hidden;
}

.softwareCardDiv,
.emulatorCardDiv {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* space content vertically */
  align-items: center;

  height: 54vh;

  padding: 1rem;

  border: 1px solid #9B9B9B;
  border-radius: 10px;
  background: #D9D9D9;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid #9B9B9B;
}

/*raises the card as the mouse moves over*/
.softwareCardDiv:hover,
.emulatorCardDiv:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.16),
    0 4px 6px rgba(0, 0, 0, 0.12);
}

.cardContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;

  text-align: center;
  width: 100%;
}

.squareBtnClose {
  position: absolute;
  top: 12px;
  right: 12px;

  display: flex;
  justify-content: center;
  align-items: center;

  height: 28px;
  width: 28px;
  border-radius: 6px;

  background: transparent;
  border: 1px solid #fff;
  color: #fff;

  cursor: pointer;
}

.softwareCardButtons,
.emulatorCardButtons {
  position: absolute;
  bottom: 1rem;
  right: 1rem;

  display: flex;
  gap: 0.5rem;

  z-index: 10;

  bottom: clamp(0.5rem, 2vw, 1rem);
  right: clamp(0.5rem, 2vw, 1rem);

  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.softwareCardButtons button,
.emulatorCardButtons button {
  border-radius: 6px;

}

.softwareCardButtons button:hover,
.emulatorCardButtons button:hover {
  background-color: #7c7c7d;
  color: #fff;
}

.softwareCardButtons,
.emulatorCardButtons {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.softwareCardDiv:hover .softwareCardButtons,
.emulatorCardDiv:hover .emulatorCardButtons {
  opacity: 1;
  pointer-events: auto;
}

#softwareResearchbar,
#emulatorResearchbar {
  border-radius: 6px;
}

#softwareSearchBarDiv,
#emulatorSearchBarDiv {
  display: flex;
  gap: 2px;
  padding: 5px;
}

.softwareCardButtons,
.emulatorCardButtons {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cardImage img {
  border-radius: 10px;
}


@media (max-width: 690px) {

  #openAside {
    display: block;
    width: 5rem;
    padding: 0.4rem;
    font-size: 1rem;
    border-radius: 6px;
    background-color: #D3CBCB;
    color: #3C3C43CC;
    border: 1px solid #b2afaf;
  }

  #openAside:hover {
    background-color: #7c7c7d;
    color: #fff;
  }

  #filterHeaderLeftLines,
  #filterHeaderRightLines {
    display: block;
  }

  #filterHeader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
  }

  #filterHeaderLeftLines,
  #filterHeaderRightLines {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  #filterHeaderLeftLines .hl,
  #filterHeaderRightLines .hl {
    display: block;
    /* important */
    height: 1px;
    margin: 0.5px 0;
    width: 60px;
    background: #3C3C43CC;
  }

  #sidebar {
    position: fixed;
    top: 80px;
    right: 0;
    width: 200px;
    height: 60vh;
    z-index: 1000;

    padding: 10px;
    margin: 0;
    gap: 6px;
    align-items: center;

    overflow-x: hidden;
    overflow-y: auto;


    
    background-color: #D3CBCB;
    border-top-left-radius: 10px;
    fill: #bdb5b5;

    border-color: #9E9696;
    box-shadow:
      inset 0 2px 2px rgba(255, 255, 255, 0.3),
      0 1px 3px rgba(0, 0, 0, 0.2);
  
    transform: translateX(110%);
    transition: transform 0.3s ease;

  }

  #sidebar.aside-visible {
    transform: translateX(0);
    /* shown */
  }

  #softwareSearchBarDiv {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  #softwareSearchBarDiv button {
    width: 30px;
    height: 30px;
    border-radius: 6px;

    display: flex;
    align-items: center;
    /* vertical centering */
    justify-content: center;
    /* horizontal centering */
    padding: 0;
    /* optional, depends on your design */
    transition: filter 0.2s ease;
  }

  #softwareSearchBarDiv button img {
    width: 20px;
    height: 20px;

    display: block;

  }

  #softwareSearchBarDiv:hover img {
    filter: brightness(0) saturate(100%) invert(60%);
  }


  .softwareListGrid,
  .emulatorListGrid {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  #pageContent {
    flex-direction: column;
  }


  .softwareCardDiv .emulatorCardDiv {
    min-height: 220px;
    max-width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
  }

  .cardContent {
    gap: 0.5rem;
  }

  .cardContent div {
    font-size: 0.9rem;
  }

  .cardContent img {
    height: 45vh;
  }


}