/* lunar-calendar.css */

/* 입력 그룹 스타일 */
.date-inputs,
.dday-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.date-inputs .form-group,
.dday-inputs .form-group {
  flex: 1;
  min-width: 180px;
}

/* 결과 컨테이너 스타일 */
.result-container {
  background: #fff;
  border-radius: var(--border-radius);
  margin-top: 1.5rem;
  border: 1px solid var(--gray-300);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.result-container:hover {
  border-color: var(--gray-400);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.result-header {
  background: #f8f9fa;
  padding: 0.75rem 1rem;
  font-weight: bold;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-content {
  padding: 1.25rem;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--gray-800);
  min-height: 90px;
  line-height: 1.5;
}

/* 액션 버튼 스타일 */
.action-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.action-buttons .btn {
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.action-buttons .btn:hover {
  transform: translateY(-2px);
}

/* 절기 및 휴일 정보 스타일 */
.season-info,
.holiday-info {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  display: none;
  animation: fadeIn 0.3s ease;
}

.season-info {
  background-color: rgba(76, 175, 80, 0.1);
  border-left: 3px solid var(--success);
}

.holiday-info {
  background-color: rgba(244, 67, 54, 0.1);
  border-left: 3px solid var(--danger);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 저장된 목록 탭 스타일 */
.card-tabs {
  display: flex;
  margin-left: auto;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  padding: 2px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--gray-600);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  font-weight: 500;
}

.tab-btn:hover:not(.active) {
  background: rgba(0,0,0,0.05);
}

/* 저장된 리스트 스타일 */
.saved-list-container {
  margin-bottom: 1.5rem;
}

.saved-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.saved-list-actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.saved-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  background: white;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) var(--gray-200);
}

.saved-list::-webkit-scrollbar {
  width: 8px;
}

.saved-list::-webkit-scrollbar-thumb {
  background-color: var(--gray-400);
  border-radius: 4px;
}

.saved-list::-webkit-scrollbar-track {
  background-color: var(--gray-200);
}

.saved-list:empty::after {
  content: "저장된 항목이 없습니다.";
  display: block;
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
  font-style: italic;
}

.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-300);
  transition: background 0.2s;
}

.saved-item:hover {
  background: rgba(var(--primary-rgb), 0.03);
}

.saved-item:last-child {
  border-bottom: none;
}

.saved-item-content {
  flex: 1;
  overflow: hidden;
}

.saved-item-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
  color: var(--gray-800);
}

.saved-item-date {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.saved-item-data {
  margin-top: 0.35rem;
  color: var(--gray-700);
  font-family: monospace;
  background: #f8f9fa;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.saved-item-actions {
  display: flex;
  gap: 0.75rem;
  margin-left: 1rem;
}

.saved-item-actions button {
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  padding: 0.35rem;
  transition: all 0.2s;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.saved-item-actions .load-btn:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.saved-item-actions .delete-btn:hover {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.1);
}

/* 가져오기/내보내기 컨트롤 */
.import-export-controls {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--gray-300);
}

.import-export-controls .btn {
  min-width: 140px;
  padding: 0.6rem 1.25rem;
}

/* 미니 캘린더 스타일 */
.calendar-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

#currentMonthYear {
  margin: 0 0.85rem;
  font-weight: bold;
  min-width: 100px;
  text-align: center;
}

.calendar-nav .btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: #f8f9fa;
  padding: 3px;
}

.calendar-header {
  text-align: center;
  font-weight: bold;
  padding: 0.65rem 0;
  background-color: #e9ecef;
  color: #343a40;
}

.calendar-day {
  text-align: center;
  padding: 0.65rem 0.25rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  color: #343a40;
}

.calendar-day:hover {
  background-color: rgba(var(--primary-rgb), 0.08);
  transform: scale(1.03);
  z-index: 2;
}

.calendar-day.other-month {
  opacity: 0.5;
  background-color: #f8f9fa;
}

.calendar-day.today {
  background-color: rgba(67, 97, 238, 0.12);
  font-weight: bold;
  border-color: rgba(67, 97, 238, 0.3);
  color: #343a40;
}

.calendar-day.dday {
  background-color: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.3);
}

.calendar-day.holiday {
  color: #dc3545;
}

.calendar-day.weekend {
  color: #dc3545;
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  margin-top: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap::0.5rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.today-color {
  background-color: rgba(67, 97, 238, 0.5);
}

.dday-color {
  background-color: rgba(76, 175, 80, 0.5);
}

.holiday-color {
  background-color: rgba(244, 67, 54, 0.5);
}

.tooltip {
  display: none;
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #343a40;
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  pointer-events: none;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: #343a40 transparent transparent;
}

.calendar-day:hover .tooltip {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* 음력 표시 스타일 */
.lunar-day {
  font-size: 0.7rem;
  color: #6c757d;
  margin-top: 0.2rem;
  display: block;
}

/* 체크박스 스타일 */
.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.form-check-input {
  margin-right: 0.5rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-check-label {
  user-select: none;
  cursor: pointer;
}

/* 빈 항목 스타일 */
.empty-list {
  padding: 20px;
  text-align: center;
  color: var(--gray-500);
  font-style: italic;
  background: white;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
  .date-inputs,
  .dday-inputs {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .action-buttons {
    flex-wrap: wrap;
  }
  
  .action-buttons .btn {
    flex: 1;
    min-width: unset;
  }
  
  .saved-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .saved-item-actions {
    margin-top: 0.75rem;
    margin-left: 0;
    align-self: flex-end;
  }
  
  .calendar-day {
    padding: 0.35rem 0.15rem;
    font-size: 0.85rem;
  }
  
  .lunar-day {
    font-size: 0.6rem;
  }
  
  .import-export-controls {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .card-tabs {
    margin-top: 0.5rem;
    margin-left: 0;
    width: 100%;
  }
  
  .tab-btn {
    flex: 1;
    text-align: center;
  }
}