/* 새로운 달력 스타일 (벤치마킹 사이트 100% 동일) */

/* 달력 섹션 전체 */
.server-calendar-section {
    margin-bottom: 30px;
    border: none;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

/* 달력 헤더 */
.calendar-header {
    background: #ffffff;
    color: #333;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-bottom: none;
}

.calendar-header h2 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    text-shadow: none;
}

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

.calendar-nav-btn {
    background: #ffffff;
    border: 2px solid #333;
    color: #333;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.calendar-nav-btn:hover {
    background: #f0f0f0;
    border-color: #333;
    transform: scale(1.1);
}

#current-month {
    font-size: 22px;
    font-weight: bold;
    min-width: 150px;
    text-align: center;
    color: #333;
}

/* 달력 컨테이너 */
.calendar-container {
    background-color: #ffffff;
    margin: 0;
    padding: 0;
}

/* 요일 헤더 */
.calendar-weekdays,
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background-color: #ffffff;
    padding: 0;
}

.weekday {
    background: #ffffff;
    color: #333;
    text-align: center;
    padding: 12px 0;
    font-weight: bold;
    font-size: 14px;
}

.weekday:first-child {
    color: #ffcdd2; /* 일요일 빨간색 */
}

.weekday:last-child {
    color: #bbdefb; /* 토요일 파란색 */
}

/* 달력 그리드 - 2주 타임라인 형태 (한 행에 7일씩) */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background-color: #ffffff;
    padding: 0;
}

/* 달력 중간 배너 */
.calendar-middle-banner {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0; /* 배너 간 공백 제거 */
    padding: 0;
    overflow: hidden;
    border-radius: 0;
}

.calendar-middle-banner img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
}

.calendar-middle-banner img:hover {
    transform: scale(1.02);
}

/* 달력 주차별 배너 (첫째주, 둘째주) - 2x2 그리드 */
.calendar-week-banner {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 1100px;
    margin: 5px 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.calendar-week-banner:empty {
    display: none;
}

.week-banner-link {
    display: block;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.week-banner-link:hover {
    transform: scale(1.02);
}

.week-banner-img {
    width: 100% !important;
    height: 80px !important;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.week-banner-link:hover .week-banner-img,
.week-banner-img:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

/* 배너 1개일 때 전체 너비 */
.calendar-week-banner > :only-child {
    grid-column: span 2;
}

.calendar-week-banner > :only-child .week-banner-img {
    height: 100px !important;
}

/* 배너 3개일 때 마지막 중앙 */
.calendar-week-banner > :nth-child(3):last-child {
    grid-column: span 2;
    max-width: 50%;
    justify-self: center;
}

/* 모바일에서 주차별 배너 스타일 */
@media (max-width: 768px) {
    .calendar-week-banner {
        margin: 8px 0;
        border-radius: 0;
    }

    .week-banner-img {
        border-radius: 0;
    }
}

.calendar-day {
    background-color: #ffffff;
    min-height: 300px;
    padding: 10px;
    position: relative;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    border: none;
    box-shadow: none;
}

/* 날짜 셀 hover 효과 제거 */
.calendar-day:hover {
    background-color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
}

.calendar-day.has-event:hover {
    background-color: #ffffff !important;
}

.calendar-day.today:hover {
    background: linear-gradient(135deg, #fff3cd, #fffbea) !important;
    border: none !important;
    box-shadow: none !important;
}

.calendar-day.other-month {
    opacity: 0.3;
    background-color: #f9f9f9;
}

.calendar-day.other-month .day-number {
    color: #999;
}

.calendar-day.today {
    background: linear-gradient(135deg, #fff3cd, #fffbea);
    border: none;
    box-shadow: none;
}

.day-number {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: none;
    text-align: center;
}

.calendar-day.today .day-number {
    color: #856404;
    border-bottom: none;
}

/* 이벤트 박스 */
.event-box {
    background: #ffffff;
    color: #333;
    padding: 4px 6px;
    margin-bottom: 2px;
    margin-top: 0;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 32px;
    overflow: hidden;
}

.event-box:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.event-emoji {
    font-size: 12px;
    margin-right: 4px;
}

.event-title-row {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-title {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

/* 버전 표시 스타일 */
.event-version {
    font-weight: 900 !important;
    margin-right: 4px;
}

.event-version.new {
    color: #ff0000 !important;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.8) !important;
}

.event-version.old {
    color: #0066ff !important;
    text-shadow: 0 0 5px rgba(0, 102, 255, 0.8) !important;
}

.event-desc {
    font-size: 9px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 16px;
}

/* 색상 클래스 */
.color-gold {
    background: linear-gradient(135deg, #f9d423, #e8b008);
    color: #333;
}

.color-purple {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
}

.color-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.color-yellow {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #333;
}

.color-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.color-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.color-black {
    background: linear-gradient(135deg, #1f2937, #111827);
}

.color-green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.color-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.color-pink {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

/* 태블릿 & 모바일 반응형 - 세로 리스트 형식 (벤치마킹 사이트 스타일) */
@media (max-width: 768px) {
    .server-calendar-section {
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
    }

    .calendar-header {
        padding: 15px;
        border-radius: 0;
    }

    .calendar-header h2 {
        font-size: 20px;
    }

    .calendar-nav {
        gap: 12px;
    }

    .calendar-nav-btn {
        padding: 8px 14px;
        font-size: 16px;
    }

    #current-month {
        font-size: 16px;
        min-width: 100px;
    }

    /* 모바일에서는 요일 헤더 숨김 */
    .calendar-weekdays {
        display: none;
    }

    /* 달력 내부 배너도 숨김 */
    .calendar-inner-banner {
        display: none;
    }

    /* 그리드 → 세로 리스트로 변경 */
    .calendar-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        background-color: #f5f5f5;
    }

    .calendar-day {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        min-height: auto;
        padding: 0;
        border-radius: 0;
        border-bottom: 1px solid #e0e0e0;
        background-color: #333;
        margin-bottom: 8px;
    }

    .calendar-day.other-month {
        display: none;
    }

    /* 날짜 번호 영역 */
    .day-number {
        min-width: 60px;
        padding: 12px;
        font-size: 18px;
        font-weight: bold;
        background: linear-gradient(135deg, #f0f0f0, #fafafa);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-right: 3px solid #e0e0e0;
        margin: 0;
    }

    .calendar-day.today .day-number {
        background: #ffffff;
        color: #333;
        border-right-color: #666666;
    }

    /* 이벤트 컨테이너 */
    .event-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 10px 12px;
        justify-content: center;
    }

    /* 이벤트 박스 - 벤치마킹 사이트 스타일 */
    .event-box {
        font-size: 13px;
        padding: 3px 10px;
        margin-bottom: 0;
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        display: flex;
        flex-direction: column;
        gap: 1px;
        line-height: 1.1;
    }

    .event-emoji {
        font-size: 16px;
        margin-bottom: 0;
    }

    .event-title {
        font-weight: 700;
        font-size: 14px;
        margin-bottom: 0;
    }

    /* 모바일 버전 스타일 */
    .event-version {
        font-weight: 900 !important;
        font-size: 15px;
    }

    .event-version.new {
        color: #ff0000 !important;
        text-shadow: 0 0 6px rgba(255, 0, 0, 0.9) !important;
    }

    .event-version.old {
        color: #0066ff !important;
        text-shadow: 0 0 6px rgba(0, 102, 255, 0.9) !important;
    }

    .event-desc {
        font-size: 11px;
        opacity: 0.9;
        line-height: 1.3;
    }

    /* 이벤트 없는 날짜는 간략하게 */
    .calendar-day:not(.has-event) {
        min-height: 50px;
    }

    .calendar-day:not(.has-event) .day-number {
        opacity: 0.6;
    }

    /* 오늘 날짜 강조 */
    .calendar-day.today {
        border-left: 5px solid #666666;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }

    /* 이벤트 있는 날짜 */
    .calendar-day.has-event {
        border-left: 4px solid #4CAF50;
    }
}

/* 이벤트 효과 애니메이션 */
.event-box.effect-pulse {
    animation: eventPulse 1.5s infinite;
}

@keyframes eventPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.event-box.effect-glow {
    animation: eventGlow 1.5s infinite;
}

@keyframes eventGlow {
    0%, 100% { box-shadow: 0 0 5px currentColor; }
    50% { box-shadow: 0 0 15px currentColor; }
}

.event-box.effect-shake {
    animation: eventShake 0.5s infinite;
}

@keyframes eventShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.event-box.effect-bounce {
    animation: eventBounce 1s infinite;
}

@keyframes eventBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.event-box.effect-flash {
    animation: eventFlash 1s infinite;
}

@keyframes eventFlash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

/* 소형 모바일 추가 최적화 */
@media (max-width: 480px) {
    .calendar-header {
        padding: 12px;
        flex-direction: column;
        gap: 10px;
    }

    .calendar-header h2 {
        font-size: 18px;
    }

    .calendar-nav-btn {
        padding: 7px 12px;
        font-size: 14px;
    }

    #current-month {
        font-size: 15px;
        min-width: 90px;
    }

    .day-number {
        min-width: 50px;
        padding: 10px;
        font-size: 16px;
    }

    .event-box {
        font-size: 12px;
        padding: 2px 8px;
    }

    .event-emoji {
        font-size: 14px;
    }

    .event-title {
        font-size: 13px;
    }

    .event-desc {
        font-size: 10px;
    }

    .event-container {
        padding: 8px 10px;
        gap: 0;
    }
}

/* 초소형 모바일 */
@media (max-width: 360px) {
    .calendar-header h2 {
        font-size: 16px;
    }

    .day-number {
        min-width: 45px;
        padding: 8px;
        font-size: 15px;
    }

    .event-box {
        font-size: 11px;
        padding: 2px 6px;
    }

    .event-title {
        font-size: 12px;
    }

    .event-desc {
        font-size: 9px;
    }
}

/* 이벤트 상세 모달 */
.event-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.event-detail-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.event-detail-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.event-detail-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-detail-close:hover {
    color: #333;
}

.event-detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.event-detail-emoji {
    font-size: 48px;
}

.event-detail-title {
    font-size: 24px;
    margin: 0;
    color: #333;
    flex: 1;
}

.event-detail-body {
    font-size: 16px;
    line-height: 1.6;
}

.event-detail-date,
.event-detail-desc {
    margin-bottom: 20px;
}

.event-detail-date strong,
.event-detail-desc strong {
    display: block;
    margin-bottom: 8px;
    color: #666666;
    font-size: 14px;
}

.event-detail-date span {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

#detailDesc {
    margin: 0;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    color: #666;
    white-space: pre-wrap;
}

.event-detail-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.event-detail-link {
    display: inline-block;
    padding: 12px 24px;
    background: #ffffff;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.event-detail-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 모바일 반응형 - 이벤트 모달 */
@media (max-width: 768px) {
    .event-detail-content {
        padding: 20px;
        width: 95%;
    }

    .event-detail-emoji {
        font-size: 36px;
    }

    .event-detail-title {
        font-size: 20px;
    }

    .event-detail-date span {
        font-size: 16px;
    }
}