:root{
    --clr-primary-600: hsl(238, 40%, 52%);
    --clr-primary-500: hsl(358, 79%, 66%);
    --clr-primary-300: hsl(239, 57%, 85%);
    --clr-primary-100: hsl(357, 100%, 86%);
    --clr-neutral-100: hsl(212, 24%, 26%);
    --clr-neutral-200: hsl(211, 10%, 45%);
    --clr-neutral-300: hsl(223, 19%, 93%);
    --clr-neutral-400: hsl(228, 33%, 97%);
    --clr-neutral-500: hsl(0, 100%, 100%);
    --fs-body: 1rem;
    --ff-body: "Rubik", sans-serif;
    --fw-light: 400;
    --fw-bold: 500;
    --fw-bolder: 700;
}

/*CSS Reset*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
* {
  margin: 0;
  padding: 0;
  font: inherit;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  overflow-x: hidden;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture,
svg {
  max-width: 100%;
  display: block;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
    }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/*General Styling*/

body {
  background-color: var(--clr-neutral-300);
  font-size: var(--fs-body);
  color: var(--clr-neutral-200);
  font-family: var(--ff-body);
}

.font-bold{
  font-weight: var(--fw-bold);
}

.font-bolder{
  font-weight: var(--fw-bolder);
}

.text-name{
  color: var(--clr-neutral-100);
}

.text-blue{
  color: var(--clr-primary-600);
}

.text-red{
  color: var(--clr-primary-500);
}
.text-date{
  font-size: 0.7rem;
  min-width: 100%;
}

@media(min-width:50em){
  .text-date{
    font-size: 1rem;
  }
}

.mt-1{
  margin-top: 1rem;
}

.mt-2{
  margin-top: 1.5rem;
}

.mt-3{
  margin-top: 2rem;
}

.mb-1{
  margin-bottom: 1rem;
}

.mb-2{
  margin-bottom: 1.5rem;
}

.mb-3{
  margin-bottom: 2rem;
}

.pt-1{
  padding-top: 1rem;
}

.pt-2{
  padding-top: 1.5rem;
}

.pt-3{
  padding-top: 3rem;
}

.pb-1{
  padding-bottom: 1rem;
}

.pb-2{
  padding-bottom: 1.5rem;
}

.pb-3{
  padding-bottom: 3rem;
}

.fs-2{
  font-size: 1.235rem;
}

.fs-3{
  font-size: 1.55rem;
}

.uppercase{
  text-transform: uppercase;
}
/*project styling*/
.comment{
  background-color: var(--clr-neutral-400);
  padding-inline: 1rem;
  margin-inline: 1.2rem;
  margin-top: 2rem;
  border-radius: 10px;
  overflow: hidden;
  padding-bottom: 1rem;
}

.comment-top{
  display: flex;
  align-items: center;
  padding-inline: 5px;
  gap: 20px;
}

.avatar{
  max-width: 46px;
}

.comment-bottom{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vote{
  background-color: var(--clr-neutral-300);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 0.5rem;
  padding-inline: 1rem;
}

.vote button{
  border: none;
  cursor: pointer;
}

.reply{
  display: flex;
  border: none;
  gap: 1rem;
  cursor: pointer;
  background-color: transparent;
}

.reply_comment{
  margin-left: 1.875rem;
}


.reply {
  background-color: #f9f9f9;
}

.replying-to {
  color: #4f92ff;
  font-weight: bold;
}

.replies-wrapper {
  margin-left: 1.3rem;
  border-left: 2px solid var(--clr-primary-300);
}

.post-comment{
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1rem;
  background-color: var(--clr-neutral-500);
  padding-block: 1.5rem;
  margin-inline: 1.5rem;
  margin-block: 1rem;
  border-radius: 8px;
}

.text-input{
  width: 95%;
  height: 80px;
  padding: 0.5rem;
  padding-inline: 1rem;
  border: 1px solid var(--clr-neutral-200);
  border-radius: 8px;
  resize: none;
}

.send{
  display: flex;
  gap: 8rem;
  align-items: center;
  margin-top: 1rem;
}

.send-btn{
  background-color: var(--clr-primary-600);
  color: var(--clr-neutral-500);
  width: 90px;
  height: 40px;
  border-radius: 8px;
  border: none;
}

.delete-edit{
  display: flex;
  align-items: center;
  gap: 1rem;
}

.delete-edit button{
  border: none;
  cursor: pointer;
}

.you-badge {
  background-color: var(--clr-primary-600);
  color: var(--clr-neutral-500);
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
}

.modal h2 {
  margin-top: 0;
}

.modal-textarea {
  width: 100%;
  height: 100px;
  margin-top: 1rem;
  padding: 0.5rem;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.modal-actions button {
  margin-left: 1rem;
  padding: 0.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.cancel-btn {
  background: var(--clr-neutral-200);
  color: var(--clr-neutral-400);
}

.save-btn {
  background: var(--clr-primary-500);
  color: var(--clr-neutral-400);
}

#replyFormOverlay {
  position: relative;
  width: 100%;
  margin-top: 1rem;
}

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--clr-neutral-500);
  padding: 1rem;
  border-radius: 8px;
  position: relative;
}

.reply-textarea {
  width: 100%;
  height: 80px;
  padding: 0.5rem;
  border: 1px solid var(--clr-neutral-200);
  border-radius: 8px;
  resize: none;
}

.reply-actions {
  display: flex;
  justify-content: space-between;
  padding-inline: 1rem;
}

.close-reply-form {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.close-reply-form img {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  transition: opacity 0.2s;
  margin-top: -15px;
}

.close-reply-form:hover img {
  opacity: 1;
}

@media(min-width:50em){
  .post-comment{
    position: relative;
    padding: 2rem 5rem;
  }

  .send {
    position: static;
  }

  .send img {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    margin: 0;
  }

  .send button{
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }

  .text-input{
    width: calc(100% - 12rem);
    margin: 0 auto;
    padding: 1rem;
  }

  .comment {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas: 
      "vote user actions"
      "vote content content";
    gap: 1rem;
    padding: 1.5rem;
    position: relative;
  }

  .comment-top {
    grid-area: user;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0;
  }

  .comment p.font-bold.pt-2 {
    grid-area: content;
    padding-top: 0.5rem;
    margin: 0;
  }

  .comment-bottom {
    grid-area: actions;
    margin: 0;
    padding: 0;
  }

  .vote {
    grid-area: vote;
    flex-direction: column;
    background-color: var(--clr-neutral-300);
    align-items: center;
    padding: 0.75rem;
    gap: 0.75rem;
    border-radius: 8px;
    height: fit-content;
    position: absolute;
    left: 0;
    margin-top: 2.5rem;
  }

  .vote .score {
    font-weight: var(--fw-bolder);
  }

  .delete-edit, 
  .reply {
    margin-top: 0;
  }

  .avatar {
    max-width: 32px;
  }
}
