* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* calendar.html 전용: 전체 화면 꽉찬 레이아웃 */
body.calendar-page {
    padding: 0;
    display: block;
    height: 100vh;
    overflow: hidden;
    background: var(--tw-gradient-from, #f6f7f8);
}
html.dark body.calendar-page {
    background: #101922;
}

/* ... existing code ... */
/* --- [수정] 모달 및 폼 스타일 개선 --- */

.date-range-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fafbfc;
    transition: all 0.2s;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-separator {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.time-control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.all-day-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.all-day-toggle:hover {
    background: #f8f9fa;
}

.all-day-checkbox {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.all-day-checkbox:checked + .toggle-switch {
    background: #667eea;
}

.all-day-checkbox:checked + .toggle-switch::after {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    user-select: none;
}

.time-selector.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* --- [수정] 일정 바 스타일 개선 --- */

/* 일반 일정 (시간 있음) */
.calendar-day .event-bar {
    background-color: #e3e8ff;
    color: #5568d3;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 3px;
    border-left: 3px solid #5568d3;
    width: 100%;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day .event-bar:hover {
    background-color: #d0d8ff;
    transform: translateY(-1px);
}

/* [추가] 종일 일정 스타일 */
.calendar-day .event-bar.all-day {
    background-color: #5568d3; /* 진한 배경 */
    color: white; /* 흰색 글씨 */
    border-left: none; /* 왼쪽 선 제거 (전체가 진하므로) */
    border-radius: 3px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.calendar-day .event-bar.all-day:hover {
    background-color: #485ac0;
}

/* 오늘 날짜의 일정 바 스타일 조정 */
.calendar-day.today .event-bar {
    border-left-color: #333; /* 오늘의 포인트 컬러와 구분을 위해 */
}

/* 오늘 날짜의 종일 일정 */
.calendar-day.today .event-bar.all-day {
    background-color: rgba(255, 255, 255, 0.9);
    color: #5568d3;
    font-weight: 700;
}

/* 검색 강조 */
.calendar-day .event-bar mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

/* --- 모바일 대응 --- */
@media (max-width: 480px) {
    .date-range-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .date-separator {
        text-align: center;
        transform: rotate(90deg); /* 세로 배치 시 회전 효과 등 */
        display: none; /* 공간 절약을 위해 숨김 */
    }
    
    .time-group-header {
        margin-top: 5px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 5px;
    }
}

.calendar-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 900px;
    width: 100%;
}

body.calendar-page .calendar-container {
    max-width: none;
    width: 100%;
    padding: 0;
    box-shadow: none;
    border-radius: 0.75rem;
    background: transparent;
}

@media (max-width: 480px) {
    .calendar-container {
        border-radius: 15px;
        padding: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 360px) {
    .calendar-container {
        padding: 10px;
        border-radius: 12px;
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

@media (max-width: 480px) {
    .calendar-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .calendar-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
        gap: 4px;
    }
}

.calendar-header h1 {
    font-size: 2rem;
    color: #333;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
    min-width: 0;
}

/* 주간 보기일 때 제목 스타일 */
.calendar-header h1.week-view-title {
    font-size: 1.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .calendar-header h1.week-view-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .calendar-header h1 {
        font-size: 0.9rem;
        flex: 1;
        min-width: 0;
        padding: 0 2px;
        white-space: nowrap;
    }
    
    .calendar-header h1.week-view-title {
        font-size: 0.85rem;
        padding: 0 4px;
    }
}

@media (max-width: 360px) {
    .calendar-header h1 {
        font-size: 0.8rem;
        padding: 0 1px;
        white-space: nowrap;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .header-left {
        gap: 6px;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.view-mode-group {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 2px;
}

.view-mode-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: #666;
}

.view-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.view-mode-btn:hover:not(.active) {
    background: #e0e0e0;
    color: #333;
}

@media (max-width: 480px) {
    .view-mode-group {
        gap: 3px;
        padding: 1px;
    }
    
    .view-mode-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .header-right {
        gap: 4px;
        flex-shrink: 0;
    }
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 360px) {
    .nav-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn:active {
    transform: scale(0.95);
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.download-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.download-format-select {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-weight: 600;
}

.download-format-select:hover {
    border-color: #28a745;
}

.download-format-select:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.today-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .download-group {
        gap: 3px;
    }
    
    .download-format-select {
        padding: 4px 6px;
        font-size: 0.7rem;
        border-radius: 6px;
    }
    
    .download-btn {
        padding: 5px 10px;
        font-size: 1rem;
        border-radius: 12px;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    
    .today-btn {
        padding: 5px 10px;
        font-size: 0.65rem;
        border-radius: 12px;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 360px) {
    .today-btn {
        padding: 4px 8px;
        font-size: 0.6rem;
        border-radius: 10px;
    }
    
    .download-group {
        gap: 2px;
    }
    
    .download-format-select {
        padding: 3px 5px;
        font-size: 0.65rem;
        border-radius: 5px;
    }
    
    .download-btn {
        padding: 4px 8px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
}

.today-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.today-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.reset-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.reset-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.reset-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

@media (max-width: 480px) {
    .reset-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
        border-radius: 15px;
    }
}

@media (max-width: 360px) {
    .reset-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
        border-radius: 12px;
    }
}

/* 검색 컨테이너 */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clear-search-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.clear-search-btn:active {
    transform: scale(0.95);
}

.month-picker {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    flex-shrink: 0;
}

.month-picker:hover {
    border-color: #667eea;
}

.month-picker:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 480px) {
    .search-container {
        padding: 8px;
        margin-bottom: 10px;
        gap: 6px;
    }
    
    .search-input {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .clear-search-btn {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }
    
    .month-picker {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .search-container {
        padding: 6px;
        margin-bottom: 8px;
        gap: 4px;
    }
    
    .search-input {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .clear-search-btn {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }
    
    .month-picker {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

@media (max-width: 480px) {
    .calendar-weekdays {
        gap: 3px;
        margin-bottom: 8px;
    }
}

@media (max-width: 360px) {
    .calendar-weekdays {
        gap: 2px;
        margin-bottom: 6px;
    }
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: #333;
    padding: 10px;
    font-size: 1rem;
}

@media (max-width: 480px) {
    .weekday {
        font-size: 0.7rem;
        padding: 5px 1px;
    }
}

@media (max-width: 360px) {
    .weekday {
        font-size: 0.65rem;
        padding: 4px 1px;
    }
}

.weekday:nth-child(1) {
    color: #e74c3c;
}

.weekday:nth-child(7) {
    color: #3498db;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}
body.calendar-page .calendar-days {
    gap: 0;
    min-height: 0;
}
body.calendar-page .calendar-days > * {
    min-height: 0;
}
body.calendar-page .calendar-weekdays {
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #e2e8f0;
}
html.dark body.calendar-page .calendar-weekdays {
    border-bottom-color: #475569;
}

@media (max-width: 480px) {
    .calendar-days {
        gap: 3px;
    }
}

@media (max-width: 360px) {
    .calendar-days {
        gap: 2px;
    }
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    background: #f8f9fa;
    border: 2px solid transparent;
    position: relative;
    padding: 5px;
    min-height: 0;
    overflow: hidden;
}

/* stitch_design 동일: 캘린더 셀 테두리/패딩, 셀 영역 정확히 유지 */
body.calendar-page .calendar-day {
    border-radius: 0;
    border: none;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: transparent;
    padding: 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
    transform: none;
    aspect-ratio: auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
html.dark body.calendar-page .calendar-day {
    border-right-color: #1e293b;
    border-bottom-color: #1e293b;
}
/* 해당월 날짜: 다크 테마에서 흰색으로 눈에 띄게 */
html.dark body.calendar-page .calendar-day:not(.other-month) {
    color: #f1f5f9;
}
body.calendar-page .calendar-day.other-month {
    color: #94a3b8;
    opacity: 0.4;
}
html.dark body.calendar-page .calendar-day.other-month {
    color: #64748b;
    opacity: 0.5;
}
body.calendar-page .calendar-day.today {
    background: rgba(43, 140, 238, 0.05);
}
body.calendar-page .calendar-day.today .day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    border-radius: 9999px;
    background: #2b8cee;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}
body.calendar-page .calendar-day.today {
    box-shadow: none;
}
/* 호버: 셀 안에서만 표시, transform 없음 */
body.calendar-page .calendar-day:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: none !important;
    box-shadow: none;
}
html.dark body.calendar-page .calendar-day:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: none !important;
    box-shadow: none;
}
body.calendar-page .calendar-day.today:hover {
    transform: none !important;
}
body.calendar-page .calendar-day .day-number {
    display: block;
    line-height: 1;
}
body.calendar-page .calendar-day.sunday:not(.today) {
    color: #e11d48;
}
body.calendar-page .calendar-day.saturday:not(.today) {
    color: #2563eb;
}
html.dark body.calendar-page .calendar-day.sunday:not(.today) {
    color: #f87171;
}
html.dark body.calendar-page .calendar-day.saturday:not(.today) {
    color: #60a5fa;
}

@media (max-width: 480px) {
    .calendar-day {
        padding: 2px 1px;
        border-radius: 5px;
        font-size: 0.75rem;
        min-height: 0;
    }
}

@media (max-width: 360px) {
    .calendar-day {
        padding: 1px;
        border-radius: 4px;
        font-size: 0.7rem;
    }
}

.calendar-day .day-number {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
    text-align: center;
}

@media (max-width: 480px) {
    .calendar-day .day-number {
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

@media (max-width: 360px) {
    .calendar-day .day-number {
        font-size: 0.7rem;
    }
}

.calendar-day .holiday-text {
    font-size: 0.65rem;
    font-weight: 500;
    color: #e74c3c;
    text-align: center;
    line-height: 1.1;
    margin-top: 1px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex: 0 0 auto;
    width: 100%;
}

@media (max-width: 480px) {
    .calendar-day .holiday-text {
        font-size: 0.4rem;
        margin-top: 0;
        line-height: 1;
        padding: 0 1px;
    }
}

@media (max-width: 360px) {
    .calendar-day .holiday-text {
        font-size: 0.35rem;
    }
}

.calendar-day:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .calendar-day {
        -webkit-tap-highlight-color: transparent;
    }
    
    .calendar-day:hover {
        transform: none;
    }
    
    .calendar-day:active {
        background: #e9ecef;
        transform: scale(0.95);
    }
}

.calendar-day.other-month {
    color: #bbb;
    background: #f5f5f5;
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.calendar-day.today:hover {
    transform: translateY(-2px) scale(1.05);
}

@media (max-width: 480px) {
    .calendar-day.today:hover {
        transform: scale(1.02);
    }
    
    .calendar-day.today:active {
        transform: scale(0.98);
    }
}

.calendar-day.sunday {
    color: #e74c3c;
}

.calendar-day.sunday.other-month {
    color: #f5b7b1;
}

.calendar-day.saturday {
    color: #3498db;
}

.calendar-day.saturday.other-month {
    color: #aed6f1;
}

.calendar-day.today.sunday,
.calendar-day.today.saturday {
    color: white;
}

.calendar-day.today .holiday-text {
    color: rgba(255, 255, 255, 0.95);
}

/* 오늘 날짜의 일정 바 스타일 조정 */
.calendar-day.today .event-bar {
    background-color: rgba(255, 255, 255, 0.9);
    color: #5568d3;
    border-left-color: #5568d3;
}

.calendar-day.today .event-bar:hover {
    background-color: rgba(255, 255, 255, 1);
}

.calendar-day.today .event-bar-more {
    background-color: rgba(255, 255, 255, 0.8);
    color: #666;
    border-left-color: #999;
}

/* 검색 결과로 일치하는 날짜 강조 */
.calendar-day.search-matched {
    border: 2px solid #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}

.calendar-day.today.search-matched {
    border: 2px solid #ffc107;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}

/* 검색어 강조 표시 (mark 태그) */
.calendar-day .event-bar mark {
    background-color: #ffeb3b;
    color: #333;
    padding: 0;
    font-weight: 700;
}

.calendar-day.other-month .holiday-text {
    color: #f5b7b1;
}

/* 반응형 디자인 - 태블릿 */
@media (max-width: 768px) and (min-width: 481px) {
    .calendar-container {
        padding: 20px;
    }
    
    .calendar-header h1 {
        font-size: 1.5rem;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .today-btn {
        padding: 6px 16px;
        font-size: 0.8rem;
    }
    
    .weekday {
        font-size: 0.9rem;
        padding: 8px;
    }
    
    .calendar-day {
        font-size: 0.9rem;
    }
    
    .calendar-day .holiday-text {
        font-size: 0.55rem;
    }
    
    .calendar-weekdays,
    .calendar-days {
        gap: 5px;
    }
}

/* --- [일정 표시 스타일 추가] --- */

/* 일정 바들 컨테이너 */
.calendar-day .event-bars-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* 일정 바 스타일 (구글 캘린더 스타일) */
.calendar-day .event-bar {
    background-color: #e3e8ff; /* 연한 파란색 배경 */
    color: #5568d3; /* 진한 파란색 글씨 */
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    border-left: 3px solid #5568d3; /* 왼쪽에 강조 선 */
    width: 100%;
    
    /* 긴 제목 말줄임표 처리 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-day .event-bar:hover {
    background-color: #d0d8ff;
}

/* 더보기 바 스타일 */
.calendar-day .event-bar-more {
    background-color: #f0f0f0;
    color: #666;
    border-left-color: #999;
    font-weight: 600;
}

@media (max-width: 480px) {
    .calendar-day .event-bar {
        font-size: 0.6rem; /* 글자 크기 축소 */
        padding: 1px 2px;
        border-left-width: 2px;
    }
}

@media (max-width: 360px) {
    .calendar-day .event-bar {
        font-size: 0.55rem;
        padding: 1px 2px;
    }
}
/* ------------------------------- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    margin: 40px auto;
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 550px;
    position: relative;
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.close-btn {
    color: rgba(255, 255, 255, 0.9);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.close-btn:hover,
.close-btn:focus {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.event-list-section,
.event-form-section {
    padding: 25px;
}

.event-list-section {
    border-bottom: 2px solid #e9ecef;
    background: #fafbfc;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.section-icon {
    font-size: 1.3rem;
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

#eventListContainer {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

#eventList li {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#eventList li:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(3px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

#eventList li span {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

#eventList li .delete-list-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
}

#eventList li .delete-list-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

#eventList li[style*="cursor: default"] {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 20px;
}

#eventList li[style*="cursor: default"]:hover {
    background: transparent;
    border: none;
    transform: none;
    box-shadow: none;
}

.event-form-section {
    background: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #495057;
}

/* ----- 캘린더 페이지: 일정 모달 메인과 통일 (primary, slate, Manrope) ----- */
.event-modal .modal-content {
    background: #ffffff;
    border-radius: 1rem;
}
html.dark .event-modal .modal-content {
    background: #1e293b;
}
.event-modal .modal-header {
    background: #2b8cee;
    border-bottom-color: rgba(255,255,255,0.15);
}
.event-modal .modal-header h2 {
    font-family: 'Manrope', 'Malgun Gothic', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.event-modal .event-list-section {
    border-bottom-color: #e2e8f0;
    background: #f8fafc;
}
html.dark .event-modal .event-list-section {
    border-bottom-color: #334155;
    background: rgba(30, 41, 59, 0.5);
}
.event-modal .section-header h3,
.event-modal .form-label {
    color: #334155;
    font-family: 'Manrope', 'Malgun Gothic', sans-serif;
}
html.dark .event-modal .section-header h3,
html.dark .event-modal .form-label {
    color: #e2e8f0;
}
.event-modal #eventList li {
    background: #fff;
    border-color: #e2e8f0;
    border-radius: 0.5rem;
}
.event-modal #eventList li:hover {
    border-color: #2b8cee;
    box-shadow: 0 4px 12px rgba(43, 140, 238, 0.15);
}
html.dark .event-modal #eventList li {
    background: #334155;
    border-color: #475569;
}
html.dark .event-modal #eventList li span {
    color: #f1f5f9;
}
.event-modal .event-form-section {
    background: #fff;
}
html.dark .event-modal .event-form-section {
    background: transparent;
}
.event-modal .btn-primary {
    background: #2b8cee;
}
.event-modal .btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(43, 140, 238, 0.3);
}
.event-modal #eventList li[style*="cursor: default"] {
    color: #64748b;
}
html.dark .event-modal #eventList li[style*="cursor: default"] {
    color: #94a3b8;
}

.event-modal .form-input,
.event-modal .form-textarea,
.event-modal .date-input,
.event-modal .time-select {
    border-color: #e2e8f0;
    background: #fff;
    font-family: 'Manrope', 'Malgun Gothic', sans-serif;
}
.event-modal .form-input:focus,
.event-modal .form-textarea:focus,
.event-modal .time-select:focus {
    border-color: #2b8cee;
    box-shadow: 0 0 0 3px rgba(43, 140, 238, 0.15);
}
html.dark .event-modal .form-input,
html.dark .event-modal .form-textarea,
html.dark .event-modal .date-input,
html.dark .event-modal .time-select {
    border-color: #475569;
    background: #334155;
}
html.dark .event-modal .form-input:focus,
html.dark .event-modal .form-textarea:focus,
html.dark .event-modal .time-select:focus {
    border-color: #2b8cee;
    box-shadow: 0 0 0 3px rgba(43, 140, 238, 0.25);
}
.event-modal .time-selector {
    background: #f8fafc;
    border-color: #e2e8f0;
}
html.dark .event-modal .time-selector {
    background: #334155;
    border-color: #475569;
}
.event-modal .time-separator {
    color: #2b8cee;
}
.event-modal .form-actions {
    border-top-color: #e2e8f0;
}
html.dark .event-modal .form-actions {
    border-top-color: #475569;
}
.event-modal .btn-secondary {
    border-color: #cbd5e1;
    color: #475569;
}
.event-modal .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
#eventList {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 시간 선택 팝업 (calendar 모달) */
.time-picker-scrollbar::-webkit-scrollbar { width: 10px; }
.time-picker-scrollbar::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 0 0.75rem 0.75rem 0; }
html.dark .time-picker-scrollbar::-webkit-scrollbar-track { background: rgba(30, 41, 59, 0.5); }
.time-picker-scrollbar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; border: 4px solid transparent; background-clip: padding-box; }
html.dark .time-picker-scrollbar::-webkit-scrollbar-thumb { background: #475569; }
.event-modal .time-display-btn { font-family: 'Manrope', 'Malgun Gothic', sans-serif; }
.event-modal .time-row-cell.hidden { display: none !important; }
.event-modal .time-slot-btn { width: 100%; text-align: left; padding: 0.5rem 1rem; font-size: 0.875rem; color: #475569; background: transparent; border: none; cursor: pointer; transition: background 0.15s; border-radius: 0.5rem; }
.event-modal .time-slot-btn:hover { background: #f1f5f9; }
html.dark .event-modal .time-slot-btn { color: #94a3b8; }
html.dark .event-modal .time-slot-btn:hover { background: #334155; }
.event-modal .time-slot-btn.selected { font-weight: 700; color: #fff; background: rgba(43, 140, 238, 0.2); border: 1px solid rgba(43, 140, 238, 0.3); margin: 0 4px; width: calc(100% - 8px); }

.label-icon {
    font-size: 1.1rem;
}

.required {
    color: #e74c3c;
    font-size: 0.9rem;
}

.optional {
    color: #6c757d;
    font-weight: 400;
    font-size: 0.85rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
    background: #fafbfc;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

html.dark .form-input:focus,
html.dark .form-textarea:focus {
    background: #334155;
    color: #f1f5f9;
    border-color: #2b8cee;
    box-shadow: 0 0 0 3px rgba(43, 140, 238, 0.25);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.time-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.time-select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.time-select:hover {
    border-color: #667eea;
    background: #fafbfc;
}

.time-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.time-separator {
    font-size: 1.3rem;
    font-weight: 600;
    color: #667eea;
    margin: 0 4px;
}

@media (max-width: 480px) {
    .time-selector {
        gap: 5px;
    }
    
    .time-select {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .time-separator {
        font-size: 1rem;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f1f3f5;
    color: #495057;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 20px auto;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .event-list-section,
    .event-form-section {
        padding: 20px;
    }
    
    .section-header h3 {
        font-size: 1rem;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-input,
    .form-textarea,
    .date-input,
    .time-select {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        padding: 12px;
    }
    
    .date-range-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .date-separator {
        transform: rotate(90deg);
    }
}
/* --- [추가] 캘린더 푸터 스타일 --- */
.calendar-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
    opacity: 0.8;
}

.calendar-footer:hover {
    opacity: 1;
    transition: opacity 0.3s;
}
/* --------------------------------- */

/* --- [추가] 주간 보기 스타일 (stitch 디자인: 시간 그리드) --- */
/* 주간 보기 래퍼: display는 Tailwind .hidden / .flex 로 제어 (월간보기에서 숨김 유지) */
#weekViewWrapper {
    min-height: 0;
}

.weekly-grid {
    display: grid;
    grid-template-columns: 64px repeat(7, 1fr);
    min-width: 0;
}

.week-view-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 0.75rem 0.75rem 0 0;
}

html.dark .week-view-header {
    background: #1e293b;
    border-color: #334155;
    border-bottom: none;
}

/* 첫 줄 첫 칸: 종일 행용 빈 공간 */
.week-view-header-corner {
    height: 48px;
    min-width: 64px;
}

.week-view-header-cell {
    height: 48px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* 요일+날짜 한 줄 표시 "요일날짜" */
.week-view-day-name {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #94a3b8;
}

.week-view-day-name.sunday {
    color: #ef4444;
}

.week-view-day-name.saturday {
    color: #3b82f6;
}

.week-view-day-num {
    font-size: 0.875rem;
    font-weight: 800;
    color: #334155;
}

html.dark .week-view-day-num {
    color: #cbd5e1;
}

/* 오늘 날짜 파란 동그라미 (월간달력과 동일하게 11 등 숫자에 표시) */
.week-view-header-cell.today .week-view-day-num {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.5rem !important;
    min-width: 1.5rem !important;
    height: 1.5rem !important;
    min-height: 1.5rem !important;
    padding: 0;
    border-radius: 9999px !important;
    background: #2b8cee !important;
    color: white !important;
    font-size: 0.75rem;
    font-weight: 700;
}

html.dark .week-view-header-cell.today .week-view-day-num {
    background: #2b8cee !important;
    color: white !important;
}

.week-view-header-cell.today .week-view-day-name.sunday,
.week-view-header-cell.today .week-view-day-name.saturday {
    color: inherit;
}

.week-view-body {
    background: #fff;
    border-radius: 0 0 0.75rem 0.75rem;
    overflow-y: auto;
    min-height: 0;
}

html.dark .week-view-body {
    background: rgba(15, 23, 42, 0.5);
}

.week-view-grid {
    position: relative;
    background: #fff;
    min-height: min-content;
}

html.dark .week-view-grid {
    background: rgba(15, 23, 42, 0.5);
}

/* 시간대 열: 첫 칸 종일용 빈칸 + 0~23시 라벨 */
.week-view-time-col {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.week-view-time-col .week-view-time-slot {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 8px;
    padding-top: 2px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
}

html.dark .week-view-time-col .week-view-time-slot {
    color: #64748b;
}

.week-view-time-slot-all-day {
    min-height: 20px;
    padding-right: 0;
    /* 첫 번째 칸: 종일 일정용 빈칸 (높이는 스크립트에서 동적) */
}

.week-view-slot-all-day {
    min-height: 20px;
    /* 높이는 스크립트에서 동적 */
}

/* 가로·세로 격자선 (월간 보기와 동일한 느낌) */
.week-view-time-slot {
    height: 60px;
    min-height: 60px;
    box-sizing: border-box;
    border-bottom: 1px solid #e2e8f0;
}

html.dark .week-view-time-slot {
    border-bottom-color: #1e293b;
}

.week-view-time-slot-all-day {
    border-bottom: 1px solid #e2e8f0;
}

html.dark .week-view-time-slot-all-day {
    border-bottom-color: #1e293b;
}

.week-view-slot-all-day {
    border-bottom: 1px solid #e2e8f0;
}

html.dark .week-view-slot-all-day {
    border-bottom-color: #1e293b;
}

.week-view-day-col {
    position: relative;
    min-width: 0;
    border-right: 1px solid #e2e8f0;
}

.week-view-day-col:last-child {
    border-right: none;
}

html.dark .week-view-day-col {
    border-right-color: #1e293b;
}

.week-view-day-col.sunday,
.week-view-day-col.saturday {
    /* 요일 색은 헤더에서만, 격자선은 유지 */
}

/* 현재 시간 수평선 (주간 보기) */
.week-view-now-line {
    position: absolute;
    left: 64px;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 15;
    pointer-events: none;
}

html.dark .week-view-now-line {
    background: #f87171;
}

body.calendar-page .calendar-cell {
    position: relative;
    min-width: 0;
}

.event-block,
.week-view-event-block {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 0.375rem;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

.event-block:hover,
.week-view-event-block:hover {
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.week-view-event-block.all-day:hover {
    transform: translateY(-1px);
}

.event-block.all-day,
.week-view-event-block.all-day {
    font-size: 10px;
    padding: 4px 8px;
}

/* 기존 주간 보기(일 컬럼 리스트)는 제거했으나 호환용 클래스 유지 */
.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    min-height: 600px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.week-day {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    min-width: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.week-day:hover {
    background: #fafbfc;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.week-day.today {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: #667eea;
    border-width: 3px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.week-day.sunday {
    border-left: 5px solid #e74c3c;
    background: #fffafa;
}

.week-day.sunday.today {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08) 0%, rgba(102, 126, 234, 0.08) 100%);
}

.week-day.saturday {
    border-left: 5px solid #3498db;
    background: #f8fbff;
}

.week-day.saturday.today {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(102, 126, 234, 0.08) 100%);
}

.week-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    flex-shrink: 0;
    min-width: 0;
    gap: 6px;
}

.week-day-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.week-day.today .week-day-number {
    color: #667eea;
    font-size: 1.5rem;
}

.week-day.sunday .week-day-number {
    color: #e74c3c;
}

.week-day.saturday .week-day-number {
    color: #3498db;
}

.week-holiday-text {
    font-size: 0.75rem;
    color: #e74c3c;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    padding: 2px 6px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
}

.week-events-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: calc(600px - 70px);
    padding-right: 4px;
    margin-top: 4px;
}

.week-events-container::-webkit-scrollbar {
    width: 6px;
}

.week-events-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.week-events-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.week-events-container::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.week-event-item {
    background: linear-gradient(135deg, #e3e8ff 0%, #f0f4ff 100%);
    color: #5568d3;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #5568d3;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    line-height: 1.5;
    flex-shrink: 0;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(85, 104, 211, 0.2);
}

.week-event-item:hover {
    background: linear-gradient(135deg, #d0d8ff 0%, #e3e8ff 100%);
    transform: translateX(4px) scale(1.02);
    white-space: normal;
    overflow: visible;
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 12px rgba(85, 104, 211, 0.3);
    border-left-width: 5px;
}

.week-event-item.all-day {
    background: linear-gradient(135deg, #5568d3 0%, #764ba2 100%);
    color: white;
    border-left: none;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 6px rgba(85, 104, 211, 0.4);
}

.week-event-item.all-day:hover {
    background: linear-gradient(135deg, #485ac0 0%, #6a3d8f 100%);
    white-space: normal;
    overflow: visible;
    box-shadow: 0 4px 16px rgba(85, 104, 211, 0.5);
}

.view-mode-group {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 2px;
}

.view-mode-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: #666;
}

.view-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.view-mode-btn:hover:not(.active) {
    background: #e0e0e0;
    color: #333;
}

@media (max-width: 768px) {
    .calendar-week {
        gap: 8px;
        min-height: 450px;
        margin-top: 8px;
    }
    
    .week-day {
        min-height: 450px;
        padding: 10px;
        border-radius: 10px;
    }
    
    .week-day-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom-width: 2px;
    }
    
    .week-day-number {
        font-size: 1.2rem;
    }
    
    .week-day.today .week-day-number {
        font-size: 1.3rem;
    }
    
    .week-holiday-text {
        font-size: 0.7rem;
        padding: 2px 5px;
    }
    
    .week-event-item {
        font-size: 0.8rem;
        padding: 8px 10px;
        border-left-width: 3px;
    }
    
    .week-events-container {
        max-height: calc(450px - 60px);
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .calendar-week {
        gap: 6px;
        min-height: 400px;
        margin-top: 6px;
    }
    
    .week-day {
        min-height: 400px;
        padding: 8px;
        border-radius: 10px;
        border-width: 2px;
    }
    
    .week-day.sunday,
    .week-day.saturday {
        border-left-width: 4px;
    }
    
    .week-day-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
        gap: 4px;
        border-bottom-width: 1px;
    }
    
    .week-day-number {
        font-size: 1.1rem;
    }
    
    .week-day.today .week-day-number {
        font-size: 1.2rem;
    }
    
    .week-holiday-text {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    
    .week-event-item {
        font-size: 0.75rem;
        padding: 6px 8px;
        border-left-width: 3px;
        line-height: 1.4;
    }
    
    .week-event-item.all-day {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .week-events-container {
        max-height: calc(400px - 55px);
        gap: 4px;
        padding-right: 3px;
    }
    
    .week-events-container::-webkit-scrollbar {
        width: 4px;
    }
    
    .view-mode-group {
        gap: 3px;
        padding: 1px;
    }
    
    .view-mode-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 360px) {
    .calendar-week {
        gap: 4px;
        min-height: 350px;
    }
    
    .week-day {
        min-height: 350px;
        padding: 6px;
    }
    
    .week-day-number {
        font-size: 1rem;
    }
    
    .week-day.today .week-day-number {
        font-size: 1.1rem;
    }
    
    .week-event-item {
        font-size: 0.7rem;
        padding: 5px 6px;
    }
    
    .week-events-container {
        max-height: calc(350px - 50px);
        gap: 3px;
    }
}
/* --------------------------------- */

/* 로그인/회원가입 스타일 */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 10px;
}

.user-info {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 인증 모달 스타일 */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.auth-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-modal-header .close-btn {
    color: white;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
}

.auth-modal-header .close-btn:hover {
    transform: rotate(90deg);
}

.auth-form {
    padding: 30px;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

.auth-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #fafbfc;
}

.auth-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-left: 4px solid #c33;
}

.auth-success {
    background: #efe;
    color: #3c3;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-left: 4px solid #3c3;
}

.auth-form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-switch-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-switch-btn:hover {
    background: #667eea;
    color: white;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .auth-modal-header {
        padding: 20px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .auth-buttons {
        margin-right: 5px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .user-info {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}