@charset "UTF-8";

/**
 * --------------------------------------------------------------------------
 * FullCalendar Custom Styles (Project Standard)
 * --------------------------------------------------------------------------
 * @description 프로젝트 테마(CSS 변수) 및 다크모드 완벽 대응
 */

.fc-direction-ltr {
  direction: ltr;
  text-align: left;
}

.fc, .fc *, .fc ::after, .fc ::before {
  box-sizing: border-box;
}

.fc {
  --fc-today-bg-color: var(--bg-today);
  /*--fc-today-bg-color: #f0f4f8;*/

  display: flex;
  flex-direction: column;
  font-size: 14px; /* 프로젝트 기본 폰트 사이즈에 맞춤 */
  font-family: inherit;
  color: var(--text-primary); /* 텍스트 컬러 변수 적용 */
}

:root {
  --bg-today: #f4f0f8; /* Pale Lavender */
}
[data-theme="dark"] {
  --bg-today: #2e273c;
}

.fc-theme-standard {
  display: block;
}

.fc .fc-view-harness {
  flex-grow: 1;
  position: relative;
}

.fc-view-harness-active {
  height: 100% !important;
}

.fc .fc-view-harness-active > .fc-view {
  position: relative;
}

.fc .fc-scroller-liquid-absolute {
  position: relative;
  overflow: visible !important;
}

/* 툴바 타이틀 */
.fc .fc-toolbar.fc-header-toolbar {
  padding-top: 8px;
  margin-bottom: 16px;
}

.fc .fc-toolbar-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary); /* 하드코딩 컬러 제거 */
  margin: 0 10px;
}

/* 테이블 보더 (다크모드 대응) */
.fc-theme-standard td,
.fc-theme-standard th {
  border: 1px solid var(--border-color);
}

.fc-theme-standard th {
  border-bottom: 0;
  padding: 8px 0;
  background-color: var(--bg-content); /* 헤더 배경색 */
}

/* 요일별 배경색 (다크모드 대응을 위해 rgba 사용) */
.fc table tbody .fc-day-sun {
  background-color: rgba(229, 78, 94, 0.03); /* 일요일: 연한 빨강 */
}

.fc table tbody .fc-day-sat {
  background-color: rgba(49, 130, 246, 0.03); /* 토요일: 연한 파랑 */
}

/*.fc table tbody td {*/
/*  cursor: pointer;*/
/*  transition: background-color 0.2s ease-out;*/
/*}*/

/*.fc table tbody td:hover {*/
/*  background-color: var(--hover-bg);*/
/*}*/

/* 1. 프레임워크 전역 Table 스타일(tr hover)이 달력 행 전체에 간섭하는 것을 원천 차단 */
.fc table tbody tr:hover {
  background-color: transparent !important;
}

/* 2. 실제 날짜가 렌더링되는 개별 셀(fc-daygrid-day)에만 hover 및 커서 효과 적용 */
.fc table tbody td.fc-daygrid-day {
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.fc table tbody td.fc-daygrid-day:hover {
  background-color: var(--hover-bg) !important;
}

/* 빈 셀(이전/다음 달의 빈 공간 등)에는 hover 효과를 주지 않음 */
.fc table tbody td.fc-day-other:hover {
  background-color: transparent !important;
  cursor: default;
}


/* 요일 텍스트 컬러 */
.fc-theme-standard th > .fc-scrollgrid-sync-inner a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

.fc .fc-day-sun > .fc-scrollgrid-sync-inner a {
  color: var(--danger-color); /* 일요일 컬러 */
}

.fc .fc-day-sat > .fc-scrollgrid-sync-inner a {
  color: var(--btn-action-bg); /* 토요일 컬러 */
}

.fc-theme-standard .fc-scrollgrid {
  border: none;
}

.fc .fc-scrollgrid-section > * {
  border-left-width: 1px;
  border-top-width: 1px;
}

/* 날짜 숫자 */
.fc .fc-daygrid-day-top {
  display: grid;
}

.fc .fc-daygrid-day-number {
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

#planList_calendar .fc-daygrid-day-top {
  display: flex;
  justify-content: flex-end;
}

#planList_calendar .fc-daygrid-day-number {
  text-align: right;
}

#planList_calendar .fc-daygrid-day-frame,
#planList_calendar .fc-daygrid-day-bg {
  position: relative;
}

#planList_calendar .planList_calendar-badge {
  position: absolute;
  right: 12px;
  bottom: 8px;
  text-align: right;
  color: var(--primary-color);
  font-weight: 700;
  line-height: 1.25;
}

#planList_calendar .planList_calendar-sales {
  font-size: 12px;
  color: var(--text-primary);
}

#planList_calendar .planList_calendar-count {
  font-size: 14px;
}

#planList_container .planList_custom-div-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

#planList_container .planList_custom-div-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#planList_container .planList_custom-div-item.is-existing {
  background-color: rgba(49, 130, 246, 0.15);
  color: var(--primary-color);
}

#planList_container .planList_custom-div-item.is-new {
  background-color: rgba(46, 184, 92, 0.15);
  color: var(--mon-success);
}

#planList_container .planList_custom-div-item.is-invest {
  background-color: rgba(0, 184, 217, 0.15);
  color: var(--mon-accent);
}

#planList_container .planList_custom-div-item.is-etc {
  background-color: rgba(139, 149, 161, 0.15);
  color: var(--text-secondary);
}

.fc .fc-scroller-harness {
  direction: ltr;
  overflow: hidden;
  position: relative;
}

.fc .fc-scrollgrid table {
  border-left-style: hidden;
  border-right-style: hidden;
  border-top-style: hidden;
}

/* 선택된 날짜 (포커스) */
.fc .selected-date,
.fc .selected-date:focus,
.fc .selected-date:active {
  background-color: color-mix(in srgb, var(--primary-color) 5%, transparent) !important;
  outline: 2px solid var(--primary-color) !important;
  outline-offset: -2px !important; /* 안쪽으로 2px 밀어넣어 inset 효과 구현 */
  box-shadow: none !important;
}

.fc .selected-date .fc-daygrid-day-number {
  color: var(--primary-color);
  font-weight: 700;
}

.fc .fc-day-sun.selected-date > .fc-scrollgrid-sync-inner a,
.fc .fc-day-sat.selected-date > .fc-scrollgrid-sync-inner a {
  color: var(--primary-color);
}

/* FullCalendar 기본 하이라이트가 box-shadow를 가리는 현상 방지 */
.fc .selected-date .fc-daygrid-day-bg {
  z-index: -1;
}

/* 이전/다음 달 날짜 투명도 */
.fc .fc-day-other .fc-daygrid-day-top,
.fc .fc-day-other .fc-daygrid-day-bg div {
  opacity: 0.3;
}

.fc .fc-day-other.selected-date {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 30%, transparent) inset;
}

/* 하이라이트 제거 */
.fc .fc-highlight {
  background: transparent !important;
}

/* 버튼 스타일 (프로젝트 표준 버튼과 이질감 없도록 초기화) */
.fc .fc-button {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-base);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  box-shadow: none;
  transition: all 0.2s;
}

.fc .fc-button:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.fc .fc-button:focus {
  box-shadow: var(--shadow-focus) !important;
}

/* 반응형 처리 */
@media (max-width: 768px) {
  .fc .fc-daygrid-day-number {
    padding: 8px;
    font-size: 13px;
  }

  /* 1. 년도/월 상단 여백 및 폰트 크기 축소 */
  .fc .fc-toolbar-title {
    font-size: 18px;
    margin: 0 4px;
    line-height: 1.2;
  }

  /* 2. 툴바를 PC와 동일하게 한 줄(row)로 배치하고 상단 여백 제거 */
  .fc .fc-toolbar.fc-header-toolbar {
    flex-direction: row; /* 기존 column 에서 row 로 변경 */
    justify-content: space-between;
    align-items: center;
    padding-top: 0;      /* 상단 여백 제거 */
    margin-bottom: 12px;
    gap: 4px;
  }

  /* 3. 버튼 그룹이 좁은 화면에서도 줄바꿈(Wrap) 되지 않도록 강제 */
  .fc .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    overflow-x: auto; /* 극단적으로 좁은 화면일 경우 스크롤 허용 */
  }
  .fc .fc-button-group {
    display: flex;
    flex-wrap: nowrap !important;
  }

  /* 4. 모바일 환경에 맞춰 버튼 크기 미세 조정 (한 줄에 다 들어가도록) */
  .fc .fc-button {
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .fc-scrollgrid-sync-table {
    height: auto !important;
  }
  .fc-theme-standard td {
    height: auto;
    min-height: 80px;
  }
}


/* 셀 내부 커스텀 스타일 (레이아웃 깨짐 방지) */
.fc-daygrid-day-frame { position: relative; } /* 절대 위치의 기준점 역할 */
.fc-day-custom-info {
  position: absolute;
  bottom: 2px;
  right: 4px;
  text-align: right;
  font-size: 11px; /* 폰트 크기 축소 */
  line-height: 1.3; /* 줄간격 최소화 */
  z-index: 5;
}
.fc-day-custom-info .revenue { color: var(--text-primary); font-weight: bold; }
.fc-day-custom-info .calls { color: #2980b9; font-weight: 500; }

/* 팝업 전용 캘린더 래퍼 */
.popup-calendar-wrap {
  display: flex;
  flex-direction: column;
}
/* 휴일(빨간색) 강제 적용 클래스 */
.is-holiday .fc-daygrid-day-number {
  color: var(--danger-color) !important;
}
.is-holiday {
  background-color: rgba(229, 78, 94, 0.03) !important;
}
/* 셀 내부 정보 표시 영역 */
.fc-day-custom-info {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  z-index: 5;
}
.date-nm-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* 팝업 전용 캘린더 래퍼 (높이 제거) */
.popup-calendar-wrap {
  display: flex;
  flex-direction: column;
}
/* 휴일(빨간색) 강제 적용 클래스 */
.is-holiday .fc-daygrid-day-number {
  color: var(--danger-color) !important;
}
.is-holiday {
  background-color: rgba(229, 78, 94, 0.03) !important;
}
/* 셀 내부 정보 표시 영역 */
.fc-day-custom-info {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  z-index: 5;
}
.date-nm-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================
   달력 범례(Legend) 스타일
   ========================================== */
.calendar-legend {
  display: flex;
  flex-wrap: wrap; /* 반응형: 화면이 좁아지면 자동 줄바꿈 */
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background-color: var(--bg-card); /* 다크모드 대응 */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.legend-color-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--danger-color);
  background-color: rgba(229, 78, 94, 0.1); /* 휴일 배경색과 유사하게 표현 */
}

/* ==========================================================================
   [공통] 캘린더 커스텀 스타일 (대시보드, 방문계획 등 공통 사용)
   ========================================================================== */
.cmn-calendar-wrapper .fc-daygrid-day-top {
  display: flex;
  justify-content: flex-end;
}

.cmn-calendar-wrapper .fc-daygrid-day-number {
  text-align: right;
}

.cmn-calendar-wrapper .fc-daygrid-day-frame,
.cmn-calendar-wrapper .fc-daygrid-day-bg {
  position: relative;
}

/* 캘린더 셀 내부 뱃지 (매출, 콜수 등) */
.cmn-calendar-badge {
  position: absolute;
  right: 12px;
  bottom: 8px;
  text-align: right;
  color: var(--primary-color);
  font-weight: 700;
  line-height: 1.25;
}

.cmn-calendar-sales {
  font-size: 12px;
  color: var(--text-primary);
}

.cmn-calendar-count {
  font-size: 14px;
}

/* 커스텀 구분 요약 뱃지 (기존, 신규, 신투 등) */
.cmn-custom-div-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.cmn-custom-div-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cmn-custom-div-item.is-existing {
  background-color: rgba(49, 130, 246, 0.15);
  color: var(--primary-color);
}

.cmn-custom-div-item.is-new {
  background-color: rgba(46, 184, 92, 0.15);
  color: var(--mon-success);
}

.cmn-custom-div-item.is-invest {
  background-color: rgba(0, 184, 217, 0.15);
  color: var(--mon-accent);
}

.cmn-custom-div-item.is-etc {
  background-color: rgba(139, 149, 161, 0.15);
  color: var(--text-secondary);
}

/* 모바일 환경 (화면 너비 768px 이하) 최적화 */
@media screen and (max-width: 768px) {

  /* FullCalendar 셀 내부 텍스트 축소 */
  .cmn-calendar-badge .cmn-calendar-sales,
  .cmn-calendar-badge .cmn-calendar-count {
    font-size: 10px !important; /* 글자 크기 대폭 축소 */
    line-height: 1.2 !important; /* 줄간격 축소 */
    letter-spacing: -0.5px !important; /* 자간을 줄여 좁은 공간에 맞춤 */
  }

}
