/**
 * 유튜브 통합 스타일
 * 모든 유튜브 링크 형태에 대한 스타일 통합
 */

/* 유튜브 컨테이너 스타일 */
.youtube-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 비율 */
    margin: 20px 0;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 쇼츠 컨테이너 스타일 */
.shorts-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 0;
    padding-bottom: 177.78%; /* 9:16 비율 */
    margin: 20px 0;
}

.shorts-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* 유튜브 썸네일 스타일 */
.youtube-thumbnail {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 20px 0;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.youtube-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.youtube-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* 쇼츠 썸네일 스타일 */
.shorts-thumbnail {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 20px 0;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shorts-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.shorts-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 9/16;
    object-fit: cover;
}

/* 플레이 버튼 스타일 */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(0,0,0,0.8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.youtube-thumbnail:hover .play-button,
.shorts-thumbnail:hover .play-button {
    background: rgba(255,0,0,0.9);
}

.play-button-shape {
    fill: #fff;
}

.play-button-icon {
    fill: #000;
}

/* 유튜브 모달 스타일 */
#youtubeModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    margin: 5vh auto;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    padding-bottom: 56.25%; /* 16:9 비율 */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.close {
    position: absolute;
    right: 10px;
    top: 10px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close:hover {
    color: #fff;
    background: rgba(255,0,0,0.8);
    transform: scale(1.1);
}

/* 쇼츠 모달 스타일 */
#shortsModal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.shorts-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    height: 80vh;
    margin: 5vh auto;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.shorts-container {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 9/16;
}

.shorts-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.shorts-close {
    position: absolute;
    right: 10px;
    top: 10px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.shorts-close:hover {
    color: #fff;
    background: rgba(255,0,0,0.8);
    transform: scale(1.1);
}

/* 로딩 애니메이션 */
.modal-loading,
.shorts-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    font-size: 18px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .youtube-thumbnail,
    .shorts-thumbnail {
        max-width: 100%;
    }
    
    .play-button {
        width: 50px;
        height: 35px;
    }
    
    .play-button svg {
        width: 50px;
        height: 35px;
    }
    
    .modal-content {
        width: 95%;
        height: 70vh;
        margin: 15vh auto;
    }
    
    .shorts-modal-content {
        width: 95%;
        height: 70vh;
        margin: 15vh auto;
        max-width: 350px;
    }
    
    .close,
    .shorts-close {
        right: 8px;
        top: 8px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
} 