/*=============== Task Detail Popup ===============*/
.taskDetailPopupFrame {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--theme-background-popup);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vw, 24px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.taskDetailPopupBox {
  width: min(1180px, 96%);
  max-height: clamp(600px, 94vh, 980px);
  overflow: hidden;
  border-radius: clamp(18px, 2vw, 28px);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  color: white;
}

.taskDetailPopupHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(16px, 2vh, 24px) clamp(18px, 2.5vw, 28px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.taskDetailPopupHeader h3 {
  margin: 0 0 4px;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 700;
}

.taskDetailPopupHeader p {
  margin: 0;
  font-size: clamp(11px, 1vw, 13px);
  color: rgba(255, 255, 255, 0.72);
}

.taskDetailPopupClose {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  width: clamp(36px, 3vw, 42px);
  height: clamp(36px, 3vw, 42px);
  border-radius: 12px;
  font-size: clamp(16px, 1.4vw, 20px);
  cursor: pointer;
  transition: 0.2s ease;
  flex-shrink: 0;
}

.taskDetailPopupClose:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* body */
.taskDetailPopupBody {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  max-height: calc(clamp(600px, 94vh, 980px) - clamp(70px, 8vh, 92px));
  overflow: hidden;
}

/* left */
.taskDetailLeftPanel {
  padding: clamp(18px, 2vw, 28px);
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}

.taskDetailHeroCard {
  padding: clamp(16px, 1.8vw, 24px);
  border-radius: clamp(16px, 1.8vw, 22px);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: clamp(16px, 2vh, 24px);
}

.taskDetailHeroTop {
  display: flex;
  justify-content: flex-start;
  margin-bottom: clamp(10px, 1.2vh, 16px);
}

.taskDetailStatus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
}

.taskDetailTitle {
  margin: 0 0 clamp(10px, 1.2vh, 14px);
  font-size: clamp(18px, 1.8vw, 25px);
  line-height: 1.25;
  font-weight: 800;
}

.taskDetailDescription {
  margin: 0;
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
}

.taskDetailInfoSection {
  margin-top: clamp(18px, 2vh, 26px);
}

.taskDetailInfoSection h4 {
  margin: 0 0 clamp(10px, 1.2vh, 14px);
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 700;
}

.taskDetailInfoGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1vw, 14px);
}

.taskDetailCard {
  padding: clamp(12px, 1.2vw, 16px);
  border-radius: clamp(14px, 1.5vw, 18px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.taskDetailLabel {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(10px, 0.85vw, 12px);
  opacity: 0.72;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.taskDetailCard strong {
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 700;
}

.taskDetailAssigneeList {
  display: grid;
  gap: 10px;
  padding: 0;
  overflow: visible;
  max-height: none;
}

.taskDetailAssigneeItem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.taskDetailAssigneeMeta {
  min-width: 0;
  flex: 1;
}

.taskDetailAssigneeAvatar,
.taskCommentAvatar {
  width: clamp(34px, 3vw, 42px);
  height: clamp(34px, 3vw, 42px);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.taskDetailAssigneeMeta,
.taskCommentMeta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.taskDetailAssigneeName {
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 15px);
}

.taskDetailAssigneeEmail {
  font-size: clamp(11px, 0.9vw, 12px);
  opacity: 0.72;
}

/* right */
.taskDetailRightPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.03);
}

.taskCommentPanelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 2vh, 24px) clamp(16px, 2vw, 24px)
    clamp(12px, 1.5vh, 18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.taskCommentPanelHeader h4 {
  margin: 0;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 700;
}

.taskCommentCount {
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(11px, 0.9vw, 13px);
  font-weight: 700;
}

.taskCommentPanelBody {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  max-height: clamp(300px, 42vh, 460px);
  min-height: clamp(220px, 32vh, 400px);
  padding: clamp(14px, 1.8vh, 20px) clamp(16px, 2vw, 24px);
}

.taskCommentList {
  display: grid;
  gap: clamp(10px, 1.2vh, 14px);
}

.taskCommentItem {
  padding: clamp(14px, 1.5vh, 18px);
  border-radius: clamp(14px, 1.5vw, 18px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.taskCommentTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.taskCommentUser {
  display: flex;
  align-items: center;
  gap: 10px;
}

.taskCommentMeta strong {
  font-size: clamp(12px, 1vw, 14px);
}

.taskCommentMeta span {
  font-size: clamp(11px, 0.85vw, 12px);
  opacity: 0.7;
}

.taskCommentText {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(12px, 1vw, 14px);
  word-break: break-word;
}

.taskCommentDeleteBtn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: clamp(11px, 0.85vw, 12px);
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
  flex-shrink: 0;
}

.memberEmpty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
  font-size: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}

.taskCommentWriteBox {
  padding: clamp(14px, 1.8vh, 18px) clamp(16px, 2vw, 24px)
    clamp(16px, 2vh, 24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
  background: rgba(0, 0, 0, 0.08);
}

.taskCommentTextarea {
  width: 100%;
  min-height: clamp(80px, 12vh, 120px);
  max-height: clamp(100px, 16vh, 180px);
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  padding: 12px 14px;
  outline: none;
  font: inherit;
  line-height: 1.6;
  box-sizing: border-box;
  font-size: clamp(12px, 1vw, 14px);
}

.taskCommentTextarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.taskCommentTextarea:focus {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.taskCommentSubmitBtn {
  width: 100%;
  min-height: clamp(44px, 5vh, 52px);
  align-self: stretch;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.16);
  color: white;
  font-weight: 800;
  font-size: clamp(13px, 1.1vw, 15px);
  transition:
    background 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.2s ease;
}

.taskCommentSubmitBtn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.taskCommentSubmitBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* scroll */
.taskDetailLeftPanel::-webkit-scrollbar,
.taskCommentPanelBody::-webkit-scrollbar {
  width: 6px;
}

.taskDetailLeftPanel::-webkit-scrollbar-thumb,
.taskCommentPanelBody::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

/* ===== attachment row inside comment ===== */
.taskCommentAttachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(10px, 1.2vh, 13px) clamp(10px, 1vw, 14px);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-top: 2px;
}

.taskCommentAttachmentLeft {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.taskCommentAttachmentIcon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.taskCommentAttachmentMeta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.taskCommentAttachmentMeta strong {
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  word-break: break-word;
}

.taskCommentAttachmentMeta span {
  font-size: clamp(11px, 0.85vw, 12px);
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.35;
  word-break: break-word;
}

.taskCommentAttachmentActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.taskCommentIconBtn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.taskCommentIconBtn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.taskCommentIconBtn.danger:hover {
  background: rgba(255, 90, 90, 0.14);
  border-color: rgba(255, 90, 90, 0.28);
}

/* ===== download button ===== */
.taskCommentDownloadBtn {
  flex-shrink: 0;
  min-width: 88px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: clamp(11px, 0.9vw, 12px);
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.taskCommentDownloadBtn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.taskCommentDownloadBtn:active {
  transform: translateY(0);
}

/* ===== toolbar under textarea ===== */
.taskCommentToolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.taskAttachmentBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: clamp(12px, 1vw, 14px);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.taskAttachmentBtn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.taskAttachmentIcon {
  font-size: 14px;
  line-height: 1;
}

.taskAttachmentInputHidden {
  display: none;
}

/* ===== selected file preview ===== */
.taskAttachmentPreviewList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.taskAttachmentPreview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.taskAttachmentPreviewIcon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.taskAttachmentPreviewMeta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.taskAttachmentPreviewMeta strong {
  font-size: clamp(12px, 1vw, 13px);
  font-weight: 700;
  color: #fff;
  word-break: break-word;
  line-height: 1.35;
}

.taskAttachmentPreviewMeta span {
  font-size: clamp(11px, 0.85vw, 12px);
  color: rgba(255, 255, 255, 0.58);
}

.taskAttachmentRemoveBtn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.taskAttachmentRemoveBtn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.taskCommentDeleteBtn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.taskAttachmentPolicyText {
  margin: 6px 2px 8px;
  font-size: clamp(11px, 0.85vw, 12px);
  line-height: 1.4;
  opacity: 0.8;
}

/*============ Tagging Members ==============*/
.taskCommentInputWrap {
  position: relative;
  width: 100%;
  overflow: visible;
  z-index: 5;
}

.taskMentionDropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 14px;
  background: rgba(20, 24, 31, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  z-index: 999;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.taskMentionItem {
  width: 100%;
  border: 0;
  background: transparent;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  box-sizing: border-box;
}

.taskMentionItem:hover,
.taskMentionItem.active {
  background: rgba(255, 255, 255, 0.08);
}

.taskMentionAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.taskMentionMeta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.taskMentionMeta strong {
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskMentionMeta span {
  font-size: clamp(11px, 0.85vw, 12px);
  opacity: 0.68;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commentMention {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 8px;
  color: #7dc4ff;
  background: rgba(125, 196, 255, 0.12);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  border: 1px solid rgba(125, 196, 255, 0.2);
}

.taskDetailPopupBox,
.taskDetailRightPanel,
.taskCommentWriteBox {
  overflow: visible;
}

/* ===== 1280px 이하 - 노트북 ===== */
@media (max-width: 1280px) {
  .taskDetailPopupBox {
    max-height: 94vh;
  }

  .taskDetailPopupBody {
    max-height: calc(94vh - 80px);
  }

  .taskCommentPanelBody {
    max-height: clamp(300px, 42vh, 460px);
    min-height: clamp(220px, 32vh, 400px);
  }
}

/* ===== 960px 이하 - 태블릿 ===== */
@media (max-width: 960px) {
  .taskDetailPopupBox {
    width: 100%;
    max-height: 94vh;
    border-radius: 20px;
  }

  .taskDetailPopupBody {
    grid-template-columns: 1fr;
    max-height: calc(94vh - 80px);
    overflow-y: auto;
  }

  .taskDetailLeftPanel {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: visible;
  }

  .taskDetailInfoGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .taskCommentPanelBody {
    max-height: 320px;
    min-height: 200px;
  }
}

/* ===== 640px 이하 - 모바일 ===== */
@media (max-width: 640px) {
  .taskDetailPopupFrame {
    padding: 0;
    align-items: flex-end;
  }

  .taskDetailPopupBox {
    border-radius: 20px 20px 0 0;
    max-height: 96vh;
  }

  .taskDetailInfoGrid {
    grid-template-columns: 1fr;
  }

  .taskCommentAttachment {
    flex-direction: column;
    align-items: stretch;
  }

  .taskCommentDownloadBtn {
    width: 100%;
  }

  .taskAttachmentBtn {
    width: 100%;
    justify-content: center;
  }

  .taskCommentPanelBody {
    max-height: 240px;
    min-height: 160px;
  }
}
