* {
  box-sizing: border-box;
}

.invert {
  filter: invert(1);
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f8fa;
  margin: 0;
  padding: 0;
}

a {
  color: #1f5d81;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header {
  grid-area: header;
  background-color: #990000;
  color: white;
  padding: 10px 20px;
  text-align: center;
  font-size: 24px;
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header label {
  font-size: 1rem;
}

main {
  display: grid;
  grid-template-areas: "nav input"
                       "nav howls";
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  max-width: 850px;
  margin: 20px auto;
}

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

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

#backToTop {
  position: fixed;
  bottom: 50px;
  right: 20px;
  background-color: #990000;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1;
}

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

nav.container {
  grid-area: nav;
  width: 200px;
  flex-grow: 0;
  padding: 10px;
  max-height: 250px;

  /* Bonus */
  position: sticky;
  top: 68px;
  /* End Bonus */
}

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

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

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

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

.container {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

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

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

#howlInput textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  resize: none;
}

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


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

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

.howl {
  margin-bottom: 10px;
}

.howl:last-child {
  margin-bottom: 0;
}
.howl .user a {
    text-decoration: none;
    color: inherit;
}
.howl .user a:hover {
    text-decoration: underline;
}.howl .user {
  font-weight: bold;
  margin-bottom: 5px;
}

.howl .content {
  margin-bottom: 10px;
}

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


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

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

/********** LOGIN PAGE **********/

.login-main {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 20px;
}

.login-container {
  max-width: 440px;
  width: 100%;
}

.btn-howl {
  background-color: #990000;
  color: white;
  border: none;
  font-weight: bold;
}

.btn-howl:hover {
  background-color: #770000;
  color: white;
}

/********** HEADER **********/

.header-brand {
  color: white;
  text-decoration: none;
  font-size: 24px;
  font-weight: bold;
}

.header-brand:hover {
  text-decoration: none;
  color: white;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-search input {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
}

.header-search button {
  padding: 4px 12px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: white;
}

.header-user a {
  display: flex;
  align-items: center;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/********** FOLLOWS PANEL **********/

nav ul li {
  position: relative;
}

.follows-panel {
  position: absolute;
  left: 0;
  top: 100%;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 15px;
  min-width: 280px;
  z-index: 100;
}

.follows-panel hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 10px 0;
}

.follows-section h6 {
  margin: 0 0 8px;
  color: #990000;
  font-weight: bold;
}

.follows-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.follows-list li {
  padding: 5px 0;
  border: none;
}

.follows-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
  text-decoration: none;
}

.follows-list li a:hover {
  color: #990000;
}

.follows-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/********** PROFILE PAGE **********/

.profile-layout {
  display: grid;
  grid-template-areas: "nav content";
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  max-width: 850px;
  margin: 20px auto;
}

.profile-content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-info h2 {
  margin: 0;
}

.profile-info p {
  margin: 0;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.btn-follow {
  background-color: white;
  color: #333;
  border: 2px solid #333;
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
}

.btn-follow:hover {
  background-color: #333;
  color: white;
}

.btn-unfollow {
  background-color: #333;
  color: white;
  border: 2px solid #333;
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
}

.btn-unfollow:hover {
  background-color: white;
  color: #333;
}

/* Following list */

.following-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
}

.following-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.following-item:last-child {
  border-bottom: none;
}

.following-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.howls-heading {
  font-size: 1.4em;
  margin: 0 0 10px 0;
}

/* Howl card with avatar */

.howl-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.howl-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.howl-user-info {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.howl-username {
  font-size: 0.9em;
}

.howl-date {
  margin-left: auto;
  font-size: 0.85em;
  white-space: nowrap;
}