/* memo-calendar.css */

/* 캘린더 컨트롤 */
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.current-date-display {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--gray-800);
}

.calendar-action-buttons {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* 달력 스타일 */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.day-cell {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  padding: 8px;
  min-height: 100px;
  position: relative;
  transition: background-color 0.2s;
}

.day-cell:hover {
  background: var(--gray-200);
}

.day-cell .day-number {
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}

.day-cell.today {
  background: rgba(67, 97, 238, 0.1);
}

.day-cell.has-memo {
  background: rgba(76, 175, 80, 0.1);
}

.day-cell.other-month {
  opacity: 0.5;
}

.day-cell.weekend {
  background: var(--gray-200);
}

.day-cell.weekend .day-number {
  color: var(--danger);
}

/* 메모 추가 버튼 */
.day-cell .add-memo {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.day-cell:hover .add-memo {
  opacity: 1;
}

/* 요일 헤더 */
.weekday-header {
  font-weight: bold;
  text-align: center;
  background: var(--gray-300);
  padding: 8px;
}

/* 에디터 툴바 */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
  background: var(--gray-100);
  padding: 8px;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-300);
}

.format-btn {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.format-btn:hover {
  background: var(--gray-200);
}

.format-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--gray-300);
  margin: 0 5px;
}

.format-select {
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: 0 5px;
  height: 30px;
}

.color-picker {
  position: relative;
  width: 30px;
  height: 30px;
}

.color-picker input[type="color"] {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.color-picker label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
}

/* 메모 에디터 */
.memo-editor {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  padding: 10px;
  margin-bottom: 15px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  list-style-position: inside; /* 목록 기호를 컨텐츠 영역 안쪽에 배치 */
  padding-left: 10px; /* 왼쪽 패딩 추가 */
  overflow: auto;
}

.memo-editor ol, 
.memo-editor ul {
  margin: 0;
  padding-left: 20px; /* 목록 들여쓰기 조정 */
}

.memo-editor li {
  margin-bottom: 5px; /* 목록 아이템 간격 */
}

.editor-action-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 메모 검색 및 목록 */
.memo-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: space-between;
}

.search-controls {
  display: flex;
  gap: 5px;
}

.import-export-controls {
  display: flex;
  gap: 5px;
}

.memo-list {
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  max-height: 400px;
  overflow-y: auto;
}

.memo-list:empty::after {
  content: "메모가 없습니다.";
  display: block;
  text-align: center;
  padding: 20px;
  color: var(--gray-500);
}

.memo-item {
  border-bottom: 1px solid var(--gray-300);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  transition: background-color 0.2s;
}

.memo-item:last-child {
  border-bottom: none;
}

.memo-item:hover {
  background-color: var(--gray-100);
}

.memo-date {
  font-weight: bold;
  margin-right: 10px;
  background: var(--gray-200);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--gray-800);
}

.memo-content {
  flex: 1;
  min-width: 200px;
}

.memo-actions {
  display: flex;
  gap: 5px;
}

.memo-actions button {
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.memo-actions button:hover {
  background: var(--gray-200);
}

.memo-actions .edit-memo {
  color: var(--primary);
}

.memo-actions .delete-memo {
  color: var(--danger);
}

/* 별표 스타일 */
.star-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
}

.star-checkbox {
  position: absolute;
  opacity: 0;
}

.star-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 0.9rem;
  user-select: none;
}

.star-label i {
  margin-right: 5px;
  font-size: 1.1rem;
}

.star-unchecked {
  display: inline-block;
}

.star-checked {
  display: none;
  color: var(--warning);
}

.star-checkbox:checked + .star-label .star-unchecked {
  display: none;
}

.star-checkbox:checked + .star-label .star-checked {
  display: inline-block;
}

.star-checkbox:checked + .star-label {
  color: var(--gray-800);
}

/* 중요 날짜 표시 */
.day-cell.important-date .day-number::after {
  content: "★";
  color: var(--warning);
  margin-left: 5px;
  font-size: 0.9em;
}

.day-cell.important-date {
  background-color: rgba(255, 193, 7, 0.1);
}

/* 메모 제목 입력 필드 */
#memoTitle {
  margin-bottom: 12px;
  font-weight: bold;
}

/* 메모 목록 제목 표시 */
.memo-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 1.1rem;
  color: var(--gray-800);
}

/* 메모 미리보기 스타일 수정 */
.memo-preview {
  font-size: 0.8rem;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: var(--gray-700);
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 2px 4px;
  border-radius: 3px;
}

.memo-date-header {
  background: var(--gray-200);
  padding: 8px 12px;
  font-weight: bold;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-300);
}

.date-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.important-star {
  color: var(--warning);
  margin-left: 10px;
}

/* 메모 내용 스타일 수정 */
.memo-body {
  max-height: 150px;
  overflow: auto;
  color: var(--gray-700);
  list-style-position: inside; /* 목록 기호를 컨텐츠 영역 안쪽에 배치 */
  padding-left: 5px; /* 왼쪽 패딩 추가 */
}

.memo-body ol,
.memo-body ul {
  margin: 0;
  padding-left: 20px; /* 목록 들여쓰기 조정 */
}

.memo-body li {
  margin-bottom: 5px; /* 목록 아이템 간격 */
}

.no-memos {
  text-align: center;
  padding: 20px;
  color: var(--gray-500);
  font-style: italic;
}

.more-indicator {
  text-align: center;
  font-style: italic;
  background-color: rgba(0, 0, 0, 0.05);
}

/* 반응형 스타일 */
@media (max-width: 768px) {
  .memo-search-bar {
    flex-direction: column;
  }
  
  .search-controls, .import-export-controls {
    width: 100%;
  }
  
  .editor-toolbar {
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  }
  
  .day-cell {
    min-height: 80px;
    padding: 5px;
  }
}