/* 기본 레이아웃 */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
}

#app {
  min-height: 100vh;
  width: 100%;
}

/* TimeTree 스타일 캘린더 최적화 */
.fc {
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.fc-toolbar-title {
  font-size: 1.5rem !important;
  font-weight: 700;
}

/* 달력 셀 높이 증가 + 패딩 최소화 */
.fc .fc-daygrid-day {
  min-height: 120px !important;
  padding: 4px !important;
}

.fc .fc-daygrid-day-frame {
  min-height: 110px !important;
}

/* 날짜 번호 스타일 */
.fc .fc-daygrid-day-number {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 4px 8px;
}

/* 이벤트 스타일 - TimeTree처럼 두꺼운 막대에 텍스트 */
.fc-event {
  font-size: 11px !important;
  font-weight: 500 !important;
  padding: 4px 6px !important;
  margin-bottom: 3px !important;
  border-radius: 4px;
  cursor: pointer;
  border: none !important;
  min-height: 22px !important; /* 두꺼운 막대 */
  line-height: 1.2 !important;
  overflow: hidden !important;
}

.fc-event:hover {
  opacity: 0.9;
  transform: scale(1.02);
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* 이벤트 제목 - 흰색 텍스트로 가독성 확보 */
.fc-event-title {
  font-weight: 600 !important;
  color: white !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* +more 링크 스타일 */
.fc-daygrid-more-link {
  font-weight: 600;
  color: #3b82f6;
  margin-top: 2px;
}

/* 주말 배경색 */
.fc .fc-day-sat {
  background-color: #f0f9ff;
}

.fc .fc-day-sun {
  background-color: #fef2f2;
}

/* 오늘 날짜 강조 */
.fc .fc-day-today {
  background-color: #fef3c7 !important;
}

/* 헤더 스타일 */
.fc .fc-col-header-cell {
  padding: 12px 8px;
  font-weight: 700;
  font-size: 0.9rem;
  background-color: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

/* 툴바 버튼 스타일 */
.fc .fc-button {
  padding: 8px 16px;
  font-weight: 600;
  border-radius: 6px;
}

.fc .fc-button-primary {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.fc .fc-button-primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* 모바일 최적화 - TimeTree 스타일 */
@media (max-width: 768px) {
  .fc-toolbar {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .fc-toolbar-chunk {
    margin: 0.25rem 0;
  }
  
  .fc-header-toolbar {
    margin-bottom: 1rem !important;
  }
  
  /* 모바일에서 셀 높이를 더 높게 - TimeTree처럼 */
  .fc .fc-daygrid-day {
    min-height: 180px !important; /* 160px → 180px */
  }
  
  .fc .fc-daygrid-day-frame {
    min-height: 170px !important; /* 150px → 170px */
  }
  
  .fc-daygrid-day-number {
    font-size: 0.85rem;
    padding: 4px 6px;
  }
  
  /* 모바일 이벤트 스타일 - 세로 전체 너비로 강제 */
  .fc-event {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
    position: static !important;
    border: none !important;
    box-sizing: border-box !important;
  }
  
  /* FullCalendar 내부 구조 완전히 제거하고 재설정 */
  .fc-daygrid-event-harness {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    position: static !important;
    border: none !important;
  }
  
  .fc-daygrid-event-harness > .fc-daygrid-event {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 !important;
  }
  
  /* 우리가 만든 커스텀 박스 */
  .custom-event-box {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* 이벤트 세로 쌓기 */
  .fc-daygrid-day-events {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 2px !important;
    gap: 2px !important;
    align-items: stretch !important;
  }
  
  /* 날짜 셀 자체도 flex container로 */
  .fc-daygrid-day-frame {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* FullCalendar 기본 요소들 숨김 또는 블록으로 */
  .fc-event-main,
  .fc-event-main-frame {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* 시간 표시 숨김 */
  .fc-event-time {
    display: none !important;
  }
  
  /* FullCalendar가 자동으로 추가하는 inline 스타일 무력화 */
  .fc-daygrid-event-harness[style] {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    position: static !important;
  }
  
  .fc-toolbar-title {
    font-size: 1.1rem !important;
  }
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}
/* ====================================
   커스텀 월간 캘린더 (TimeTree 스타일)
   ==================================== */

.custom-calendar {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* 헤더 */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.calendar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(0);
}

.today-btn {
  padding: 8px 16px;
}

.calendar-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

/* 요일 헤더 */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.weekday {
  padding: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #374151;
}

.weekday.sunday {
  color: #ef4444;
}

.weekday.saturday {
  color: #3b82f6;
}

/* 날짜 그리드 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  background: #f3f4f6;
}

/* 날짜 셀 */
.calendar-cell {
  background: white;
  border: 1px solid #e5e7eb;
  min-height: 120px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.calendar-cell:hover {
  background: #f9fafb;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 다른 달 날짜 */
.calendar-cell.other-month {
  background: #fafafa;
  opacity: 0.5;
}

.calendar-cell.other-month .day-number {
  color: #9ca3af;
}

/* 오늘 날짜 */
.calendar-cell.today {
  background: #fef3c7;
  border: 2px solid #f59e0b;
}

.calendar-cell.today .day-number {
  color: #f59e0b;
  font-weight: 800;
}

/* 날짜 번호 */
.day-number {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  text-align: right;
}

/* 일정 컨테이너 */
.events-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

/* 일정 태그 (TimeTree 스타일) */
.event-tag {
  background: #8b5cf6;
  color: white;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.event-tag:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  opacity: 0.95;
}

/* 추가 일정 표시 */
.more-events {
  color: #3b82f6;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  background: #eff6ff;
  transition: all 0.2s;
}

.more-events:hover {
  background: #dbeafe;
  transform: scale(1.05);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .calendar-header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .calendar-title {
    font-size: 1.2rem;
  }
  
  .calendar-nav {
    width: 100%;
    justify-content: space-between;
  }
  
  .nav-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .weekday {
    padding: 8px 4px;
    font-size: 0.8rem;
  }
  
  .calendar-cell {
    min-height: 100px;
    padding: 6px;
  }
  
  .day-number {
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .event-tag {
    font-size: 11px;
    padding: 5px 6px;
  }
  
  .more-events {
    font-size: 11px;
    padding: 3px 6px;
  }
}

/* 아주 작은 모바일 화면 */
@media (max-width: 480px) {
  .calendar-cell {
    min-height: 90px;
    padding: 4px;
  }
  
  .day-number {
    font-size: 13px;
  }
  
  .event-tag {
    font-size: 10px;
    padding: 4px 5px;
  }
  
  .weekday {
    font-size: 0.75rem;
    padding: 6px 2px;
  }
}

/* ====================================== */
/* 커스텀 월간 캘린더 (FullCalendar 대체) */
/* ====================================== */

.custom-calendar {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
}

/* 헤더 영역 */
.calendar-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 16px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.calendar-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.calendar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.today-btn {
  padding: 8px 16px;
}

/* 요일 헤더 */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  z-index: 9;
}

.weekday {
  text-align: center;
  padding: 12px 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #374151;
}

.weekday.sunday {
  color: #ef4444;
}

.weekday.saturday {
  color: #3b82f6;
}

/* 날짜 그리드 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 날짜 셀 */
.calendar-cell {
  background: white;
  min-height: 120px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.2s;
}

.calendar-cell:hover {
  background: #f9fafb;
}

.calendar-cell.other-month {
  background: #fafafa;
  opacity: 0.5;
}

.calendar-cell.today {
  background: #fef3c7;
}

.calendar-cell.today .day-number {
  background: #f59e0b;
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 날짜 번호 */
.day-number {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #374151;
}

/* 일정 컨테이너 */
.events-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow: hidden;
}

/* 일정 태그 */
.event-tag {
  background: #8b5cf6;
  color: white;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s;
  box-sizing: border-box;
}

.event-tag:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  opacity: 0.95;
}

/* 추가 일정 표시 */
.more-events {
  font-size: 11px;
  color: #3b82f6;
  font-weight: 700;
  text-align: center;
  padding: 4px;
  cursor: pointer;
  margin-top: 2px;
  background: #dbeafe;
  border-radius: 4px;
  transition: all 0.15s;
}

.more-events:hover {
  background: #bfdbfe;
  transform: scale(1.05);
}

/* ====================================== */
/* 반응형: 태블릿 (768px 이하) */
/* ====================================== */
@media (max-width: 768px) {
  .calendar-title {
    font-size: 1.25rem;
  }
  
  .calendar-cell {
    min-height: 100px;
    padding: 6px;
  }
  
  .day-number {
    font-size: 0.85rem;
  }
  
  .event-tag {
    font-size: 11px;
    padding: 4px 6px;
  }
  
  .more-events {
    font-size: 10px;
  }
}

/* ====================================== */
/* 반응형: 모바일 (480px 이하) */
/* ====================================== */
@media (max-width: 480px) {
  .custom-calendar {
    height: 100vh;
    overflow: hidden;
  }
  
  .calendar-header {
    padding: 12px;
  }
  
  .calendar-title {
    font-size: 1.1rem;
  }
  
  .nav-btn {
    padding: 6px 10px;
    font-size: 0.9rem;
  }
  
  .today-btn {
    padding: 6px 12px;
  }
  
  .weekday {
    padding: 6px 2px;
    font-size: 0.75rem;
  }
  
  /* 모바일에서 요일 헤더의 sticky 위치 조정 */
  .calendar-weekdays {
    top: 48px;
  }
  
  /* 모바일에서 그리드는 세로 스크롤 */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .calendar-cell {
    min-height: 75px;
    max-height: 75px;
    padding: 3px;
    overflow: hidden;
  }
  
  .day-number {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }
  
  .events-container {
    gap: 2px;
  }
  
  .event-tag {
    font-size: 9px;
    padding: 2px 4px;
    line-height: 1.2;
  }
  
  .more-events {
    font-size: 8px;
    padding: 2px;
  }
}

