@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: hsl(0, 0%, 16%);
  --on-primary-color: hsl(0, 0%, 100%);
  --secondary-color: hsl(0, 0%, 98%);
  --on-secondary-color: hsl(0, 0%, 12%);

  --col-border: hsl(0, 0%, 50%);
  --col-border2: hsl(0, 0%, 100%);
  --bg-modal-backdrop: hsla(0, 0%, 50%, 0.9);
  --col-error: hsl(0, 100%, 50%);
  --col-btn-box-shadow: hsl(0, 0%, 0%);

  --btn-hover-color: hsl(308, 80%, 45%);

  --font-size-text-modal: 1.3rem;
  --font-size-input-modal: 1.1rem;
  --font-size-text-card: 1.1rem; /* no input elements */
}

body,
.card,
.modal,
.cardSelect,
button,
input {
  font-family: 'Montserrat', sans-serif;
} 

html,
body,
.container {
  min-height: 100vh;
}

a {
  color: var(--on-primary-color, hsl(0, 0%, 100%));
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.cardSelect:hover {
  cursor: pointer;
}

.container {
  display: grid;
  justify-items: center;
  grid-template-columns: 1fr;
  color: var(--on-primary-color, hsl(0, 0%, 100%));
  background-color: var(--primary-color, hsl(220, 4%, 17%));
}

header,
main,
footer {
  width: 100%;
}

header {
  display: grid;
  justify-items: center;
  align-items: center;
  position: sticky;
  top: 0;
  height: 100px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--col-border2, hsl(0, 0%, 100%));
  background-color: var(--primary-color, hsl(220, 4%, 17%));
  z-index: 10;
}

.btn {
  border-radius: 16px;
}

.btn:hover {
  cursor: pointer;
  color: var(--btn-hover-color);
}

.btnAddBook {
  min-width: 100px;
  min-height: 30px;
  background-color: hsl(0, 0%, 81%);
  font-weight: bold;
  border: none; 
}

.cardContainer {
  display: grid;
  justify-items: center;
  row-gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.card {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  grid-template-columns: 30px 1fr;
  align-items: center;
  height: 250px;
  width: 90%;
  max-width: 450px;
  padding: 1rem;
  word-break: break-word;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--col-border, hsl(0, 0%, 50%));
  color: var(--on-secondary-color, hsl(0, 0%, 0%));
  background-color: var(--secondary-color, hsl(0, 0%, 88%));
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px hsla(0, 0%, 100%, 0.2);
}

.divSeparator {
  grid-column: 1 / 2;
  grid-row: 1 / 5;
  
  border: 1px solid var(--col-border);
  height: 100%;
  width: 0%;
}


.cardDivTitle,
.cardDivAuthor,
.cardDivPages,
.cardDivRead {
  grid-column: 2 /3;

  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  height: 100%;
  margin-bottom: 10px;
}

.cardDivRead {
  border: none;
}

.pTitle,
.pAuthor,
.pPages,
.labelSelect {
  font-weight: 700;
}

.cardSelect {
  min-width: 100px;
  width: 50%;
  border-radius: 4px;
  padding-top: 1px;
  padding-bottom: 1px;
}

.btnRemove {
  grid-column: 2 / 3;
  min-width: 100px;
  min-height: 30px;
  justify-self: center;
  align-self: center;
  font-weight: bold;
  border-radius: 16px;
  border: 1px solid var(--col-border, hsl(0, 0%, 50%));
  background-color: hsl(0, 0%, 81%);
}

footer {
  display: grid;
  justify-items: center;
  align-items: center;
  row-gap: 5px;
  padding-top: 0.5rem;

  padding-bottom: 0.5rem;
  border-top: 1px solid var(--col-border2, hsl(0, 0%, 100%));
}

footer ul {
  display: grid;
  justify-items: center;
  row-gap: 2px;
  list-style-type: none;
}

footer i {
  margin-right: 2px;
}

.fa.fa-twitter {
  font-family: sans-serif;
}

.fa.fa-twitter::before {
  content: "𝕏";
}

.modal {
  width: 400px;
  height: 310px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  border-radius: 4px;
  padding: 1rem;
  border: none;
  color: var(--on-primary-color, hsl(0, 0%, 100%));
  background-color: var(--primary-color, hsl(220, 4%, 17%));
}

.modal::backdrop {
  background-color: var(--bg-modal-backdrop, hsla(0, 0%, 50%, 0.9));
}

.modalContent {
  display: grid;
  grid-template-rows: 1fr 9fr;
  font-size: var(--font-size-text-modal);
  height: 100%;
  width: 100%;
}

.modalContentHeader {
  display: grid;
  grid-template-columns: 2fr 1fr;
  width: 100%;
}

.modalContentHeader p {
  font-weight: bold;
  font-size: 1.2rem;
}

.btnCloseModal {
  justify-self: end;
  width: 25px;
  height: 25px;
  font-weight: bold;
  font-size: 1rem;
  border: none;
}

.modalContent form {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
}

.modalDivTitle,
.modalDivAuthor,
.modalDivPages,
.modalDivRead {
  display: grid;
  grid-template-columns: 1fr 3fr;
  grid-template-rows: 1fr 0.5fr;
  align-items: end;
  column-gap: 5px;
}

#title,
#author,
#pages,
#selectBookProgress {
  font-size: var(--font-size-input-modal);
}

#title,
#author,
#pages {
  padding: 1px 3px;
}

#pages {
  width: 60%;
  padding-top: 1px;
  padding-bottom: 1px;
}

.selectBookProgress {
  width: 60%;
}

.error-message {
  grid-column: 2 / 3;

  align-self: start;
  margin-top: 1px;
  font-size: 0.8rem;
  color: var(--col-error, hsl(0, 100%, 40%));
}

.modalDivBtns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  align-items: end;
}

.btnSubmitModal,
.btnCancelModal {
  height: 70%;
  width: 80%;
  font-weight: bold;
  font-size: var(--font-size-input-modal);
  border: none;
}

.btnSubmitModal {
  justify-self: start;
}

.btnCancelModal {
  justify-self: end;
}

@media (min-width: 768px) {
  header {
    justify-items: start;
    padding-left: 2%;
  }

  .cardContainer {
    grid-template-columns: 1fr 1fr;
  }

  footer ul {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .cardContainer {
    grid-template-columns: repeat(3, 1fr);
  }

  footer {
    grid-template-columns: 0.5fr 2fr 1fr;
  }

  footer ul {
    justify-self: start;
  }
}
