/* ============================================
   YOUTUBE SECTION
   ============================================ */

.youtube-section {
    padding: 80px 0;
    background-color: #ffffff;
    width: 100%;
}

.youtube-section .container {
    width: 80% !important;
    max-width: none !important;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Section */
.youtube-header {
    margin-bottom: 60px;
}

.youtube-header .section-headline {
    text-align: center;
    margin: 0 auto;
    max-width: 880px;
    padding: 0 24px;
}

.youtube-header .headline-eyebrow {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(233, 60, 26, 0.1);
    color: #e93c1a;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.youtube-header .headline-title {
    margin-top: 20px;
    margin-bottom: 24px;
    font-family: 'GmarketSans', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.4px;
    color: #222;
}

.youtube-header .headline-title .headline-accent {
    display: inline-block;
    color: #e93c1a;
    border-bottom: 6px solid #e93c1a;
    padding-bottom: 6px;
}

.youtube-header .headline-lead {
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.6;
    color: #404040;
}

.youtube-header .headline-desc {
    margin-bottom: 0;
    font-size: 18px;
    line-height: 1.7;
    color: #626262;
}

/* Video Grid */
.youtube-grid {
    width: 100%;
}

.video-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.thumbnail-placeholder {
    width: 100%;
    aspect-ratio: 330 / 200;
    background-color: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    overflow: hidden;
}

/* 유튜브 섹션 썸네일 이미지만 적용 */
.youtube-section .thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    filter: brightness(0.8);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: transparent;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.thumbnail-placeholder:hover .play-button {
    border-color: rgba(255, 255, 255, 0.8);
    color: rgba(255, 255, 255, 0.8);
}

.play-button i {
    margin-left: 3px;
}

.video-title {
    font-family: 'GmarketSans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    padding: 0 10px;
    word-break: keep-all;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Desktop - 4 columns */
@media (min-width: 1200px) {
    .youtube-section .container {
        width:75% !important;
        max-width: none !important;
    }
    
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .video-title {
        font-size: 15px;
    }
}

/* Tablet - 2 columns */
@media (min-width: 768px) and (max-width: 1199px) {
    .youtube-section .container {
        width: 90% !important;
        max-width: none !important;
        padding: 0 30px;
    }
    
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .video-title {
        font-size: 14px;
    }
}

/* Mobile - 2 columns */
@media (max-width: 767px) {
    .youtube-section {
        padding: 60px 0;
    }
    
    .youtube-section .container {
        width: 90% !important;
        max-width: none !important;
        padding: 0 20px;
    }
    
    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .video-title {
        font-size: 12px;
        padding: 0 5px;
    }
    
    .play-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
        border-width: 2px;
    }
    
    .youtube-header {
        margin-bottom: 40px;
    }

    .youtube-header .section-headline {
        padding: 0 18px;
    }

    .youtube-header .headline-title {
        font-size: 32px;
    }

    .youtube-header .headline-lead,
    .youtube-header .headline-desc {
        font-size: 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .youtube-section {
        padding: 40px 0;
    }
    
    .youtube-section .container {
        width: 95% !important;
        max-width: none !important;
        padding: 0 15px;
    }

    .youtube-header .section-headline {
        padding: 0 16px;
    }
    
    .video-title {
        font-size: 11px;
        padding: 0 3px;
    }
    
    .play-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border-width: 2px;
    }
    
    .youtube-header .headline-title {
        font-size: 26px;
    }

    .youtube-header .headline-lead,
    .youtube-header .headline-desc {
        font-size: 15px;
    }
}

/* Extra Small Mobile */
@media (max-width: 320px) {
    .youtube-header .section-headline {
        padding: 0 14px;
    }

    .video-title {
        font-size: 10px;
    }

    .play-button {
        width: 35px;
        height: 35px;
        font-size: 14px;
        border-width: 1px;
    }
    
    .youtube-header .headline-title {
        font-size: 22px;
    }
    
    .youtube-header .headline-lead,
    .youtube-header .headline-desc {
        font-size: 14px;
    }
}

/* Bootstrap Grid Override for Mobile 2-column layout */
@media (max-width: 767px) {
    .youtube-grid .row .col-lg-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .youtube-grid .row .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ============================================
   YOUTUBE MODAL - 완전 독립적인 스타일링
   ============================================ */

/* 유튜브 모달 - 다른 모든 섹션과 완전 분리 */
#youtubeModal.youtube-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important; /* 최대 z-index 값 */
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

#youtubeModal.youtube-modal.show {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#youtubeModal .modal-backdrop {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    /* backdrop-filter 완전 제거 */
}

#youtubeModal .modal-content {
    position: relative !important;
    width: 90% !important;
    max-width: 1200px !important;
    height: 90% !important;
    max-height: 675px !important; /* 16:9 비율 유지 */
    margin: auto !important;
    background-color: #000 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
    z-index: 2 !important;
    pointer-events: auto !important;
    border-radius: 8px !important;
    padding: 0 !important;
    border: none !important;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#youtubeModal .close-btn {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: rgba(0, 0, 0, 0.9) !important;
    border: 2px solid white !important;
    color: white !important;
    font-size: 28px !important;
    width: 50px !important;
    height: 50px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    font-weight: bold !important;
    line-height: 1 !important;
    z-index: 2147483646 !important; /* 최대값 - 1 */
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

#youtubeModal .close-btn:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    color: black !important;
    transform: scale(1.1) !important;
}

#youtubeModal .modal-body {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

#youtubeModal .video-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 3 !important;
    /* 16:9 비율 강제 적용 */
    aspect-ratio: 16/9 !important;
}

#youtubeModal .video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    z-index: 4 !important;
    pointer-events: auto !important;
    /* 유튜브 영상 완전 선명도 보장 */
    filter: none !important;
    transform: none !important;
    opacity: 1 !important;
    background: #000 !important;
    /* 모든 브라우저 호환성 */
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -ms-filter: none !important;
}

#youtubeModal .close-button {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: #000 !important;
    color: white !important;
    border: 2px solid white !important;
    padding: 15px 40px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: 'GmarketSans', sans-serif !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    z-index: 2147483646 !important; /* 최대값 - 1 */
    border-radius: 4px !important;
    margin: 0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

#youtubeModal .close-button:hover {
    background-color: white !important;
    color: black !important;
    transform: translateX(-50%) translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3) !important;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 85%;
        max-height: 400px;
    }
    
    .close-btn {
        width: 45px;
        height: 45px;
        font-size: 26px;
        top: 15px;
        right: 15px;
    }
    
    .close-button {
        padding: 12px 30px;
        font-size: 16px;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        height: 80%;
        max-height: 300px;
    }
    
    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 22px;
        top: 10px;
        right: 10px;
    }
    
    .close-button {
        padding: 10px 25px;
        font-size: 14px;
        bottom: 15px;
    }
}

/* 유튜브 모달 반응형 - 완전 분리 (기존 스타일 오버라이드) */
@media (max-width: 768px) {
    #youtubeModal .modal-content {
        width: 95% !important;
        height: 85% !important;
        max-height: 400px !important;
    }
    
    #youtubeModal .close-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 26px !important;
        top: 15px !important;
        right: 15px !important;
    }
    
    #youtubeModal .close-button {
        padding: 12px 30px !important;
        font-size: 16px !important;
        bottom: 20px !important;
    }
}

@media (max-width: 480px) {
    #youtubeModal .modal-content {
        width: 98% !important;
        height: 80% !important;
        max-height: 300px !important;
    }
    
    #youtubeModal .close-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
        top: 10px !important;
        right: 10px !important;
    }
    
    #youtubeModal .close-button {
        padding: 10px 25px !important;
        font-size: 14px !important;
        bottom: 15px !important;
    }
}
