/* 팝업 오버레이 배경 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.popup-overlay.active {
    display: flex;
}

/* 팝업 콘텐츠 컨테이너 - 중앙 정렬 */
.popup-container {
    position: relative;
    margin: auto;
    max-width: 400px;
    width: 100%;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* 팝업 콘텐츠 */
.popup-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* 팝업 헤더 */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.popup-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-header-left input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.popup-header-left label {
    margin: 0;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.popup-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
    line-height: 1;
}

.popup-close-btn:hover {
    color: #000;
}

/* 팝업 본문 */
.popup-body {
    padding: 0;
    overflow-y: auto;
}

.popup-body img {
    width: 100%;
    height: auto;
    display: block;
}

.popup-body a {
    display: block;
    text-decoration: none;
}

/* 애니메이션 */
@keyframes popupSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .popup-overlay {
        padding: 15px;
    }

    .popup-container {
        max-width: 100%;
        max-height: calc(100vh - 30px);
    }

    .popup-header {
        padding: 12px 15px;
    }

    .popup-header-left label {
        font-size: 13px;
    }

    .popup-close-btn {
        font-size: 18px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .popup-overlay {
        padding: 10px;
    }

    .popup-container {
        max-height: calc(100vh - 20px);
    }

    .popup-header {
        padding: 10px 12px;
    }

    .popup-header-left label {
        font-size: 12px;
    }

    .popup-header-left input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

/* 스크롤바 스타일 */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 이달의 보험상품 업데이트 예정일 배너 — 한 줄 레이아웃 */
.update-banner-link {
    display: block;
    width: 100%;
    height: auto;
    background-color: #3478c1;
    border-radius: 22px;
    padding: 14px 22px;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(52, 120, 193, 0.35), 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.update-banner-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(52, 120, 193, 0.45), 0 3px 8px rgba(0, 0, 0, 0.1);
    color: #ffffff;
}

.update-banner-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.update-banner-cluster {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}

.update-banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}

.update-banner-icon .fa {
    font-size: 19px;
    color: #ffffff;
}

.update-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.update-banner-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #ffffff;
}

.update-banner-sub {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.92);
}

.update-banner-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.update-banner-pill-arrow {
    font-size: 9px;
    margin-left: 1px;
    line-height: 1;
    transform: translateY(0.5px);
}

.update-banner-link:hover .update-banner-pill {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

@media (max-width: 480px) {
    .update-banner-link {
        padding: 12px 16px;
        border-radius: 18px;
    }

    .update-banner-inner {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .update-banner-pill {
        width: 100%;
        margin-top: 4px;
    }

    .update-banner-title {
        font-size: 15px;
    }

    .update-banner-sub {
        font-size: 11px;
    }

    .update-banner-icon {
        width: 40px;
        height: 40px;
    }

    .update-banner-icon .fa {
        font-size: 17px;
    }
}

/* 유튜브 배너 물결 효과 */
.youtube-banner-wave {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #ff4b2b, #ff416c);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 호버 효과 */
.youtube-banner-wave:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 75, 43, 0.4) !important;
    background: linear-gradient(90deg, #ff5c3d, #ff5270) !important;
    color: #ffffff !important;
}

.youtube-banner-wave:hover::before {
    animation-duration: 8s;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255,255,255,0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.youtube-banner-wave:hover::after {
    animation-duration: 10s;
    background: 
        radial-gradient(circle at 60% 40%, rgba(255,255,255,0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255,255,255,0.18) 0%, transparent 50%);
}

/* 호버 시 내부 요소 효과 */
.youtube-banner-wave:hover .youtube-icon {
    transform: scale(1.15) rotate(5deg);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.youtube-banner-wave:hover .youtube-button {
    background: rgba(255,255,255,0.3) !important;
    transform: translateX(5px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255,255,255,0.2);
}

/* 호버 시 텍스트 약간 밝게 */
.youtube-banner-wave:hover div {
    opacity: 1 !important;
    transition: opacity 0.3s ease;
}

.youtube-banner-wave::before {
    content: '';
    position: absolute;
    width: 400%;
    height: 400%;
    top: -150%;
    left: -150%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: wave-animation-1 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.youtube-banner-wave::after {
    content: '';
    position: absolute;
    width: 400%;
    height: 400%;
    top: -150%;
    left: -150%;
    background: 
        radial-gradient(circle at 60% 40%, rgba(255,255,255,0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: wave-animation-2 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes wave-animation-1 {
    0% {
        transform: translate(0%, 0%) rotate(0deg);
    }
    25% {
        transform: translate(10%, 15%) rotate(90deg);
    }
    50% {
        transform: translate(0%, 30%) rotate(180deg);
    }
    75% {
        transform: translate(-10%, 15%) rotate(270deg);
    }
    100% {
        transform: translate(0%, 0%) rotate(360deg);
    }
}

@keyframes wave-animation-2 {
    0% {
        transform: translate(0%, 0%) rotate(0deg);
    }
    33% {
        transform: translate(-15%, 10%) rotate(120deg);
    }
    66% {
        transform: translate(15%, -10%) rotate(240deg);
    }
    100% {
        transform: translate(0%, 0%) rotate(360deg);
    }
}

/* 활용법 동영상 배너 — 버튼 이미지(edu_but_*)만 사용 */
.video-guide-wave {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    background-color: #eef5fb;
    border-radius: 14px;
    padding: 8px 10px;
    position: relative;
    overflow: hidden;
}

/* 유튜브 배너와 동일한 물결 배경 애니메이션 */
.video-guide-wave::before {
    content: '';
    position: absolute;
    width: 400%;
    height: 400%;
    top: -150%;
    left: -150%;
    background:
        radial-gradient(circle at 30% 30%, rgba(197, 221, 255, 0.599) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.834) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    animation: wave-animation-1 10s ease-in-out infinite;
    animation-play-state: running;
    pointer-events: none;
    z-index: 1;
}

.video-guide-wave::after {
    content: '';
    position: absolute;
    width: 400%;
    height: 400%;
    top: -150%;
    left: -150%;
    background:
        radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: wave-animation-2 12s ease-in-out infinite;
    animation-play-state: running;
    pointer-events: none;
    z-index: 1;
}

.video-guide-wave-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 2;
    /* 세로 stretch 방지 — 너비에 맞춘 aspect-ratio 높이 유지 */
    align-items: flex-start;
}

/* 로그인 등 — 초보/전문가 버튼 세로 배치 */
.video-guide-wave--compact {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
}

.video-guide-wave-actions.video-guide-wave-actions--stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.video-guide-wave-actions.video-guide-wave-actions--stacked .video-guide-btn {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
}

.video-guide-btn {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    display: block;
    width: auto;
    height: auto;
    aspect-ratio: 740 / 603;
    border-radius: 10px;
    border: 0;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.video-guide-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    opacity: 0.96;
}

.video-guide-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 3px;
}

/* PNG 원본 비율 740×603 (초보/전문 동일) — 박스 높이가 이미지와 일치 */
.video-guide-btn-beginner {
    background-image: url("https://dev.bojang114.com/assets/images/content/edu_but_beginner.png");
}

.video-guide-btn-pro {
    background-image: url("https://dev.bojang114.com/assets/images/content/edu_but_pro.png");
}

.video-guide-btn-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 전문가 영상 목록 모달 — 뷰포트 가로·세로 중앙
   닫힘 시 Bootstrap이 .in 을 먼저 제거하므로, 중앙 정렬은 body.modal-open 인 동안만 유지해야
   닫기 애니메이션 중 다이얼로그가 위로 붙는 현상이 나지 않음 */
body.modal-open #videoGuideListModal.video-guide-modal--expert {
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 15px;
}

#videoGuideListModal.video-guide-modal--expert.fade .modal-dialog,
#videoGuideListModal.video-guide-modal--expert.modal.in .modal-dialog {
    -webkit-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    -o-transform: translate(0, 0);
    transform: translate(0, 0);
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 0;
    max-width: calc(100vw - 30px);
}

/* 전문가 영상 목록 모달 — 블루 톤 */
#videoGuideListModal.video-guide-modal--expert .modal-content {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(12, 103, 153, 0.22);
}

#videoGuideListModal.video-guide-modal--expert .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(90deg, #0c6799, #1a7fd4);
    color: #ffffff;
    border-bottom: none;
    padding: 14px 18px;
}

#videoGuideListModal.video-guide-modal--expert .modal-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-right: 4px;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.35;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-close {
    float: none;
    flex-shrink: 0;
    align-self: center;
    margin: 0;
    padding: 4px 6px;
    line-height: 1;
    color: #ffffff;
    opacity: 0.92;
    text-shadow: none;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-close:hover,
#videoGuideListModal.video-guide-modal--expert .video-guide-close:focus {
    color: #ffffff;
    opacity: 1;
}

#videoGuideListModal.video-guide-modal--expert .modal-body {
    background: #eef5fb;
    padding-top: 18px;
    padding-bottom: 20px;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-grid {
    display: grid;
    gap: 14px;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(12, 103, 153, 0.22);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(12, 103, 153, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-card:hover,
#videoGuideListModal.video-guide-modal--expert .video-guide-card:focus {
    border-color: rgba(12, 103, 153, 0.45);
    box-shadow: 0 6px 16px rgba(12, 103, 153, 0.16);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

/* 16:9 고정 + cover: oEmbed로 src 교체 시(다른 해상도) 레이아웃이 줄어드는 현상 방지 */
#videoGuideListModal.video-guide-modal--expert .video-guide-thumb-wrap {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #dceaf5;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-card-body {
    padding: 12px 14px;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-title-text {
    color: #0c3550;
    font-weight: 600;
}

#videoGuideListModal.video-guide-modal--expert .video-guide-link-text {
    color: #0c6799;
    font-weight: 700;
    margin-top: 6px;
}

