html, body, *, *::before, *::after {
  font-size: 1rem;
}

body {
  height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

ul, ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

input[type="checkbox"] {
  margin: 0;
}

.custom-container {
  display: flex;
  width: 80%;
  margin: 0.625rem auto;
}

.content-container {
  display: flex;
  width: 100%;
  height: 80vh;
  margin-bottom: 0.625rem;
}

.left-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.625rem;
  width: 60%;
}

.right-container {
  border: 0.125rem solid #00b2d0;
  border-radius: 1.5rem;
  box-shadow: 0 1rem 2.5rem rgba(0, 178, 208, 0.16);
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-left: 1rem;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 0 1.25rem;
  width: 40%;
  background: #ffffff;
  transition: box-shadow 0.3s, border-color 0.3s;
}

.right-container::-webkit-scrollbar {
  width: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.right-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 0.25rem;
}

.right-container::-webkit-scrollbar-track {
  background: transparent;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.right-container {
  --scrollbar-margin: 1rem;
  scrollbar-gutter: stable both-edges;
  /* For future support, but not all browsers support scrollbar margin yet */
}

.top-section {
  /* display: flex; */
  display: none;
  flex: 1;
  border: 0.0625rem solid #eee;
  padding-bottom: 1.25rem;
  justify-content: space-between;
}

/* 하단 TO-DO 영역 */
.bottom-section {
  flex: 1;
}

#todo-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0.625rem;
}

.todo-title {
  background: #4B4B4B;
  border-bottom: 0.3125rem solid #00B2D0;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.todo-title span {
  color: #ffffff;
  font-weight: bold;
}

.todo-title select {
  background-color: #ffffff;
}

.todo-mission-list {
  margin: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  background: #f4f7fa;
  height: 40vh;
  padding: 0.625rem;
}

.todo-mission-list li {
  display: flex;
  align-items: center;
  background: #f4f7fa;
  border-radius: 2rem;
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.1);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s;
}

.todo-mission-list li:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1);
}

.todo-mission-list li.selected {
  border-color: #00B2D0;
  box-shadow: 0px 0px 10px rgba(0, 178, 208, 1);
}

.todo-mission-text,
.todo-performance-text {
  flex: 1;
  cursor: pointer;
  margin-left: 0.75rem;
  white-space: normal;
  word-break: break-word;
}

.todo-mission-text {
  font-size: 1.05rem;
  font-weight: bold;
}

#todo-detail-form {
  height: 100%;
}

.todo-mission-list li input[type="checkbox"],
#todo-detail-form input[type="checkbox"] {
  appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 0.125rem solid #bbb;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;
  /* margin: 0 0.5rem 0 0; */
}

.todo-mission-list li input[type="checkbox"]:checked,
#todo-detail-form input[type="checkbox"]:checked {
  border-color: #4caf50;
  background: #4caf50;
}

.todo-mission-list li input[type="checkbox"]:checked::after,
#todo-detail-form input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.btn-sub {
  background: transparent;
  border: none;
  cursor: pointer;
}

.form-mission-name {
  display: flex;
  flex: 1;
  align-items: center;
}

.edit-mission-input {
  flex: 1;
  padding: 0.5rem;
  border: 0.0625rem solid #ccc;
  border-radius: 0.25rem;
  font-size: 1rem;
  margin-left:8px; width:70%;
}

.todo-performance-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.625rem;
}

.todo-performance-list {
  width: 100%;
  padding-left: 0.625rem;
}

.todo-performance-title {
  font-weight: bold;
  margin-right: 0.625rem;
}

.edit-performance-input {
  flex: 1;
  margin-left: 0.625rem;
}

.todo-performance-results {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.todo-performance-result-item {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.625rem;
  border: 0.125rem solid #DD8BB6;
  border-radius: 0.25rem;
  background: #f9f9fb;
  position: relative;
  transition: box-shadow 0.2s;
}

.todo-performance-result-item textarea,
.todo-performance-result-item input[type="text"] {
  background-color: #ffffff;
}

.todo-mission-actions {
  justify-content: flex-end;
}

.todo-mission-actions button {
  border: 0.125rem solid #FF9800;
  border-radius: 0.25rem;
  background: #ffffff;
  color: #FF9800;  
  padding: 0.375rem 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.todo-mission-actions button:hover {
  background: #FF9800;
  color: #ffffff;
}

.todo-mission-actions button.active {
  background: #FF9800;
  color: #ffffff;
}

.todo-detail-bottom {
  flex-direction: column;
  justify-content: center;
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding: 0.625rem;
}

.todo-detail-actions {
  justify-content: center;
}

.todo-detail-actions button {
  border: 0.125rem solid #00B2D0;
  border-radius: 0.25rem;
  background: #ffffff;
  color: #00B2D0;  
  padding: 0.375rem 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.todo-detail-actions button:hover {
  background: #00B2D0;
  color: #ffffff;
}

/* 첨부파일 스타일 */
.dropzone {
  border: 0.125rem dashed #ccc;
  border-radius: 0.25rem;
  padding: 1.25rem;
  text-align: center;
  background-color: #f9f9f9;
  cursor: pointer;
  width: 100%;
}

.dropzone p {
  margin: 0;
  font-size: 1rem;
  color: #666;
}

ul.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.file-list li.file-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 0.0625rem solid #eee;
}

ul.file-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  overflow: hidden;
  margin-bottom: 0.625rem;
}

ul.file-list li img.thumbnail-preview {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

ul.file-list li a {
  color: #333;
  text-decoration: none;
  word-break: break-word;
  max-width: 100%;
  /* white-space: nowrap; */
  overflow: hidden;
  text-overflow: ellipsis;
}

ul.file-list li .delete-file-btn {
  border: none !important;
  background: none !important;
  color: red !important;
  font-size: 1.125rem !important;
  cursor: pointer !important;
}

.delete-file-btn-text {
  border: none !important;
  background: transparent !important;
  color: #dc3545 !important;
  font-size: 0.875rem !important;
  padding: 0.125rem 0.5rem !important;
  border-radius: 0.25rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.delete-file-btn-text:hover {
  background: transparent !important;
  color: #dc3545 !important;
}

.strikethrough {
  text-decoration: line-through;
  text-decoration-color: #ff0000;
  text-decoration-thickness: 0.125rem;
}

#previewCloseBtn .emoji {
  filter: brightness(0) invert(1);
}

input[type="text"][readonly] {
  background-color: #f0f0f0;
  color: #888;
  cursor: not-allowed;
}

.blink {
  animation: blink-animation 1s steps(2, start) infinite;
}

.fa-eye-slash {
  color: red;
}

.fa-eye {
  color: black;
}

@keyframes blink-animation {
  0%, 49% { 
    border-color: #00B2D0;
    color: #00B2D0;
  }
  50%, 99% { 
    border-color: #ff0000;
    color: #ff0000;
  }
  100% { 
    border-color: #00B2D0;
    color: #00B2D0;
  }
}

/* 공통 form 스타일 - 시작 */
.form-horizontal {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
}

.form-group {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  flex-wrap: nowrap;
}

.form-group-half {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 50%;
  flex-wrap: nowrap;
}

.form-label {
  font-weight: bold;
  min-width: 8.125rem;
}

.form-label-sub {
  font-weight: bold;
  max-width: max-content;
}

.form-input-number {
  max-width: none !important;
  width: 6.25rem !important;
  padding: 0.375rem 0.625rem !important;
  text-align: right;
  border: 0.0625rem solid #ddd;
  border-radius: 0.25rem;
}

.form-textarea {
  min-height: auto;
}

.form-cycle {
  display: flex;
  justify-content: flex-end;
  width: max-content;
  gap: 0.3125rem;
}

.form-control {
  max-width: max-content;
}

.input-container {
  display: flex;
  align-items: center;
  flex: 0.7;
  flex-basis: min-content;
  position: relative;
}

.input-container input[type="text"] {
  width: 100%;
  padding-right: 1.875rem; /* 30px -> 1.875rem */
  border-radius: 0.25rem;
  background: #ffffff;
}

.input-container i {
  position: absolute;
  right: 0.625rem; /* 10px -> 0.625rem */
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
}

.input-container i:hover {
  color: #333;
}

.datepicker-icon {
  font-size: 16px;
  cursor: pointer;
}
/* 공통 form 스타일 - 끝 */

/* 반응형 form 스타일 - 시작 */
@media screen and (max-width: 1600px) {
  .todo-performance-result-item .form-group:nth-of-type(2) {
    flex-direction: column;
  }

  .todo-performance-result-item .form-group-half {
    width: 100%;
  }

  .todo-performance-result-item .form-label {
    min-width: 6.25rem;
  }
}

@media screen and (max-width: 1000px) {
  .custom-container {
    flex-direction: column;
    width: 90%;
  }

  .content-container {
    flex-direction: column;
    height: auto;
  }

  .left-container {
    width: 100%;
    margin-bottom: 1rem;
  }

  .right-container {
    width: 100%;
    margin-left: 0;
    padding: 1rem;
  }

  /* .top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 1rem;
  } */

  .todo-mission-list {
    height: auto;
  }

  .todo-title .form-label {
    max-width: max-content;
    min-width: max-content;
  }

  .todo-title select {
    padding: 0 0.1875rem;
  }
}
/* 반응형 form 스타일 - 끝 */

#mps-planning-btn {
  border: 0.125rem solid #009090 !important;
  border-radius: 0.25rem;
  background-color: white !important;
  color: #009090 !important;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

#mps-planning-btn:hover {
  background-color: #009090 !important;
  color: white !important;
}