/* 폰트 정의 */
@font-face {
    font-family: 'DOSPilgiMedium';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2304-2@1.0/DOSPilgiMedium.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'MiraeroNormal';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/MiraeroNormal.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* 기본 스타일 리셋 및 전체 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    overflow: hidden;
    font-family: 'DOSPilgiMedium';
    color: white;
    font-size: 16px;
    background-color: skyblue;
    animation: fadeIn 1.5s;
}

/* 모든 링크 통일 스타일 */
a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

a:active, a:visited, a:focus {
    color: white;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; background-color: skyblue; }
    to { opacity: 1; background-color: skyblue; }
}

@keyframes fadeOut {
    from { opacity: 1; background-color: skyblue; }
    to { opacity: 0; background-color: skyblue; }
}

.fade-out {
    animation: fadeOut 1.5s;
    background-color: skyblue;
}

/* 제목 스타일 */
.title, .index-title {
    text-align: center;
    font-size: 55px;
    margin-bottom: 40px;
    font-family: 'DOSPilgiMedium';
}

.page-title {
    margin-top: 120px;
    font-family: 'DOSPilgiMedium';
}

.title.page-title,
.title.playlist-page-title {
    margin-top: 5vh;
    margin-bottom: 6vh;
    font-size: 3rem;
}

/* 특수 텍스트 효과 */
.rainbow-text {
    text-shadow: none;
    background-image: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
    font-weight: bold;
}

.trans-text {
    text-shadow: none;
    background-image: linear-gradient(to right, #5BCEFA, #F5A9B8, #FFFFFF, #F5A9B8, #5BCEFA);
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
    font-weight: bold;
}

/* 인덱스 페이지 */
.index-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.language-options {
    font-size: 1.5em;
    font-family: 'DOSPilgiMedium';
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.language-option {
    font-size: 30px;
    margin: 10px;
}

.extra-options {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.extra-options .language-option {
    display: inline-block;
    margin: 10px;
}

/* 상단 언어 메뉴 */
.lang-menu {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    font-size: 1.3rem;
    font-family: 'DOSPilgiMedium';
}

/* 콘텐츠 래퍼 */
.content-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 800px;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content {
    text-shadow: 0px 0px 5px black;
    width: 100%;
    text-align: justify;
    line-height: 1.5;
    font-size: 1.3rem;
    font-family: 'MiraeroNormal';
    overflow-y: auto;
    max-height: calc(100% - 10vh);
}

.link-content {
    width: 100%;
    text-align: center;
    line-height: 1.5;
    font-size: 2.5rem;
    font-family: 'DOSPilgiMedium';
}

/* 플레이리스트 */
.playlist-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
    height: 60vh;
}

.playlist-buttons {
    display: flex;
    flex-direction: column;
    width: 30%;
    height: 100%;
    overflow-y: auto;
}

.playlist-content {
    width: 65%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 5px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#player {
    width: 100%;
    height: 50%;
    margin-bottom: 20px;
    background: transparent;
}

#playlist-display {
    flex-grow: 1;
    overflow-y: auto;
}

#playlist-display ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#playlist-display li {
    margin-bottom: 10px;
    padding: 5px 0;
}

#playlist-display a {
    font-family: 'MiraeroNormal';
    display: block;
}

#playlist-display a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.playlist-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px;
    margin: 5px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    text-decoration: none;
    font-family: 'sans-serif';
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 플레이어 컨트롤 */
.player-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.player-controls button {
    margin: 0 10px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'MiraeroNormal';
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.player-controls button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* YouTube 플레이어 숨김 요소 */
.ytp-chrome-top, .ytp-chrome-bottom,
.ytp-cued-thumbnail-overlay,
.ytp-large-play-button {
    display: none;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .content-wrapper {
        width: 90%;
    }
    
    .content {
        font-size: 1rem;
    }

    .index-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .index-content .language-options,
    .extra-options {
        flex-direction: column;
        align-items: center;
    }

    .index-content .language-option,
    .extra-options .language-option {
        margin: 10px 0;
    }

    .title.playlist-page-title {
        margin-top: 5vh;
        margin-bottom: 0;
    }
    
    .playlist-container {
        flex-direction: column;
        height: 60vh;
    }
    
    .playlist-buttons {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 0;
        margin-top: 2vh;
        margin-bottom: 20px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .playlist-button {
        flex: 0 0 auto;
        width: auto;
        min-width: min-content;
        height: auto;
        padding: 8px 16px;
        margin: 0;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2em;
        border-radius: 4px;
    }

    .playlist-content {
        width: 100%;
        height: calc(100% - 50px);
    }

    #player {
        height: 45%;
    }

    #playlist-display {
        height: 45%;
        overflow-y: auto;
    }
}