/* ===========================
   Main Calendar Section
   =========================== */
.main-calendar {
    padding: 80px 0;
    background: #fff;
}

/* FullCalendar Override */
#main_calendar {
    max-width: 1280px;
    margin: 0 auto;
}

#main_calendar .fc {
    font-family: inherit;
}

/* Toolbar */
#main_calendar .fc-toolbar.fc-header-toolbar {
    margin-bottom: 24px;
    align-items: center;
}

#main_calendar .fc-toolbar-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #111;
}

#main_calendar .fc-button {
    background: #fff;
    border: 1px solid #ddd;
    color: #444;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: none;
    text-transform: none;
}

#main_calendar .fc-button:hover,
#main_calendar .fc-button:focus {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: none;
}

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

#main_calendar .fc-button-group {
    gap: 4px;
}

#main_calendar .fc-today-button {
    font-weight: 600;
}

/* Table Head (요일) */
#main_calendar .fc-col-header-cell {
    background: var(--primary-color-bright);
    padding: 10px 0;
}

#main_calendar .fc-col-header-cell-cushion {
    font-size: 15px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
}

/* 일요일/토요일 색상 */
#main_calendar .fc-day-sun .fc-col-header-cell-cushion,
#main_calendar .fc-day-sun .fc-daygrid-day-number {
    color: #d0453f;
}

#main_calendar .fc-day-sat .fc-col-header-cell-cushion,
#main_calendar .fc-day-sat .fc-daygrid-day-number {
    color: var(--primary-blue);
}

/* Day Cell */
#main_calendar .fc-daygrid-day {
    min-height: 90px;
    transition: background 0.15s;
}

#main_calendar .fc-daygrid-day:hover {
    background: #faf8f7;
}

#main_calendar .fc-daygrid-day-number {
    font-size: 15px;
    color: #333;
    padding: 6px 10px;
    text-decoration: none;
    font-weight: 500;
}

/* 오늘 날짜 */
#main_calendar .fc-day-today {
    background: var(--primary-color-bright) !important;
}

#main_calendar .fc-day-today .fc-daygrid-day-number {
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px;
    padding: 0;
    font-size:13px;
}

/* 이벤트 */
#main_calendar .fc-event {
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

#main_calendar .fc-event:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

#main_calendar .fc-event-title {
    font-weight: 500;
}

/* List View */
#main_calendar .fc-list-event:hover td {
    background: var(--primary-color-bright);
    cursor: pointer;
}

#main_calendar .fc-list-event-dot {
    border-color: var(--primary-color);
}

#main_calendar .fc-list-day-cushion {
    background: var(--primary-color-bright);
    font-weight: 600;
    font-size: 16px;
}

/* Border */
#main_calendar .fc-scrollgrid {
    border-radius: 12px;
    overflow: hidden;
    border-color: #e8e8e8 !important;
}

#main_calendar .fc-scrollgrid td,
#main_calendar .fc-scrollgrid th {
    border-color: #e8e8e8 !important;
}

.fc .fc-daygrid-day-frame{
    height:140px
}
.fc .fc-daygrid-more-link{
    font-size:12px;
    color:#777;
    padding-left:5px
}

/* ===========================
   Calendar Modal
   =========================== */
.cal-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.cal-modal-overlay.is-open {
    display: flex;
}

.cal-modal {
    background: #fff;
    border-radius: 0 0 16px 16px;
    width: 90%;
    max-width: 460px;
    padding: 36px 32px 28px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: calModalIn 0.25s ease;
}

@keyframes calModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cal-modal__color-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-color);
}

.cal-modal__close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.cal-modal__close:hover {
    color: #333;
}

.cal-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px;
    padding-right: 24px;
    line-height: 1.4;
}

.cal-modal__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.cal-modal__date {
    font-size: 15px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-modal__date::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aaa'%3E%3Cpath d='M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2h-1V1h-2zm3 18H5V8h14v11z'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

.cal-modal__divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 4px 0 14px;
}

.cal-modal__content {
    font-size: 16px;
    color: #555;
    line-height: 1.7;
    white-space: pre-line;
    max-height: 180px;
    overflow-y: auto;
}

.cal-modal__allday {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary-color-bright);
    color: var(--primary-color);
    margin-bottom: 10px;
}
