@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');
:root {
  --moderate-blue: hsl(238, 40%, 52%);
  --soft-red: hsl(358, 79%, 66%);
  --light-gray: hsl(223, 19%, 93%);
  --gray-blue: hsl(211, 10%, 45%);
  --dark-blue: hsl(212, 24%, 26%);
  --very-light: hsl(0, 0%, 98%);
  --border-radius: 10px;
  --font-family: "Rubik", sans-serif;
}

body {
  background: var(--very-light);
  font-family: "Rubik", sans-serif;
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 750px;
  margin: auto;
}

.comment {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 20px;
}
.comment-content{
  display: flex;
  flex-direction: column;
}

.reply-thread {
  border-left: 2px solid var(--light-gray);
  margin-left: 40px;
  padding-left: 40px;
}

.vote-box {
  background: var(--light-gray);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 80px;
  width: 25px;
  align-items: center;
  gap: 10px;
}

.vote-box button {
  border: none;
  background: transparent;
  color: var(--moderate-blue);
  font-size: 18px;
  cursor: pointer;
}

.vote-box span {
  font-weight: bold;
  color: var(--moderate-blue);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-header img {
  width: 32px;
  border-radius: 50%;
}

.time {
  color: gray;
  font-size: 14px;
}

.reply-btn,
.edit-btn,
.delete-btn {
  margin-left: 20px;
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

p{
  font-family: var(--font-family);
}
.reply-btn,
.edit-btn { color: var(--moderate-blue); }

.delete-btn { color: var(--soft-red); }

.you-label {
  background: var(--moderate-blue);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.add-comment {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.add-comment textarea {
  flex: 1;
  height: 70px;
  width: 5rem;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--light-gray);
  resize: vertical;
}

/* SEND button */
.send-btn {
  background: var(--moderate-blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

/* ------------------ DELETE MODAL ------------------ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-box {
  background: white;
  width: 320px;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-box h3 {
  margin: 0 0 10px;
  color: var(--dark-blue);
}

.modal-box p {
  color: var(--gray-blue);
  margin-bottom: 20px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
}

.reply-btn img,
.edit-btn img,
.delete-btn img {
  width: 14px;
}

.reply-btn,
.edit-btn,
.delete-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: bold;
}


.cancel-btn {
  flex: 1;
  background: var(--gray-blue);
  color: white;
  padding: 10px 0;
  border-radius: 8px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

.delete-btn-modal {
  flex: 1;
  background: var(--soft-red);
  color: white;
  padding: 10px 0;
  border-radius: 8px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

@media (max-width: 450px) {

  /* Container */
  .container { 
    padding: 0 10px;
  }

 
  .comment { 
    flex-direction: column; 
    gap: 15px; 
    padding: 15px; 
  }

  .comment-content {
    width: 100%;
  }

  /* User avatar small */
  .comment-header img { 
    width: 28px;
  }

  /* Text & time smaller */
  .comment-header h4 { font-size: 14px; }
  .time { font-size: 12px; }

  /* Comment text */
  .comment-content p { 
    font-size: 14px; 
    line-height: 1.4; 
  }

  /* Reply thread indent */
  .reply-thread { 
    margin-left: 20px; 
    padding-left: 20px; 
  }

  /* Add comment section */
  .add-comment { 
    flex-direction: column; 
    padding: 15px; 
    gap: 10px; 
  }

  .add-comment textarea { 
    width: 100%; 
    height: 80px; 
  }

  .send-btn { 
    width: 100%; 
    padding: 12px 0; 
  }

  
  .comment-header {
    flex-wrap: wrap;            
    gap: 8px;
  }

  
  .comment-header .reply-btn,
  .comment-header .edit-btn,
  .comment-header .delete-btn {
    margin-left: auto;           
    order: 10;                   
    font-size: 13px;
    padding: 4px 0;
  }

  .comment-header button img {
    width: 10px !important;
  }


  .comment .vote-box { 
    order: 2;
    flex-direction: row;
    justify-content: flex-start;
    width: 80px;
    height: 35px;
    padding: 8px;
    gap: 10px;
  }

  .vote-box button { 
    font-size: 18px; 
  }

  .vote-box span { 
    font-size: 16px; 
  }

  /* Reply box fix */
  .reply-box { 
    flex-direction: column !important; 
  }

  /* Modal mobile */
  .modal-box { 
    width: 90%; 
    padding: 20px; 
  }
}
