body {
    background-color: #f8f9fa;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'NanumBarunGothic', sans-serif;
    color: #333;
}

#mainMiddle {
    width: 76%;
    overflow-y: auto;
    padding: 20px 30px;
    justify-content: center;
    align-items: center;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f0f0f0;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

#mainMiddle::-webkit-scrollbar {
    width: 8px;
}

#mainMiddle::-webkit-scrollbar-track {
    background: #f0f0f0;
}

#mainMiddle::-webkit-scrollbar-thumb {
    background-color: #007bff;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
}

#leftSideBar,
#rightSideBar {
    width: 12%;
    overflow-y: auto;
    padding: 10px;
    background-color: #E8F1FF;
    scrollbar-width: thin;
    scrollbar-color: #007bff #E8F1FF;
    transition: all 0.3s ease;
}

#rightSideBar * {
    max-width: 100%;
    word-wrap: break-word;
    box-sizing: border-box;
}

#leftSideBar::-webkit-scrollbar,
#rightSideBar::-webkit-scrollbar {
    width: 6px;
}

#leftSideBar::-webkit-scrollbar-track,
#rightSideBar::-webkit-scrollbar-track {
    background: #E8F1FF;
}

#leftSideBar::-webkit-scrollbar-thumb,
#rightSideBar::-webkit-scrollbar-thumb {
    background-color: #007bff;
    border-radius: 10px;
}

h1 {
    color: #0056b3;
    font-size: 3.5rem;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
    border-bottom: 5px solid #E8F1FF;
}

h2 {
    font-size: 2.5rem;
    color: #0056b3;
}

#monthH2,
#rankingYearH2 {
    font-size: 2rem;
    text-align: center;
    margin: 0 20px;
    padding: 5px 15px;
    background-color: #E8F1FF;
    border-radius: 8px;
    color: #0056b3;
    transition: all 0.3s ease;
}

.calendar {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
    margin-bottom: 30px;
}

.calendar-day {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    justify-content: space-between;
    align-items: center;
    background-color: #0056b3;
    color: white;
    padding: 15px 0;
    border-radius: 10px 10px 0 0;
}

.calendar-day-header {
    font-size: 22px;
    font-weight: bold;
    padding: 10px 0;
    text-align: center;
    /* 요일 텍스트 중앙 정렬 */
}

.calendar-day-header:nth-child(1) {
    color: #ff8888;
}

.calendar-day-header:nth-child(7) {
    color: #8fbbff;
}

.calendar-day-content {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: white;
    padding: 10px;
    gap: 5px;
    border-radius: 0 0 10px 10px;
}

.calendar-day-content-item {
    font-size: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    margin-top: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-height: 120px;
}

.calendar-day-content-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 일요일 */
.calendar-day-content-item:nth-child(1),
.calendar-day-content-item:nth-child(8),
.calendar-day-content-item:nth-child(15),
.calendar-day-content-item:nth-child(22),
.calendar-day-content-item:nth-child(29),
.calendar-day-content-item:nth-child(36) {
    color: #e74c3c;
    font-weight: bold;
}

/* 토요일 */
.calendar-day-content-item:nth-child(7),
.calendar-day-content-item:nth-child(14),
.calendar-day-content-item:nth-child(21),
.calendar-day-content-item:nth-child(28),
.calendar-day-content-item:nth-child(35),
.calendar-day-content-item:nth-child(42) {
    color: #3498db;
    font-weight: bold;
}

.calendar-day-content-item.holiday {
    color: #e74c3c !important;
    font-weight: bold;
}

.calendar-day-content-item-game {
    font-size: 14px;
    margin: 5px 0;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 90%;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-day-content-item-game:hover {
    background-color: #0056b3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.calendar-day-content-item-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 8px;
}

/* 컨트롤 버튼 스타일 개선 */
#prevMonthBtn,
#nextMonthBtn,
#rankingPrevYearBtn,
#rankingNextYearBtn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.blueBtn {
    padding: 8px 15px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.blueBtn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 86, 179, 0.3);
}

.blueBtn:active {
    background-color: #004085;
    transform: scale(0.95) translateY(0);
    box-shadow: 0 2px 4px rgba(0, 64, 133, 0.3);
}

/* 게임 상세 정보 섹션 개선 */
#gameDetailDiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    background-color: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 100%;
    /* 오른쪽 사이드바 내부의 요소들이 최대 너비를 넘지 않도록 */
}

#gameTimeSpan {
    font-size: 20px;
    font-weight: bold;
    color: #0056b3;
    margin-top: 15px;
}

#gameTypeSpan {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

#gameTeamsDiv {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    align-items: center;
    text-align: center;
    gap: 15px;
    width: 100%;
    padding: 20px 0;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 15px;
}

#gameTeamsDiv img {
    justify-self: center;
}

.teamNameSpan {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    /* 팀 이름에 밑줄 제거 */
    color: #0056b3;
    transition: color 0.2s ease;
}

.teamNameSpan:hover {
    color: #003d82;
    text-decoration: none;
    /* 호버 상태에서도 밑줄 제거 */
}

.teamAmblem {
    width: 95px;
    height: 95px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.teamAmblem:hover {
    transform: scale(1.05);
}

#stadiumSpan {
    font-size: 20px;
    font-weight: bold;
    color: #666;
    padding: 5px 15px;
    background-color: #E8F1FF;
    border-radius: 8px;
}

.teamScoreSpan {
    font-size: 48px;
    font-weight: bold;
    color: #0056b3;
}

/* 순위 테이블 개선 */
#rankingDiv {
    margin-top: 60px;
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#rankingTable {
    display: grid;
    grid-template-columns: 0.5fr 2fr 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    margin-top: 20px;
    text-align: center;
    width: 100%;
    max-width: 900px;
    margin: 20px auto 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.rankingTableHeader {
    font-size: 18px;
    font-weight: bold;
    background-color: #0056b3;
    color: white;
    padding: 12px 8px;
}

.rankingTableData {
    font-size: 16px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.teamLink {
    text-decoration: none;
    color: black;
}

.teamLink:hover {
    text-decoration: none;
}

.rankingTableData:nth-child(7n+1),
.rankingTableData:nth-child(7n+2),
.rankingTableData:nth-child(7n+3),
.rankingTableData:nth-child(7n+4),
.rankingTableData:nth-child(7n+5),
.rankingTableData:nth-child(7n+6),
.rankingTableData:nth-child(7n+7) {
    background-color: #f8f9fa;
}

.first {
    font-weight: bold;
    color: #0056b3;
}

/* 팀 선택 버튼 개선 */
#calendarTeamSelectDiv {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.teamUnselectedBtn {
    font-size: 20px;
    padding: 8px 12px;
    border: 1px solid #007bff;
    background-color: white;
    color: #007bff;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 130px;
    max-width: 160px;
    font-family: 'NanumBarunGothic';
}

.teamUnselectedBtn:hover {
    background-color: #E8F1FF;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.teamSelectedBtn {
    font-size: 20px;
    padding: 8px 12px;
    background-color: #007bff;
    color: white;
    border: 1px solid #0056b3;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    flex: 1;
    min-width: 130px;
    max-width: 160px;
    box-shadow: 0 3px 6px rgba(0, 123, 255, 0.3);
    font-family: 'NanumBarunGothic';
}

.teamSelectedBtn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* 팀 관련 색상 버튼 개선 */
.팀BtnS {
    border-radius: 6px;
    padding: 8px 12px;
    margin: 3px 0;
    transition: all 0.3s ease;
    font-weight: bold;
}

.팀BtnS:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* 각 팀별 색상 스타일 유지 */
.롯데BtnS {
    background-color: #041E42;
    color: white;
    border: none;
    cursor: pointer;
}

.KIABtnS {
    background-color: #E10822;
    color: white;
    border: none;
    cursor: pointer;
}

.한화BtnS {
    background-color: #EA5C24;
    color: white;
    border: none;
    cursor: pointer;
}

.LGBtnS {
    background-color: #c30452;
    color: white;
    border: none;
    cursor: pointer;
}

.두산BtnS {
    background-color: #1A1748;
    color: white;
    border: none;
    cursor: pointer;
}

.KTBtnS {
    background-color: #000000;
    color: white;
    border: none;
    cursor: pointer;
}

.SSGBtnS {
    background-color: #CE0E2D;
    color: white;
    border: none;
    cursor: pointer;
}

.NCBtnS {
    background-color: #315288;
    color: white;
    border: none;
    cursor: pointer;
}

.삼성BtnS {
    background-color: #074CA1;
    color: white;
    border: none;
    cursor: pointer;
}

.키움BtnS {
    background-color: #570514;
    color: white;
    border: none;
    cursor: pointer;
}

/* 로그인 영역 개선 */
#loginBtnsDiv {
    position: fixed;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

#userInfoDiv {
    background-color: #E8F1FF;
    margin-top: 100px;
    padding: 8px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

#ifLoginSpan,
#loginEmailSpan {
    font-weight: bold;
    color: #0056b3;
}

/* 경기 상세 업데이트 폼 개선 */
#updateGameDiv {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 5px;
    width: 80%;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

#updateGameDiv input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

#updateGameDiv select {
    height: 35px;
}

#updateGameDiv span {
    align-self: center;
    font-weight: bold;
    color: #0056b3;
    font-size: 15px;
}

#updateGameConfirmBtn,
#updateGameCancelBtn {
    margin-top: 15px;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

#updateGameConfirmBtn {
    background-color: #007bff;
    color: white;
    border: none;
}

#updateGameCancelBtn {
    background-color: #e74c3c;
    color: white;
    border: none;
}

#fastPostingArea {
    resize: none;
    width: 90%;
    height: 300px;
    font-size: 20px;
    font-family: 'NanumBarunGothic', sans-serif;
}

#postsViewDiv {
    width: 90%;
    font-family: 'NanumBarunGothic', sans-serif;
    font-size: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    
}

.postView {
    background-color: white;
    border-radius: 20px;
    border: none;
    margin-top: 20px;
    padding: 5px;
}

/* 반응형 디자인 개선 */
@media screen and (max-width: 1200px) {
    #mainMiddle {
        width: 70%;
    }

    #leftSideBar,
    #rightSideBar {
        width: 15%;
    }

    .teamUnselectedBtn,
    .teamSelectedBtn {
        font-size: 14px;
        min-width: 110px;
    }
}

@media screen and (max-width: 992px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    #mainMiddle {
        width: 100%;
        order: 1;
        padding: 15px;
    }

    #leftSideBar,
    #rightSideBar {
        width: 100%;
        max-height: 600px;
        order: 2;
        padding: 15px;
        max-width: none;
        /* 모바일에서는 최대 너비 제한 해제 */
    }

    h1 {
        font-size: 2.5rem;
    }

    #monthH2,
    #rankingYearH2 {
        font-size: 1.8rem;
    }

    .calendar-day-header {
        font-size: 18px;
    }

    .calendar-day-content-item {
        font-size: 18px;
        min-height: 100px;
    }

    #gameTeamsDiv {
        gap: 10px;
    }

    .teamNameSpan {
        font-size: 20px;
    }

    .teamScoreSpan {
        font-size: 40px;
    }

    .teamAmblem {
        width: 100px;
        height: 100px;
    }
}

@media screen and (max-width: 768px) {
    #calendarTeamSelectDiv {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(2, auto);
        gap: 8px;
    }

    .teamUnselectedBtn,
    .teamSelectedBtn {
        font-size: 14px;
        min-width: auto;
        max-width: none;
        width: 100%;
    }

    h1 {
        font-size: 2rem;
    }

    .calendar-day-header {
        font-size: 16px;
    }

    .calendar-day-content-item {
        font-size: 16px;
        padding: 5px;
        margin-top: 10px;
        min-height: 80px;
    }

    .calendar-day-content-item-game {
        font-size: 12px;
        padding: 4px 6px;
    }

    #rankingTable {
        width: 100%;
        max-width: none;
    }

    .rankingTableHeader {
        font-size: 14px;
        padding: 8px 4px;
    }

    .rankingTableData {
        font-size: 14px;
        padding: 8px 4px;
    }

    #loginBtnsDiv,
    #userInfoDiv {
        position: static;
        display: flex;
        justify-content: center;
        margin: 10px 0;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    #calendarTeamSelectDiv {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, auto);
    }

    .calendar-day-content-item {
        font-size: 14px;
        min-height: 60px;
    }

    .blueBtn {
        font-size: 12px;
        padding: 6px 10px;
    }

    #gameTeamsDiv {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .teamNameSpan {
        font-size: 14px;
    }

    .teamScoreSpan {
        font-size: 28px;
    }

    #stadiumSpan {
        font-size: 14px;
    }

    .teamAmblem {
        width: 60px;
        height: 60px;
    }

    #updateGameDiv {
        grid-template-columns: 1fr;
    }
}