/* 기본 스타일 리셋 및 폰트 설정 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right top, #d4d3dd, #efefef);
  height: 100vh;
  overflow: hidden;
}

.container {
  display: flex;
  height: 100vh;
  padding: 15px;
  gap: 15px;
}

.sidebar {
  width: 240px;
  padding: 15px 0;
  background: rgba(255, 255, 255, 0.7);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border-radius: 16px;
  transition: background-color 0.4s ease; /* 카테고리 색상 변경을 위한 트랜지션 */
}

.logo {
  text-align: center;
  margin-bottom: 15px;
  padding: 0 15px;
}

.logo h2 {
  font-size: 1.2rem;
  color: #333;
  line-height: 1.4;
  margin-bottom: 8px;
}

.author-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6c757d;
  text-decoration: none;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
  display: inline-block;
}

.author-link:hover {
  color: #007bff;
  transform: scale(1.05);
}

.author-link span {
  color: #007bff; /* 파란색 */
  font-weight: bold; /* 두껍게 */
}

.cheering-container {
  height: 1.5em;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 15px;
}

#cheering-text {
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
  transition:
    transform 0.5s ease-in-out,
    opacity 0.5s ease-in-out;
  transform: translateY(0);
  opacity: 1;
  white-space: nowrap;
}

#cheering-text.slide-out {
  transform: translateY(-150%);
  opacity: 0;
}

.category-nav {
  display: flex;
  justify-content: space-around;
  margin: 0 5px 15px 5px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 8px;
  border-bottom: none;
}

.category-btn {
  background: none;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
  border-radius: 8px;
  transition:
    background 0.3s,
    color 0.3s;
}

.category-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.category-btn.active,
.nav-link.active {
  background: rgba(0, 123, 255, 0.6);
  color: #fff;
  font-weight: bold;
}

.nav-link:hover {
  background: rgba(0, 123, 255, 0.2);
}

.nav-list {
  list-style: none;
  overflow-y: auto;
  flex-grow: 1;
}

.nav-list li {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  margin: 0 10px;
}

.nav-list li.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 6px 7px;
  margin: 2px 10px;
  text-decoration: none;
  color: #444;
  border-radius: 10px;
  transition: background 0.3s ease;
  height: auto;
  font-size: 0.8rem;
  justify-content: space-between; /* 텍스트와 컨트롤 영역 분리 */
}

.nav-link .icon {
  font-size: 1.1rem;
  margin-right: 15px;
  width: 30px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 25px;
  text-align: center;
  padding-left: 15px;
  padding-right: 15px;
}

#dday-container {
  font-size: 0.75rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: 5px;
  min-height: 2.4em;
  line-height: 1.7em;
  cursor: default;
  transition:
    transform 0.3s ease,
    opacity 0.4s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#dday-container:hover {
  transform: scale(1.1);
}

#dday-container.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

#dday-time {
  font-size: 1.1rem;
  color: #000;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.main-content {
  flex-grow: 1;
  border-radius: 16px;
  overflow: hidden;
}

#content-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* 카테고리별 고유 색상 */
.sidebar.category-fe-active .category-btn.active,
.sidebar.category-fe-active .nav-link.active {
  background-color: rgba(32, 178, 170, 0.7);
}
.sidebar.category-fe-active .nav-link:hover {
  background-color: rgba(32, 178, 171, 0.2);
}
.sidebar.category-be-active .category-btn.active,
.sidebar.category-be-active .nav-link.active {
  background-color: rgba(138, 43, 226, 0.6);
}
.sidebar.category-be-active .nav-link:hover {
  background-color: rgba(138, 43, 226, 0.2);
}
.sidebar.category-an-active .category-btn.active,
.sidebar.category-an-active .nav-link.active {
  background-color: rgba(60, 179, 113, 0.7);
}
.sidebar.category-an-active .nav-link:hover {
  background-color: rgba(60, 179, 113, 0.2);
}

/* (기존) 모달 스타일 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
.modal-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  padding: 20px;
  width: 90%;
  max-width: 450px;
  z-index: 999;
}
.modal-visible {
  display: block !important;
}
.modal-container h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: #333;
}
.modal-container p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 15px;
}
#pr-modal-textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  box-sizing: border-box;
}
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.modal-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}
.modal-btn-cancel {
  background: #eee;
  color: #555;
}
.modal-btn-cancel:hover {
  background: #ddd;
}
.modal-btn-confirm {
  background: #007bff;
  color: #fff;
}
.modal-btn-confirm:hover {
  background: #0056b3;
}

/* (기존) PR 모니터링 관련 스타일 */
.sidebar.category-pr-active .category-btn.active,
.sidebar.category-pr-active .nav-link.active {
  background-color: rgba(255, 193, 7, 0.7);
}
.sidebar.category-pr-active .nav-link:hover {
  background-color: rgba(255, 193, 7, 0.2);
}
.pr-refresh-btn {
  display: none;
  background: rgba(0, 123, 255, 0.6);
  color: white;
  border: none;
  padding: 8px;
  margin: 0 20px 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}
.pr-refresh-btn:hover {
  background: rgba(0, 100, 220, 0.7);
}
.nav-link .text {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 5px;
}
.pr-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pr-new-comment-badge {
  background-color: #dc3545;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1;
}
.pr-delete-btn {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
  display: none;
  line-height: 1;
}
.nav-list li[data-category='pr']:hover .pr-delete-btn {
  display: inline;
}
.pr-delete-btn:hover {
  color: #dc3545;
}

/* --- ⬇⬇⬇ [수정] PR 링크 줄바꿈 처리 (파일 맨 아래 추가) --- ⬇⬇⬇ */

/* PR 카테고리 링크에 한해 텍스트 줄바꿈 허용 */
.nav-list li[data-category='pr'] .nav-link .text {
  white-space: normal; /* 줄바꿈 허용 */
  overflow: visible; /* (숨김 해제) */
  text-overflow: clip; /* (줄임표 해제) */
  word-break: break-all; /* 단어 깨서 줄바꿈 */
  line-height: 1.4; /* 줄간격 */
}

/* PR 카테고리 링크의 세로 정렬을 '중앙'에서 '시작(top)'으로 변경 */
.nav-list li[data-category='pr'] .nav-link {
  align-items: flex-start; /* 아이콘, 텍스트, 컨트롤을 상단 정렬 */
  padding-top: 8px;
  padding-bottom: 8px;
}

/* PR 아이콘이 상단 정렬 시 텍스트와 더 잘 맞도록 조정 */
.nav-list li[data-category='pr'] .nav-link .icon {
  margin-top: 2px; /* 텍스트 첫 줄과 대략 맞춤 (미세조정) */
}
/* --- ⬆⬆⬆ [수정] PR 링크 줄바꿈 처리 끝 --- ⬆⬆⬆ */
