/* css/main-view.css */

/* Main View 최상위 래퍼 */
.mv-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%; /* #view-container 내부에서 꽉 차도록 */
  width: 100%; /* 너비도 꽉 채움 */
  overflow: hidden; /* 내부에서 스크롤 관리 */
}

.mv-yearly-goal-container {
  position: relative;
  margin: 0 15px;
}

#yearlyGoalInput {
  /* width: 100%; */
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9em;
  background-color: #f8f9fa;
  transition: border-color 0.2s, box-shadow 0.2s;
  transition: width 0.2s ease-out;
}

#yearlyGoalInput:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
  background-color: #fff;
}

#yearlyGoalSizer {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden; /* 보이지 않게 처리 */
  height: 0; /* 높이도 0으로 */
  overflow: hidden; /* 넘치는 내용 숨김 */
  white-space: pre; /* 공백 문자 유지 */

  /* Input과 똑같은 폰트, 패딩 값을 주어 정확한 너비를 계산하게 함 */
  font-size: 0.9em;
  padding: 6px 10px;
  border: 1px solid transparent;
}

/* Toolbar */
.mv-toolbar-container {
  /* 기존 .toolbar-container */
  display: flex; /* 자식인 .mv-main-controls가 꽉 차도록 */
  padding: 8px 15px;
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.mv-toolbar-section {
  /* 기존 .toolbar-section */
  display: flex;
  align-items: center;
  gap: 8px;
}

.mv-toolbar-section.mv-main-controls {
  /* 기존 .toolbar-section.main-controls */
  display: flex; /* 자식 요소들을 가로로 배치 */
  flex-wrap: wrap; /* 공간이 부족하면 줄바꿈 허용 */
  align-items: center; /* 세로 중앙 정렬 */
  gap: 8px; /* 요소들 사이의 간격 */
  width: 100%; /* 부모 너비를 꽉 채움 */
}

/* .mv-main-controls 클래스는 HTML 템플릿에서 mv-toolbar-section mv-main-controls 와 같이 사용 */
.mv-main-controls #currentYearDisplay {
  /* ID는 템플릿과 일치 */
  font-weight: bold;
  font-size: 1.1em;
  padding: 0 10px;
}
/* .mv-main-controls #weekJumpInput { ... } */ /* 현재 HTML 주석 처리됨 */
.mv-main-controls #addLabelBtn {
  margin-left: 8px;
  font-weight: bold;
  background-color: #28a745;
  color: white;
  border-color: #28a745;
}
.mv-main-controls #addLabelBtn:hover {
  background-color: #218838;
}

/* .mv-label-display-area { ... } */ /* 현재 HTML 구조에 없음, 필요시 추가 */

.mv-toolbar-section.mv-file-operations {
  /* 기존 .file-operations */
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.mv-file-operations #saveDataBtn,
.mv-file-operations #loadDataBtn {
  padding: 6px 10px;
  font-size: 1.2em;
  line-height: 1;
  min-width: 40px;
  background-color: #e9ecef;
  border-color: #ced4da;
}
.mv-file-operations #saveDataBtn:hover,
.mv-file-operations #loadDataBtn:hover {
  background-color: #dee2e6;
}

/* #addLabelBtn (ID 선택자는 이미 위에서 구체적으로 스타일링됨) */
#labelsContainer {
  /* .mv-main-controls 내부의 #labelsContainer */
  display: contents;
}

/* Main Content Grid */
.mv-main-content-grid {
  /* 기존 .main-content-grid */
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 65% 35%;
  grid-template-areas:
    "yearly backlog"
    "weekly backlog";
  gap: 10px;
  padding: 10px;
  overflow: hidden; /* 내부 grid-area에서 스크롤하도록 */
  background-color: #f4f7f6; /* .mv-wrapper 배경색과 일치 또는 구분 */
}

.mv-grid-area {
  /* 기존 .grid-area */
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px; /* 각 영역의 내부 패딩 */
  overflow: auto; /* 내용이 넘칠 경우 해당 영역 스크롤 */
  display: flex; /* 자식 요소가 flex-direction: column을 사용할 수 있도록 */
  flex-direction: column; /* 기본적으로 자식들을 수직으로 쌓음 */
}

.mv-yearly-view {
  grid-area: yearly;
}

/* Weekly Calendar Styles */
.mv-weekly-view {
  /* ID: #weekly-calendar-area */
  grid-area: weekly;
  padding: 0; /* 내부에서 패딩 제어 */
  /* display: flex; flex-direction: column; -> .mv-grid-area 에서 상속 */
  overflow: hidden; /* 내부 요소가 스크롤하도록 */
  display: flex;
  flex-direction: column;
}
.mv-weekly-header {
  flex-shrink: 0; /* 헤더 높이는 고정 */
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  border-bottom: 1px solid #ddd;
  background-color: #f9f9f9;
}

.mv-weekly-day-header {
  padding: 8px 5px;
  font-size: 0.8em;
  font-weight: bold;
  border-right: 1px solid #eee;
}
.mv-weekly-day-header:last-child {
  border-right: none;
}

.mv-weekly-grid {
  flex-grow: 1; /* 헤더를 제외한 나머지 모든 공간 차지 */
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: 1fr; /* 모든 셀이 같은 높이를 갖도록 */
  min-height: 0; /* flex 자식의 높이 계산을 위해 중요 */
}

.mv-weekly-day-cell {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eee;
  border-top: 1px solid #eee;
  position: relative;
  overflow: hidden; /* 자식인 .mv-weekly-cell-content가 넘치지 않도록 */
}

.mv-weekly-day-cell:last-child {
  border-right: none;
}

.mv-weekly-day-cell.mv-today {
  background-color: #fff3cd;
}

/* 그리드 첫번째 줄의 셀들은 상단 테두리가 필요 없을 수 있습니다. */
.mv-weekly-grid .mv-weekly-day-cell:nth-child(-n + 7) {
  /* 첫번째 줄 (7개) */
  /* border-top: none;  만약 grid 자체에 테두리가 있다면 */
}

.mv-weekly-cell-header {
  padding: 5px;
  flex-shrink: 0; /* 헤더 높이는 고정 */
}
/* .mv-weekly-cell-day-info { ... } */

.mv-add-todo-in-weekly {
  background: none;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  line-height: 18px;
  padding: 0;
  font-size: 1em;
  color: #555;
  float: right; /* 오른쪽으로 보내기 */
  cursor: pointer;
}
.mv-add-todo-in-weekly:hover {
  background-color: #e9ecef;
}

.mv-weekly-cell-content {
  flex-grow: 1; /* 남은 공간을 모두 차지 */
  overflow-y: auto; /* 내용이 넘치면 세로 스크롤 생성 */
  min-height: 0; /* flex 자식의 스크롤을 위해 필수! */
  padding: 0 5px 5px 5px; /* 내부 컨텐츠 여백 */

  /* 스크롤바 숨기기 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE, Edge */
}

.mv-weekly-cell-content::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.mv-weekly-todo-item {
  font-size: 0.8em; /* 약간 줄임 */
  padding: 3px 5px;
  margin-bottom: 3px;
  border-radius: 3px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  word-break: break-all; /* 긴 내용 줄바꿈 */
}
.mv-weekly-todo-item:hover .mv-todo-actions {
  visibility: visible;
}
.mv-weekly-todo-item.mv-dragging {
  opacity: 0.5;
  border: 1px dashed #333;
}
.mv-weekly-todo-item .mv-todo-edit-input {
  width: calc(100% - 50px); /* 버튼 공간 고려 */
  font-size: 1em; /* 부모와 동일하게 */
}

.mv-weekly-day-cell.mv-drag-over .mv-weekly-cell-content {
  background-color: #e9f5ff;
  outline: 2px dashed #007bff;
  outline-offset: -2px;
}

/* Backlog Styles */
.mv-backlog-view {
  /* ID: #backlog-panel-area */
  grid-area: backlog;
  padding: 0; /* 내부에서 패딩 제어 */
  /* display: flex; flex-direction: column; -> .mv-grid-area 에서 상속 */
  min-width: 280px; /* 최소 너비 조정 */
  max-width: 400px; /* 최대 너비 조정 */
}

.mv-backlog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.mv-backlog-header h3 {
  margin: 0;
  font-size: 1.1em;
}
.mv-backlog-header #showAddTodoFormBtn {
  font-size: 1.2em;
  font-weight: bold;
  padding: 2px 8px;
}

.mv-add-todo-form {
  /* ID: #addTodoFormContainer */
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
  display: none; /* JS로 flex 변경 */
  flex-direction: column;
  gap: 8px;
}
.mv-add-todo-form #newTodoTextInput {
  width: calc(100% - 12px);
}
.mv-add-todo-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mv-add-todo-controls label {
  font-size: 0.8em;
}
.mv-add-todo-controls #newTodoPriorityInput {
  width: 40px;
}

.mv-backlog-list {
  /* ID: #backlogListContainer */
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px 15px;
}

.mv-backlog-todo-item {
  display: flex;
  align-items: center;
  padding: 8px 10px; /* 패딩 약간 줄임 */
  margin-bottom: 6px;
  border-radius: 4px;
  background-color: #fff;
  border: 1px solid #e9ecef;
  border-left-width: 5px;
  cursor: grab;
  transition: box-shadow 0.2s;
}
.mv-backlog-todo-item:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.mv-backlog-todo-item.mv-dragging {
  opacity: 0.6;
}

.mv-todo-text-content {
  flex-grow: 1;
  font-size: 0.9em;
  padding: 0 8px;
}
.mv-todo-text-content input[type="text"] {
  width: 100%;
  font: inherit;
  border: 1px solid #007bff;
  outline: none;
}
.mv-todo-priority {
  margin-right: 8px;
}
.mv-todo-priority input {
  width: 40px;
}
.mv-todo-actions {
  display: flex;
  gap: 5px;
  visibility: hidden;
}
.mv-backlog-todo-item:hover .mv-todo-actions {
  visibility: visible;
}
.mv-todo-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  padding: 2px;
}
.mv-todo-actions .delete-todo-btn:hover {
  color: #dc3545;
}
.mv-todo-actions .edit-todo-btn:hover {
  color: #007bff;
}

/* Modal Styling (Add Label Modal) */
.mv-modal {
  /* ID: #addLabelModal */
  position: fixed; /* 앱 전체 기준 fixed (spa-global.css에서 #app-root 기준으로 변경 가능) */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none; /* JS로 flex 변경 */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* 아이젠하워 매트릭스 모달은 왼쪽 정렬 */
#eisenhowerMatrixModal {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0; /* 패딩 제거 */
  background-color: rgba(0, 0, 0, 0.3); /* 배경 투명도 조정 */
}
.mv-modal-content {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 320px;
}

/* 아이젠하워 매트릭스 모달 컨텐츠는 전체 크기 사용 */
.mv-eisenhower-modal .mv-modal-content {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.mv-modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.2em;
}
.mv-color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.mv-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Eisenhower Matrix Modal Styling */
.mv-eisenhower-modal {
  width: calc(100vw - 420px - 20px); /* 전체 화면 - backlog 영역 - gap */
  max-width: calc(100vw - 420px - 20px);
  height: calc(100vh - 120px); /* 상단 툴바 영역 제외 */
  max-height: calc(100vh - 120px);
  padding: 0; /* 패딩 제거하여 정확한 크기 맞춤 */
  margin: 0; /* 마진 제거 */
  position: absolute;
  top: 60px; /* 툴바 높이만큼 아래로 */
  left: 10px; /* gap만큼 왼쪽에서 */
  overflow: hidden; /* 모달 밖으로 벗어나는 내용 숨김 */
  box-sizing: border-box; /* 패딩과 보더를 크기에 포함 */
}

.mv-eisenhower-modal .mv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  background-color: white;
  border-radius: 0;
  height: 60px; /* 고정 높이 설정 */
  box-sizing: border-box;
  flex-shrink: 0; /* 높이 고정 */
}

.mv-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.mv-close-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.mv-eisenhower-container {
  position: relative;
  width: calc(100% - 40px); /* 좌우 마진 고려 */
  height: calc(100% - 80px); /* 헤더 높이(60px) + 상하 패딩(20px) 고려 */
  border: 2px solid #333;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  margin: 10px 20px 10px 20px; /* 상하 10px, 좌우 20px 패딩 */
  flex-grow: 1; /* 남은 공간 모두 사용 */
  box-sizing: border-box;
}

.mv-eisenhower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
  position: relative;
}

.mv-eisenhower-quadrant {
  border: 1px solid #ccc;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: background-color 0.2s;
}

/* 사분면 호버 시 배경색 변경 제거 */

.mv-eisenhower-quadrant.mv-drag-over {
  background-color: #e3f2fd;
  border: 2px dashed #2196f3;
}

.mv-quadrant-label {
  padding: 10px;
  font-weight: bold;
  font-size: 0.9em;
  text-align: center;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
  line-height: 1.2;
}

.mv-quadrant-content {
  flex-grow: 1;
  padding: 10px;
  overflow-y: auto;
  min-height: 0;
}

.mv-eisenhower-axes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.mv-axis {
  position: absolute;
  background-color: #333;
}

.mv-y-axis {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

.mv-x-axis {
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
}

.mv-axis-label {
  position: absolute;
  background-color: white;
  padding: 2px 6px;
  font-size: 0.8em;
  font-weight: bold;
  color: #333;
  border-radius: 3px;
  border: 1px solid #333;
}

.mv-y-axis .mv-axis-label {
  top: 10px;
  left: -30px;
  transform: rotate(-90deg);
  transform-origin: center;
}

.mv-x-axis .mv-axis-label {
  bottom: -25px;
  right: 10px;
}

/* Quadrant-specific colors */
.mv-quadrant-1 {
  background-color: #ffebee; /* Light red */
}

.mv-quadrant-2 {
  background-color: #e8f5e8; /* Light green */
}

.mv-quadrant-3 {
  background-color: #f3e5f5; /* Light purple */
}

.mv-quadrant-4 {
  background-color: #fff3e0; /* Light orange */
}

/* Todo items in Eisenhower matrix */
.mv-eisenhower-todo-item {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.2s;
  font-size: 0.9em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
}

.mv-eisenhower-todo-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.mv-eisenhower-todo-item.mv-dragging {
  opacity: 0.6;
  transform: rotate(5deg);
}

.mv-eisenhower-todo-item .mv-todo-text {
  margin-bottom: 4px;
  font-weight: 500;
}

.mv-eisenhower-todo-item .mv-todo-priority {
  font-size: 0.8em;
  color: #666;
  background-color: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

/* X 버튼 스타일 */
.mv-eisenhower-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background-color: #ff4444;
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
}

/* 업데이트 버튼 스타일 */
.mv-eisenhower-update-btn {
  position: absolute;
  top: 4px;
  right: 28px;
  width: 20px;
  height: 20px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
}

.mv-eisenhower-delete-btn:hover {
  background-color: #cc0000;
  transform: scale(1.1);
}

.mv-eisenhower-update-btn:hover {
  background-color: #0056b3;
  transform: scale(1.1);
}

.mv-eisenhower-todo-item:hover .mv-eisenhower-delete-btn,
.mv-eisenhower-todo-item:hover .mv-eisenhower-update-btn {
  opacity: 1;
  visibility: visible;
}

/* + 버튼 스타일 (사분면 하단) */
.mv-eisenhower-add-btn {
  width: 100%;
  height: 40px;
  border: 2px dashed #ccc;
  background-color: transparent;
  color: #999;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.mv-eisenhower-add-btn:hover {
  border-color: #007bff;
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

.mv-quadrant-content:hover .mv-eisenhower-add-btn {
  opacity: 1;
  visibility: visible;
}

/* Yearly Calendar Specific Styles */
.mv-yearly-view {
  /* ID: #yearly-calendar-area 에 이미 적용됨 */
  /* display: flex; flex-direction: column; -> .mv-grid-area 에서 상속 */
  overflow: hidden; /* 내부 그리드가 스크롤되도록 */
}

.mv-calendar-header-days-yearly {
  /* ID: #calendarHeaderDaysYearly */
  display: grid;
  grid-template-columns: 60px repeat(31, minmax(25px, 1fr));
  font-size: 0.7em;
  text-align: center;
  padding: 5px 0;
  font-weight: bold;
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
  max-height: 40px; /* 높이 조정 */
}
.mv-calendar-header-days-yearly .mv-day-header-cell-yearly {
  padding: 2px;
  border-right: 1px solid #eee;
}
.mv-calendar-header-days-yearly .mv-day-header-cell-yearly:last-child {
  border-right: none;
}
.mv-calendar-header-days-yearly .mv-month-column-placeholder {
  border-right: 1px solid #ddd;
}

.mv-calendar-grid-yearly {
  /* ID: #calendarGridYearly */
  flex-grow: 1;
  display: grid;
  grid-template-rows: repeat(12, 1fr); /* 12달, 각 행이 같은 공간 차지 */
  /* height: 100%; 제거 */
  overflow-y: auto; /* 그리드 자체가 세로 스크롤 */
  overflow-x: hidden; /* 가로 스크롤은 방지 */
}

.mv-month-row-yearly {
  display: grid;
  grid-template-columns: 60px repeat(31, minmax(25px, 1fr));
  align-items: stretch; /* 내부 .mv-day-cell-yearly가 높이를 꽉 채우도록 */
  border-bottom: 1px solid #eee;
  min-height: 0; /* flex/grid 자식의 높이 계산을 위해 중요 */
}
.mv-month-row-yearly:last-child {
  border-bottom: none;
}

.mv-month-header-yearly {
  font-size: 0.8em;
  font-weight: bold;
  padding: 5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #ddd;
  background-color: #f9f9f9;
}

.mv-day-cell-yearly {
  position: relative;
  font-size: 0.7em;
  border-right: 1px solid #f0f0f0;
  text-align: center;
  min-height: 30px;
  display: flex; /* 내부 wrapper 정렬 위해 */
  align-items: stretch; /* wrapper가 높이 100% 차지하도록 */
  justify-content: stretch; /* wrapper가 너비 100% 차지하도록 */
  cursor: default;
  overflow: hidden; /* wrapper가 스크롤하도록 */
}
.mv-day-cell-yearly:last-child {
  border-right: none;
}
.mv-day-cell-yearly.mv-interactive:hover {
  cursor: crosshair;
  background-color: #e9f5ff;
}
.mv-day-cell-yearly.mv-empty {
  background-color: #fafafa;
  cursor: default;
}
.mv-day-cell-yearly.mv-empty:hover {
  background-color: #fafafa;
}
.mv-day-cell-yearly.mv-today {
  background-color: #fff3cd;
  font-weight: bold;
  border: 1px solid #ffeeba;
  box-sizing: border-box;
}
.mv-day-cell-yearly.mv-current-week-day {
  outline: 1px solid #86b7fe;
  outline-offset: -1px;
  z-index: 1;
}
.mv-day-cell-yearly.mv-today.mv-current-week-day {
  outline: 1px solid #0d6efd;
}
.mv-day-cell-yearly.mv-temp-highlight {
  background-color: rgba(0, 123, 255, 0.3) !important;
  outline: 1px dashed rgba(0, 123, 255, 0.7) !important;
  z-index: 5;
}
.mv-day-cell-yearly.mv-drag-over,
.mv-weekly-day-cell.mv-drag-over {
  /* weekly view와 공유하는 클래스 */
  background-color: #d6eaff !important;
  border: 1px dashed #007bff;
}

/* 백로그 영역 드래그오버 스타일 */
#backlogListContainer.mv-drag-over {
  background-color: #e8f5e8;
  border: 2px dashed #28a745;
  border-radius: 4px;
}

/* 연간 캘린더 할 일 드래그 스타일 */
.mv-todo-box-in-calendar.mv-dragging {
  opacity: 0.6;
  transform: rotate(2deg);
  transition: all 0.2s ease;
}

.mv-day-cell-content-wrapper-yearly {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;

  display: flex;
  flex-direction: column; /* 핵심: 아이템을 역순으로 쌓습니다. */
  /* justify-content: flex-end;  */
  gap: 0;
}
.mv-day-cell-content-wrapper-yearly::-webkit-scrollbar {
  display: none;
}

/* Yearly Calendar Project Bar Styles */
.mv-day-cell-content-wrapper-yearly .mv-project-bar {
  /* position: absolute; */
  position: relative;
  /* left: 0;
    right: 0; */
  /* margin-top: 1px;  */
  flex-shrink: 0; /* 아이템 크기가 줄어들지 않도록 설정 */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 8px;
  color: white;
  padding: 0 4px;
  /* border-radius: 2px; */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.mv-day-cell-content-wrapper-yearly .mv-project-bar .mv-project-bar-text {
  flex-grow: 1; /* 텍스트가 남는 공간을 모두 차지하도록 */
  overflow: hidden;
  text-overflow: ellipsis;
}

.mv-day-cell-content-wrapper-yearly .mv-project-bar .mv-project-bar-delete {
  display: none; /* 평소에는 숨김 */
  font-weight: bold;
  /* margin-left: 5px; */
  padding: 0 4px;
  border-radius: 50%;
  line-height: 1;
}

.mv-day-cell-content-wrapper-yearly
  .mv-project-bar:hover
  .mv-project-bar-delete {
  display: inline-block; /* 마우스를 올리면 표시 */
  background-color: rgba(0, 0, 0, 0.2);
}

.mv-day-cell-content-wrapper-yearly
  .mv-project-bar
  .mv-project-bar-delete:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

.mv-todo-box-in-calendar {
  /* position: absolute; <-- 이 줄을 삭제하거나 주석 처리 */
  position: relative; /* <-- position: relative; 로 변경 */
  width: 100%;
  /* top, left 속성은 더 이상 필요 없습니다. */

  /* ▼▼▼ [추가] Flex 아이템 스타일 ▼▼▼ */
  /* margin-top: 1px; */
  flex-shrink: 0;
  box-sizing: border-box;
  border-radius: 2px;
  font-size: 0.8em;
  padding: 1px 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  user-select: none;
  cursor: pointer;
  z-index: 3;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Custom Context Menu for Labels */
#customLabelContextMenu {
  /* ID는 메인 뷰 내에서 고유 */
  position: absolute;
  min-width: 150px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1010;
  padding: 5px 0;
}
#customLabelContextMenu .mv-context-menu-item {
  /* 내부 아이템은 클래스 사용 */
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9em;
}
#customLabelContextMenu .mv-context-menu-item:hover {
  background-color: #f0f0f0;
}

/* Project Bar Styling */
.mv-project-bar {
  position: absolute;
  left: 0;
  width: calc(100% / 0.75);
  height: 6px;
  box-sizing: border-box;
  border: 0px solid transparent;
  border-radius: 0px;
  border: none;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  font-size: 0.5em;
  color: white;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  user-select: none;
  cursor: pointer;
  z-index: 2;
  transition: filter 0.2s;
  display: flex;
  align-items: center;
  line-height: 1;
  transform: scale(0.75);
  transform-origin: top left;
}
.mv-project-bar.mv-selected {
  border: 1px dashed #fff;
  filter: brightness(1.3);
  z-index: 10;
}
.mv-project-bar:hover {
  filter: brightness(1.2);
}

/* .delete-event-btn, .resize-handle 자체 스타일은 기존 스타일 활용 */

.mv-project-bar .delete-event-btn {
  position: absolute;
  top: -5px; /* 위치 조정 (바 상단에 살짝 걸치도록) */
  right: -5px; /* 위치 조정 */
  width: 16px; /* 버튼 크기 */
  height: 16px;
  padding: 0;
  margin: 0;
  background-color: #ff3b30; /* 눈에 띄는 배경색 (예: iOS 삭제 버튼 빨간색) */
  color: white; /* X자 색상 */
  border: 1px solid white; /* 테두리를 주어 배경과 구분 */
  border-radius: 50%; /* 원형 버튼 */
  font-size: 12px; /* X자 크기 */
  font-weight: bold;
  line-height: 14px; /* X자 수직 중앙 정렬 (height - 2*border) */
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 15; /* 다른 요소들 위에 오도록 */
  display: none; /* 기본적으로 숨김 (mv-selected 클래스가 있을 때 표시됨) */
  transition: transform 0.1s ease-out;
}

.mv-project-bar .delete-event-btn:hover {
  background-color: #e00000; /* 호버 시 약간 어둡게 */
  transform: scale(1.1); /* 약간 확대 */
}

/* 선택된 프로젝트 바(.mv-selected) 내부의 삭제 버튼만 표시 */
.mv-project-bar.mv-selected .delete-event-btn {
  display: block;
}

/* Yearly Calendar Project Bar 내부 리사이즈 핸들 스타일 (선택 사항) */
.mv-project-bar .resize-handle {
  position: absolute;
  top: 0;
  width: 6px; /* 핸들 너비 */
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1); /* 약간 투명한 배경 */
  cursor: ew-resize;
  z-index: 14;
  display: none; /* 기본적으로 숨김 */
}

.mv-project-bar .resize-handle.left {
  left: -3px; /* 바깥쪽으로 살짝 나오게 */
}

.mv-project-bar .resize-handle.right {
  right: -3px; /* 바깥쪽으로 살짝 나오게 */
}

.mv-project-bar.mv-selected .resize-handle {
  display: block;
}

/* Label Management Styles */
.mv-label-item {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
  border: 1px solid #ccc;
  background-color: #f8f9fa;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.mv-label-item.mv-selected-for-drawing {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  background-color: #cfe2ff;
}
.mv-label-item:hover {
  background-color: #e9ecef;
}
.mv-label-color-swatch {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.mv-label-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mv-label-item.mv-dragging {
  opacity: 0.5;
  border-style: dashed;
}

/* --- Yearly Calendar Day Cell Marks & Context Menu --- */
.mv-day-cell-yearly .cell-mark-on-date {
  /* 날짜 셀에 실제로 표시될 마크 */
  position: absolute;
  top: 3px; /* 셀 상단에서의 위치 */
  right: 4px; /* 셀 우측에서의 위치 */
  font-size: 11px; /* 셀에 표시될 때의 아이콘 크기 (조정 가능) */
  line-height: 1;
  z-index: 4; /* 다른 셀 내용물 위에 오도록 */
  pointer-events: none; /* 마크 자체는 클릭 이벤트를 가로채지 않도록 */
}

/* 우클릭 컨텍스트 메뉴 */
.mv-day-cell-context-menu {
  display: none; /* JS가 display: block; 으로 바꿔서 보여줌 */
  position: absolute; /* JS가 top, left 설정 */
  background-color: white;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15);
  padding: 5px 0;
  z-index: 1050; /* 다른 UI 요소들보다 위에 오도록 */
  min-width: 160px; /* 메뉴 최소 너비 */
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif; /* 시스템 폰트 사용 */
}

.mv-day-cell-context-menu .context-menu-title {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  border-bottom: 1px solid #eee;
  margin-bottom: 5px;
  user-select: none; /* 텍스트 선택 방지 */
}

.mv-day-cell-context-menu .context-menu-item {
  padding: 7px 12px; /* 패딩 약간 조정 */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px; /* 메뉴 아이템 폰트 크기 */
  user-select: none; /* 텍스트 선택 방지 */
}

.mv-day-cell-context-menu .context-menu-item:hover {
  background-color: #f0f0f0;
}

.mv-day-cell-context-menu .context-menu-item .mark-icon {
  font-size: 15px; /* 메뉴 내 아이콘 크기 */
  width: 20px;
  text-align: center;
  line-height: 1; /* 아이콘 수직 정렬 */
}

/* 각 마크 아이콘 색상 (이모지 자체 색상 활용 시 불필요할 수 있음) */
.mark-icon.mark-heart {
  color: red;
}
.mark-icon.mark-star {
  color: #ffc107; /* 좀 더 부드러운 노란색 */
}
.mark-icon.mark-check {
  color: green;
}
.mark-icon.mark-pin {
  color: dodgerblue;
}
.mark-icon.mark-warning {
  color: orange;
}
.mark-icon.mark-question {
  color: rebeccapurple;
}
.mark-icon.mark-exclamation {
  color: #dc3545; /* Bootstrap danger color */
}
.mark-icon.mark-cross {
  color: #343a40; /* Bootstrap dark color */
}
.mark-icon.mark-none {
  color: #6c757d; /* Bootstrap secondary color */
}

/* 셀에 적용될 마크 색상 (아이콘 색상과 동일하게 하거나 다르게 할 수 있음) */
.cell-mark-on-date.heart-mark-color {
  color: red;
}
.cell-mark-on-date.star-mark-color {
  color: #ffc107;
}
.cell-mark-on-date.check-mark-color {
  color: green;
}
.cell-mark-on-date.pin-mark-color {
  color: dodgerblue;
}
.cell-mark-on-date.warning-mark-color {
  color: orange;
}
.cell-mark-on-date.question-mark-color {
  color: rebeccapurple;
}
.cell-mark-on-date.exclamation-mark-color {
  color: #dc3545;
}
.cell-mark-on-date.cross-mark-color {
  color: #343a40;
}
