/* project-management.css */
/* 프로젝트 관리 스타일 */
.project-container {
  display: flex;
  gap: 25px;
  margin: 20px 0;
}

/* 캘린더 섹션 */
.calendar-section {
  flex: 1;
  min-width: 320px; /* 최소 너비 설정 */
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h3 {
  font-size: 1.2em;
  color: #2A395A;
  font-weight: 500;
  text-align: center;
  padding: 0 10px;
  flex: 0 1 auto; /* flex-grow: 0으로 변경하여 내용물 크기만큼만 차지하도록 */
}

.calendar-header button {
  width: 28px;      /* 고정된 너비 */
  height: 28px;     /* 고정된 높이 */
  padding: 0;       /* 패딩 제거 */
  border: 1px solid #dee2e6;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  color: #495057;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-header button:hover {
  background: #f8f9fa;
  border-color: #ced4da;
}

/* 캘린더 그리드 */
.calendar-grid {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.weekdays div {
  padding: 12px;
  text-align: center;
  font-weight: 500;
  color: #495057;
  font-size: 0.9em;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
  aspect-ratio: 7/6; /* 7:6 비율 유지 */
}

.day {
  padding: 8px;
  /* min-height 제거하고 aspect-ratio로 대체 */
  border: 1px solid #dee2e6;
  position: relative;
  background: #fff;
  transition: background-color 0.2s ease;
  cursor: pointer;
  /* 내부 컨텐츠가 넘치지 않도록 */
  overflow: hidden;
}

.day:hover {
  background: #f8f9fa;
}

.day.other-month {
  background: #f8f9fa;
  color: #adb5bd;
}

.day.today {
  background: #e8f4ff;
}

.day.sunday {
  color: #dc3545;
}

.day.holiday {
  color: #dc3545;
}

/* 공휴일 이름 폰트 크기 더 축소 */
.holiday-name {
  font-size: 0.6em;
  color: #dc3545;
  margin-top: 2px;
  white-space: nowrap; /* 한 줄로 표시 */
  overflow: hidden;
  text-overflow: ellipsis; /* 길이가 넘어가면 ... 으로 표시 */
}

/* 프로젝트 표시 */
.project-indicator {
  position: absolute;
  bottom: 5px;
  right: 5px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.indicator-item {
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.75em;
  color: #fff;
  min-width: 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.indicator-pending {
  background: #ffc107;
}

.indicator-ongoing {
  background: #007bff;
}

.indicator-completed {
  background: #28a745;
}

/* 프로젝트 관리 영역 */
.project-management {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 프로젝트 헤더 레이아웃 개선 */
.project-header {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.project-notice {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

.notice-text {
  color: #856404;
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* 프로젝트 컨트롤 영역 */
.project-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 15px 0;
    flex-wrap: wrap;
    max-width: 100%;
}

/* 버튼 기본 스타일 */
.project-controls button,
.project-controls label,
.project-controls select {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95em;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    margin: 0;
    width: 115px;
    flex: 0 0 auto;
}

/* 버튼 크기와 색상 */
#addProject {
    width: 120px;
    background-color: #4C6EF5;
    color: white;
}

#projectExportCsv {
    width: 120px;
    background-color: #37B24D;
    color: white;
}

label[for="projectImportCsv"] {
    width: 120px;
    background-color: #845EF7;
    color: white;
}

#projectReset {
    width: 120px;
    background-color: #FA5252;
    color: white;
}

/* 상태 필터 스타일 */
#projectFilter {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    padding: 8px 12px;
    margin: 0;
}

/* 반응형 대응 */
@media screen and (max-width: 1024px) {
    .project-controls {
        gap: 6px;
    }

    .project-controls button,
    .project-controls label {
        flex: 1 1 calc(33.333% - 4px);
        width: auto;
    }
}

@media screen and (max-width: 768px) {
    .project-controls {
        gap: 6px;
    }

    .project-controls button,
    .project-controls label {
        flex: 1 1 calc(50% - 3px);
    }

    #projectFilter {
        flex: 1 1 100%;
        max-width: none;
        order: 1; /* 필터를 하단으로 이동 */
        margin-top: 6px;
    }
}

@media screen and (max-width: 480px) {
    .project-controls {
        gap: 6px;
    }

    .project-controls button,
    .project-controls label {
        flex: 1 1 100%;
        font-size: 0.9em;
    }

    #projectFilter {
        order: 1; /* 필터를 하단으로 유지 */
    }
}

/* 파일 입력 숨기기 */
#projectImportCsv {
    display: none;
}

/* 모바일에서만 세로 정렬 */
@media screen and (max-width: 768px) {
    .project-container {
        flex-direction: column;
    }
    
    .calendar-section {
        width: 100%;
        min-width: 0; /* 모바일에서는 최소 너비 제한 해제 */
    }
    
    .calendar-header {
        padding: 0 8px;
    }
    
    .calendar-header h3 {
        font-size: 1.1em;
    }
    
    .calendar-header button {
        width: 24px;
        height: 24px;
    }
    
    .project-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .project-controls button,
    .project-controls label,
    .project-controls select {
        flex: 1 1 calc(50% - 4px); /* 2열 배치 */
        width: auto; /* 고정 너비 해제 */
        font-size: 0.9em;
        padding: 8px;
    }
    
    .weekdays div {
        padding: 8px 4px;
        font-size: 0.8em;
    }
    
    .indicator-item {
        padding: 1px 4px;
        font-size: 0.7em;
        min-width: 16px;
    }
    
    .holiday-name {
        font-size: 0.55em;
    }

    .day {
        padding: 4px;
        font-size: 0.9em;
    }

    .date-number {
        font-size: 0.9em;
        margin-bottom: 1px;
    }
}

/* 더 작은 화면에서의 처리 */
@media screen and (max-width: 480px) {
    .project-controls {
        gap: 6px;
    }

    .project-controls button,
    .project-controls label,
    .project-controls select {
        flex: 1 1 100%; /* 1열 배치 */
        font-size: 0.85em;
        padding: 6px;
    }

    /* 버튼 텍스트가 길 경우 말줄임표 처리 */
    .project-controls button,
    .project-controls label {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .day {
        padding: 2px;
        font-size: 0.8em;
    }
    
    .indicator-item {
        padding: 1px 3px;
        font-size: 0.65em;
        min-width: 14px;
    }
    
    .date-number {
        font-size: 0.8em;
        margin-bottom: 1px;
    }
    
    .holiday-name {
        font-size: 0.5em;
        margin-top: 1px;
    }
}

/* 아주 작은 화면에서의 처리 */
@media screen and (max-width: 360px) {
    .calendar-header h3 {
        font-size: 0.9em;
        padding: 0 4px;
    }
    
    .calendar-header button {
        width: 20px;
        height: 20px;
    }

    .day {
        padding: 1px;
        font-size: 0.7em;
    }

    .date-number {
        font-size: 0.7em;
        margin-bottom: 0;
    }

    .indicator-item {
        padding: 0 2px;
        font-size: 0.6em;
        min-width: 12px;
    }

    .project-indicator {
        gap: 2px;
        bottom: 2px;
        right: 2px;
    }
}

/* 프로젝트 카드 */
.project-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  border-left: 4px solid;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.project-card:hover {
  transform: translateY(-2px);
}

.project-card.pending {
  border-left-color: #ffc107;
}

.project-card.ongoing {
  border-left-color: #007bff;
}

.project-card.completed {
  border-left-color: #28a745;
  opacity: 0.8;
}

.project-card h4 {
  color: #2A395A;
  margin-bottom: 10px;
}

.project-card.completed h4 {
  text-decoration: line-through;
  color: #6c757d;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #218838;
}

.btn-warning {
  background-color: #ffc107;
  color: #000;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.modal-content h3 {
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.modal-content .input-group {
  margin-bottom: 15px;
}

.modal-content label {
  display: block;
  margin-bottom: 5px;
  color: #555;
  font-weight: 500;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

.modal-content textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.modal-buttons button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.modal-buttons button:hover {
  opacity: 0.9;
}

.project-actions {
  display: flex;
  gap: 8px;
}

/* 캘린더 날짜 선택 효과 */
.day.selected {
  background: #e3f2fd;
  border: 2px solid #007bff;
}

/* 프로젝트 상태 버튼 스타일 */
.status-buttons {
    display: flex;
    gap: 8px;
}

.status-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
    color: white;
    opacity: 0.7;
}

.status-btn.pending {
    background: #ffc107;
}

.status-btn.ongoing {
    background: #007bff;
}

.status-btn.completed {
    background: #28a745;
}

/* 상태 설명 레전드 */
.status-legend {
    display: flex;
    gap: 15px;
    padding: 10px 0;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    color: #495057;
}

.status-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-color.pending {
    background: #ffc107;
}

.status-color.ongoing {
    background: #007bff;
}

.status-color.completed {
    background: #28a745;
}

/* 상태 버튼 active 상태 */
.status-btn.active {
    opacity: 1;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-btn:hover {
    opacity: 0.9;
}

/* 프로젝트 헤더 스타일 */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.project-actions {
    display: flex;
    gap: 8px;
}

.edit-btn, .delete-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.edit-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.edit-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.delete-btn {
    background: #fff5f5;
    color: #e03131;
    border: 1px solid #ffc9c9;
}

.delete-btn:hover {
    background: #ffe3e3;
    color: #c92a2a;
}

/* 아이콘 스타일 */
.edit-btn i, .delete-btn i {
    font-size: 0.9em;
}

/* 프로젝트 카드 헤더 스타일 수정 */
.project-card .project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;  /* 상대 위치 */
}

.project-actions {
    position: absolute;  /* 절대 위치 */
    right: 0;
    top: -5px;
}


/* ------------------------------------------ */
/* 1) 선택된 날짜(Date Display) 스타일 개선  */
/* ------------------------------------------ */
.date-display {
  /* 기존에는 없던 스타일을 추가해 주세요 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 8px 12px;
  background-color: #cce5ff;  /* 밝은 파랑 계열 배경 */
  color: #004085;             /* 진한 파랑 계열 텍스트 */
  border-radius: 4px;
  font-size: 0.9em;
  width: 100%;
  box-sizing: border-box;
}

.date-display .clear-date {
  /* 닫기 버튼 개선 */
  background: none;
  border: none;
  color: #004085;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  margin-left: 10px;
}

.date-display .clear-date:hover {
  text-decoration: underline;
}

/* .close-button 클래스를 쓸 경우 */
.date-display .close-button {
  /* 혹시 .close-button을 따로 쓰면 이 부분도 스타일링 가능 */
  background: none;
  border: none;
  color: #004085;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  margin-left: 10px;
  outline: none;
}

.date-display .close-button:hover {
  text-decoration: underline;
}


/* --------------------------------------------------- */
/* 2) note(공지) 영역 - 가로 100% 유지하도록 강제  */
/* --------------------------------------------------- */
.project-notice {
  /* 원래 있던 스타일 + width:100% 추가 */
  width: 100%;
  box-sizing: border-box;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

/* 날짜 숫자를 위한 새로운 클래스 */
.date-number {
  display: block;
  margin-bottom: 2px;
}

/* 프로젝트 버튼 색상 */
.btn-new-project {
    background-color: #4C6EF5;
    color: white;
}

.btn-csv-export {
    background-color: #37B24D;
    color: white;
}

.btn-csv-import {
    background-color: #845EF7;
    color: white;
}

.btn-more {
    background-color: #FA5252;
    color: white;
}
