html {
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

.invert {
  filter: invert(1);
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f8fa;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/*** HEADER STYLING ***/

.headerLinks {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 1.5em;
  flex-wrap: wrap;
}

.headerLink,
.headerLink:visited {
  color: white;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header {
  z-index: 10000;
  grid-area: header;
  background-color: #990000;
  color: white;
  padding: 2em 2.5em;
  text-align: center;
  font-size: 1rem;
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .headerLink {
    font-weight: bold;
    font-size: 2em;
    letter-spacing: 0.02em;
  }

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

  a:hover {
    text-decoration: none;
  }

  /* PROFILE SECTION */
  #profileSection {
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
  }

  /* show on hover (instead of click, BS default) */
  #profileDropdown:hover .dropdown-menu {
    display: block;
    /* right align it instead of bootstrap default */
    right: 0;
    left: auto;
  }
}

.profileImage {
  aspect-ratio: 1 / 1;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid white;
}

#logoutButton {
  margin-top: 0.5em;
  border-top: 1px solid black;
  color: red;
}

@media screen and (max-width: 500px) {
  header {
    padding: 1.25em;
    gap: 0.5em;
    align-items: flex-end;

    .username {
      display: none;
    }
  }

  .headerLinks {
    gap: 1em;
  }

  #profileDropdown {
    align-self: flex-end;
  }
}

/* GENERAL STYLING */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  width: 100%;
  max-width: 850px;
  margin: 2em auto;
  padding: 0 1em;
  flex: 1;
}

section {
  width: 100%;
  margin-top: 1rem;
}

li {
  list-style: none;
}

@media screen and (min-width: 700px) {
  main {
    width: 80%;
  }
}

.redButton {
  background-color: #990000;
  color: white;
  padding: 0.5em 1em;
  border: none;
  border-radius: 0.3em;
  cursor: pointer;
  transition: ease-in-out 0.2s;
}

.redButton:hover {
  transform: scale(1.01);
  background-color: rgb(170, 5, 5);
}

.container {
  background: #fff;
  padding: 1.25em;
  border-radius: 0.5em;
  box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.1);
}

/* Howls section styling */
#howlList {
  margin-top: 1.5rem;
}

/********** BACK TO TOP **********/

#top {
  position: absolute;
  top: 0;
  visibility: hidden;
}

#backToTop {
  position: fixed;
  bottom: 3em;
  right: 1.25em;
  z-index: 1;
  text-decoration: none;
}

/********** NAVIGATION **********/

nav.container {
  grid-area: nav;
  width: 12.5em;
  flex-grow: 0;
  padding: 0.5em;
  max-height: 15em;

  /* Bonus */
  position: sticky;
  top: 4em;
  /* End Bonus */
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

nav ul li {
  padding: 0.5em;
  border-bottom: 1px solid #666;
  cursor: pointer;
}

nav ul li:hover {
  background-color: #f5f8fa;
}

nav ul li:last-of-type {
  border-bottom: none;
}

/********** INPUT **********/

#howlInput {
  width: 100%;
  grid-area: input;
  display: flex;
  flex-direction: column;
}

#howlInput textarea {
  width: 100%;
  padding: 0.625em;
  border: 1px solid #ddd;
  border-radius: 0.3em;
  resize: vertical;
  min-height: 3em;
  max-height: 10em;
}

#howlInput button {
  align-self: flex-end;
  background-color: #f5f8fa;
  border: 2px solid #990000;
  color: #990000;
  padding: 0.625em 1.25em;
  border-radius: 0.625em;
  cursor: pointer;
  margin-top: 0.625em;
  font-weight: bold;
}

/********** HOWLS **********/

#howlList {
  grid-area: howls;
  width: 100%;
}

.howl {
  margin-bottom: 0.5em;
}

.howl:last-child {
  margin-bottom: 0;
}

.howl .user {
  font-weight: bold;
  margin-bottom: 0.3em;
}

.howl .content {
  margin-bottom: 0.5em;
}

.howl .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5em;
  font-size: 0.85em;
}

/********** FOOTER **********/

footer {
  border-top: 2px solid #990000;
  background-color: white;
  padding: 0.5em 1.25em;
  text-align: center;
  position: sticky;
  bottom: 0;
}
