@charset "utf-8";

/* ========================================
   팝업 레이어 모달 스타일
   외부 CSS 차단 + 인라인 스타일 완전 우선
   ======================================== */

/* 팝업 컨테이너 - 최상위 격리 */
#hd_pop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

#hd_pop h2 {
    position: absolute !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
    text-indent: -9999px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 개별 팝업 박스 - 외곽 틀만 강제 */
.hd_pops {
    position: fixed !important;
    display: none !important;
    flex-direction: column !important;
    z-index: 99999 !important;
    background: #fff !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    margin: 0 !important;
    font-family: 'Malgun Gothic', '맑은 고딕', 'Pretendard-Regular', sans-serif !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    transform: translateZ(0) !important;
}

.hd_pops.show {
    display: flex !important;
    animation: popupFadeInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 팝업 내용 래퍼 - 외부 CSS 차단용 */
.hd_pops_con_wrapper {
    display: block !important;
    flex: 1 !important;
    position: relative;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: #fff;
    isolation: isolate; /* 새로운 포맷 컨텍스트 생성으로 외부 CSS 차단 */
}

/* ========================================
   팝업 콘텐츠 영역 - 인라인 스타일 최우선
   !important 절대 사용 금지
   ======================================== */

.hd_pops_con {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    /* 기본 값만 제공, 인라인 스타일로 덮어쓰기 가능 */
    padding: 32px;
    background: #fff;
    line-height: 1.7;
    margin: 0;
    color: #1f2937;
    font-family: 'Malgun Gothic', '맑은 고딕', 'Pretendard-Regular', sans-serif;
    font-size: 15px;
}

/* 모든 자식 요소 - 박스모델만 고정 */
.hd_pops_con * {
    box-sizing: border-box;
}

/* ========================================
   타이포그래피 기본값 - 인라인 스타일로 덮어쓰기 가능
   ======================================== */

.hd_pops_con h1 {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 16px 0;
    color: #111827;
}

.hd_pops_con h2 {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 16px 0;
    color: #111827;
}

.hd_pops_con h3 {
    display: block;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 14px 0;
    color: #111827;
}

.hd_pops_con h4 {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 12px 0;
    color: #111827;
}

.hd_pops_con h5 {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 12px 0;
    color: #111827;
}

.hd_pops_con h6 {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 10px 0;
    color: #111827;
}

.hd_pops_con p {
    display: block;
    margin: 0 0 16px 0;
    line-height: 1.7;
    color: #4b5563;
    font-size: 15px;
}

.hd_pops_con div {
    display: block;
}

.hd_pops_con span {
    display: inline;
}

.hd_pops_con strong,
.hd_pops_con b {
    font-weight: 700;
}

.hd_pops_con em,
.hd_pops_con i {
    font-style: italic;
}

.hd_pops_con a {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
}

.hd_pops_con a:hover {
    color: #1d4ed8;
}

.hd_pops_con img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}

.hd_pops_con br {
    display: block;
}

.hd_pops_con hr {
    display: block;
    margin: 20px 0;
    border: 0;
    height: 1px;
    background: #e5e7eb;
}

.hd_pops_con ul,
.hd_pops_con ol {
    display: block;
    margin: 0 0 16px 24px;
    padding: 0;
    list-style-position: outside;
}

.hd_pops_con ul {
    list-style-type: disc;
}

.hd_pops_con ol {
    list-style-type: decimal;
}

.hd_pops_con li {
    display: list-item;
    margin-bottom: 8px;
    line-height: 1.6;
    color: #4b5563;
    font-size: 15px;
}

.hd_pops_con table {
    display: table;
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.hd_pops_con thead {
    display: table-header-group;
}

.hd_pops_con tbody {
    display: table-row-group;
}

.hd_pops_con tr {
    display: table-row;
}

.hd_pops_con th,
.hd_pops_con td {
    display: table-cell;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
    color: #4b5563;
}

.hd_pops_con th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.hd_pops_con button {
    cursor: pointer;
}

/* ========================================
   스크롤바 스타일
   ======================================== */

.hd_pops_con::-webkit-scrollbar {
    width: 6px;
}

.hd_pops_con::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.hd_pops_con::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 10px;
}

.hd_pops_con::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

/* ========================================
   팝업 푸터 - !important 사용 (구조 고정)
   ======================================== */

.hd_pops_footer {
    flex-shrink: 0 !important;
    display: flex !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    background: linear-gradient(to bottom, #fafbfc 0%, #f5f6f8 100%) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
}

.hd_pops_footer button {
    flex: 1 !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    letter-spacing: -0.3px !important;
    line-height: 1.4 !important;
}

.hd_pops_footer button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.hd_pops_footer button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* 24시간 보지 않기 버튼 */
.hd_pops_footer .hd_pops_reject {
    background: #6c757d !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.hd_pops_footer .hd_pops_reject:hover {
    background: #5a6268 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.hd_pops_reject strong {
    font-weight: 700 !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* 닫기 버튼 */
.hd_pops_footer .hd_pops_close {
    background: #fff !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.hd_pops_footer .hd_pops_close:hover {
    background: #f8f9fa !important;
    border-color: #adb5bd !important;
}

.hd_pops_close span {
    margin-left: 4px !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

/* 오른쪽 상단 X 버튼 */
.hd_pops_close_top {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #6c757d !important;
    font-size: 16px !important;
}

.hd_pops_close_top:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #495057 !important;
    transform: rotate(90deg) !important;
}

/* ========================================
   모달 타입 팝업
   ======================================== */

.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 99998 !important;
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.modal-overlay.show {
    display: flex !important;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hd_pops.modal-type {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
}

/* ========================================
   애니메이션
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popupFadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   반응형 디자인
   ======================================== */

@media (max-width: 768px) {
    .hd_pops {
        max-width: 90vw !important;
        max-height: 85vh !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        border-radius: 12px !important;
    }

    .hd_pops_con {
        padding: 24px;
        font-size: 14px;
    }

    .hd_pops_footer {
        flex-direction: column !important;
        padding: 16px 20px !important;
        gap: 10px !important;
    }

    .hd_pops_footer button {
        width: 100% !important;
        padding: 12px 16px !important;
    }
}

@media (max-width: 480px) {
    .hd_pops {
        max-width: 95vw !important;
        max-height: 90vh !important;
        border-radius: 12px !important;
    }

    .hd_pops_con {
        padding: 20px;
        font-size: 14px;
    }

    .hd_pops_con h1 {
        font-size: 22px;
    }

    .hd_pops_con h2 {
        font-size: 20px;
    }

    .hd_pops_con h3 {
        font-size: 18px;
    }

    padding: 14px 16px !important;
    gap: 8px !important;
}

.hd_pops_footer button {
    font-size: 13px !important;
    padding: 12px 14px !important;
}

/* ========================================
   접근성
   ======================================== */

.hd_pops_footer button:focus {
    outline: 2px solid #007bff !important;
    outline-offset: 2px !important;
}

.hd_pops_footer button:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
}
