/* schedule.css */

.schedule-main {
    padding-top: 90px;
    min-height: 100vh;
}

.schedule-title {
    text-align: center;
    font-size: 2.4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    margin-bottom: 30px;
    padding-top: 20px;
}

/* ── 컨트롤 영역 ── */
.schedule-controls {
    background: rgba(255,255,255,0.92);
    border-radius: 14px;
    padding: 18px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.control-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #888;
    margin-right: 8px;
    letter-spacing: 0.5px;
}

.member-filter-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.member-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    background: #f0f0f0;
    color: #555;
}

.member-btn.active {
    color: #fff;
    border-color: transparent;
}

.member-btn:not(.active) {
    background: #f0f0f0;
    color: #888;
}

/* ── 뷰 토글 ── */
.view-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle {
    display: flex;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: #888;
}

.toggle-btn.active {
    background: #0d1a2f;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ── 로딩 ── */
.schedule-loading {
    text-align: center;
    padding: 80px 20px;
    color: #fff;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.schedule-error, .schedule-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
}

/* ═══════════════════════════════
   리스트 뷰
═══════════════════════════════ */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-date-group {
    background: rgba(255,255,255,0.92);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.list-date-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(13,26,47,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.list-date-header.today-header {
    background: rgba(52, 152, 219, 0.12);
}

.list-date-badge {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0d1a2f;
}

.list-date-detail {
    font-size: 0.85rem;
    color: #666;
}

.today-chip {
    background: #e74c3c;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.list-events {
    padding: 8px 0;
}

.list-event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background 0.2s;
}

.list-event-item:hover {
    background: rgba(0,0,0,0.03);
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-shrink: 0;
}

.event-member-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.event-text {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

/* 지난 일정 */
.list-date-group.past {
    opacity: 0.55;
}

.past-section {
    margin-bottom: 8px;
}

.past-toggle-btn {
    width: 100%;
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    cursor: pointer;
    text-align: left;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.past-toggle-btn:hover {
    background: rgba(255,255,255,0.25);
}

.past-list {
    display: none;
}

.past-list.open {
    display: block;
}

/* ═══════════════════════════════
   달력 뷰
═══════════════════════════════ */
.calendar-view {
    background: rgba(255,255,255,0.92);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #0d1a2f;
    color: #fff;
}

.calendar-nav-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.calendar-month-label {
    font-size: 1.3rem;
    font-weight: 800;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    text-align: center;
    padding: 12px 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #888;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.calendar-day-header:first-child { color: #e74c3c; }
.calendar-day-header:last-child { color: #3498db; }

.calendar-cell {
    min-height: 90px;
    padding: 8px 6px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    position: relative;
    transition: background 0.15s;
}

.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell:hover { background: rgba(52,152,219,0.04); }

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

.calendar-cell.other-month .cal-day-num {
    color: #ccc;
}

.calendar-cell.today {
    background: rgba(52,152,219,0.06);
}

.cal-day-num {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0d1a2f;
    margin-bottom: 4px;
    line-height: 1;
}

.calendar-cell.today .cal-day-num {
    background: #3498db;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* 일요일 날짜 빨간색, 토요일 파란색 */
.calendar-cell:nth-child(7n+1) .cal-day-num { color: #e74c3c; }
.calendar-cell:nth-child(7n) .cal-day-num { color: #3498db; }

/* 오늘은 파란 원이니까 색 override 방지 */
.calendar-cell.today .cal-day-num { color: #fff !important; }

.cal-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.cal-event-chip {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    line-height: 1.4;
}

/* ── 반응형 ── */
@media (max-width: 768px) {
    .schedule-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .schedule-title { font-size: 1.8rem; }

    .calendar-cell { min-height: 60px; padding: 4px 3px; }
    .cal-day-num { font-size: 0.8rem; }
    .cal-event-chip { font-size: 0.6rem; padding: 1px 4px; }

    .list-date-badge { font-size: 0.95rem; }
    .list-event-item { padding: 8px 14px; }
}

.nav-active {
    color: #3498db !important;
}
