/* normalize stylesheet */
@import "./modern-normalize.css";

/* reset stylesheet */
:root {
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
figure,
p,
ol,
ul {
  margin: 0;
}

ol[role="list"],
ul[role="list"] {
  list-style: none;
  padding-inline: 0;
}

h1,
h2,
h3,
h4,
h5 {
  font-size: inherit;
  font-weight: inherit;
}

img {
  display: block;
  max-inline-size: 100%;
}

/* custom */

body {
  background-color: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

aside {
  padding: 20px;
  background-color: #f1f5f9;
  position: fixed;
  width: 380px;
  min-height: 100vh;
  z-index: 2;
  border-radius: 0 15px 15px 0;
  box-shadow: 8px 0 10px -4px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: 340px auto;
  gap: 10px;
}

aside .sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

main {
  margin-left: 380px;
  flex: 1;
}

footer {
  margin-left: 380px;
  text-align: center;
  background-color: #f8fafc;
}

pre {
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
}

nav > ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1.2rem;
  font-weight: 500;
}

nav > ul > li {
  background-color: #e2e8f0;
  border-radius: 15px;
  transition: all 0.3s ease-in-out;
  border: 1px solid transparent;
  margin-left: 20px;
}

nav > ul > li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: #cbd5e1;
}

nav > ul > li > a {
  display: block;
  padding: 10px 20px;
}

aside header {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

aside button {
  padding: 7px 30px 10px 25px;
  border-radius: 40px;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.1),
    inset 0 -2px 5px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 0, 0, 0.3);
  background-color: #64748b;
  font-weight: 500;
  color: white;
  font-size: 1.1rem;
  border: none;
  transition: all 0.3s ease-in-out;
  margin-inline: 10px;
}

aside button:hover {
  transform: scale(1.05);
  background-color: #475569;
}

dialog {
  border-radius: 12px;
  background-color: #f8fafc;
  border: 2px solid #cbd5e1;
  width: 400px;
}

dialog form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

dialog h4 {
  font-size: 1.5rem;
  font-weight: 500;
}

.delete-input {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dialog-buttons {
  display: flex;
  justify-content: space-between;
}

.dialog-buttons button {
  padding: 5px 15px;
  font-weight: 500;
  font-size: 1.1rem;
  border-radius: 8px;
  border-width: 1px;
}

.dialog-delete {
  color: white;
  background-color: #f53333;
}

.icon-text {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-text > img {
  width: 24px;
}

.index {
  padding-top: 150px;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 20px 40px 20px 50px;
  position: fixed;
  top: 0;
  left: 370px;
  right: 0;
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px);
}

.filter::before {
  position: absolute;
  bottom: 0;
  left: 25px;
  right: 15px;
  height: min-content;
  border-bottom: 0.5px solid rgba(100, 116, 139, 0.5); /* slate-500/50 */
  content: "";
}

.filter::after {
  position: absolute;
  bottom: 0;
  left: 25px;
  right: 15px;
  height: 2px;
  background-color: #0f172a; /* slate-950 */
  content: "";
  transform-origin: center left;
  animation: progress linear;
  animation-timeline: scroll(root block);
}

@keyframes progress {
  from {
    transform: scaleX(0);
  }
}

.filter > p {
  font-size: 1.2rem;
  font-weight: 500;
}

.filter > form {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 1fr;
  gap: 50px;
}

.filter > form > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.filter label {
  font-weight: 500;
}

.filter button {
  align-self: end;
  justify-self: center;
  padding: 6px 25px;
  font-weight: 500;
}

.list {
  padding: 20px 40px;
  display: flex;
  flex-direction: column;
}

.list > h2 {
  font-size: 2rem;
  font-weight: 600;
}

.item-number {
  font-size: 0.95rem;
}

.cards {
  margin-block: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cards > article {
  display: grid;
  grid-template-columns: 1fr 2fr;
  background-color: #64748b;
  color: white;
  border-radius: 12px;
  transition: all 0.3s ease-in-out;
  border: 1px solid transparent;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.4);
}

.cards > article:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: #475569;
}

.cards > article > a > img {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.cards > article > a > div {
  background-color: #f8fafc;
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.cards > article > div {
  padding-block: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cards > article > div > a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-inline: 25px;
}

.cards > article > div > p {
  font-weight: 500;
  padding-inline: 25px;
  overflow-wrap: anywhere;
}

.cards > article > div > p > a {
  text-decoration-line: underline;
  color: #bfdbfe;
}

.cards h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

.cards .desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 500;
  flex-wrap: wrap;
}

.category > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category > div > p {
  background-color: #475569;
  padding: 3px 8px;
  border-radius: 12px;
}

.pagination {
  align-self: center;
  display: grid;
  align-items: center;
  justify-items: start;
  grid-template-columns: auto 35px auto;
  gap: 15px;
  font-weight: 500;
}

.pagination .icon-text {
  gap: 0;
}

.pagination > p {
  background-color: #64748b;
  color: white;
  text-align: center;
  justify-self: stretch;
  padding-block: 3px;
  border-radius: 8px;
  font-size: 1.2rem;
}

.pagination img {
  width: 28px;
}

.disable {
  pointer-events: none;
  cursor: default;
  opacity: 0.2;
}

main.no-filter {
  padding: 40px 80px;
}

.no-filter h2 {
  font-size: 2rem;
  font-weight: 600;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 5px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.form-body {
  display: grid;
  grid-template-columns: max-content auto;
  gap: 20px;
  justify-items: start;
}

.form label {
  font-size: 1.1rem;
}

.form input,
.form textarea,
dialog input {
  padding: 3px 8px;
  line-height: 1.5;
}

.form textarea {
  resize: none;
}

.form button {
  padding: 6px 25px;
  font-size: 1.2rem;
  font-weight: 500;
}

#password {
  min-width: 250px;
}

#name {
  min-width: 500px;
}

#description,
#features,
#stack,
#source,
#website,
#image,
#category,
#language,
#tool {
  width: 100%;
}

.required {
  font-size: 0.95rem;
  color: red;
  font-weight: 500;
}

.error-msg {
  color: red;
  font-weight: 500;
  font-size: 1.2rem;
}

.error-details {
  color: red;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.project > h2 {
  margin-bottom: 15px;
}

.project > img {
  border-radius: 12px;
  border: 1px solid #cbd5e1;
}

.project .info-section {
  font-weight: 500;
  font-size: 1.1rem;
}

.project .info-section > p {
  overflow-wrap: anywhere;
}

.project .info-section a {
  text-decoration-line: underline;
  color: #475569;
}

.tags {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #64748b;
  flex-wrap: wrap;
}

.tags > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-tag,
.language-tag {
  padding: 3px 8px;
  border-radius: 12px;
}

.category-tag {
  background-color: #fcd34d;
  color: #78350f;
  border: 1px solid #78350f;
}

.language-tag {
  background-color: #99f6e4;
  color: #134e4a;
  border: 1px solid #134e4a;
}

.project section h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

.project-buttons {
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
}

.project-buttons button {
  padding: 8px 25px;
  font-size: 1.3rem;
  font-weight: 500;
  color: white;
  border-width: 1px;
  border-radius: 12px;
}

.project-buttons .edit {
  background-color: #3583f7;
}

.project-buttons .delete {
  background-color: #f53333;
}

@media (max-width: 600px) {
  aside {
    width: 380px;
    left: -325px;
    grid-template-columns: 300px auto;
  }

  pre {
    font-size: 1.25rem;
  }

  nav > ul {
    font-size: 1rem;
  }

  aside button {
    font-size: 1rem;
  }

  aside.open {
    animation: open-sidebar 0.35s ease-out forwards;
  }

  .sidebar-button {
    background-image: url("/images/panel-left-open.svg");
    width: 40px;
    height: 40px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.35s ease-out;
  }

  .open .sidebar-button {
    transform: rotate(180deg);
  }

  main, footer {
    margin-left: 55px;
  }

  .index {
    padding-top: 70px;
  }

  .filter {
    top: -315px;
    left: 45px;
    padding-bottom: 10px;
    padding-top: 35px;
  }

  .filter > form {
    grid-template-columns: auto;
    gap: 12px;
  }

  .filter button {
    margin-top: 15px;
    justify-self: stretch;
  }

  #topbar.open {
    animation: open-topbar 0.35s ease-out forwards;
  }

  .topbar-button {
    margin-top: 10px;
    background-image: url("/images/panel-top-open.svg");
    width: 40px;
    height: 40px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.35s ease-out;
    align-self: end;
  }

  .open .topbar-button {
    transform: rotate(180deg);
  }

  .cards > article {
    grid-template-columns: auto;
  }

  .category-text {
    display: none;
  }

  .category > div {
    gap: 7px;
  }

  main.no-filter {
    padding: 30px;
  }

  .form-body {
    grid-template-columns: auto;
  }

  #password, #name {
    min-width: 0;
    width: 100%;
  }

  .tags {
    gap: 10px;
  }

  .tags > div {
    gap: 7px;
  }

}

@keyframes open-sidebar {
  85% {
    transform: translateX(340px);
  }

  to {
    transform: translateX(325px);
  }
}

@keyframes open-topbar {
  85% {
    transform: translateY(315px);
  }

  to {
    transform: translateY(300px);
  }
}
