/* ═══════════════════════════════════════════════════════════════
   마골 팬페이지 - 팝업 CSS
   assets/css/popup.css
   ═══════════════════════════════════════════════════════════════ */

/* ── 팝업 공통 ────────────────────────────────────────────────── */
._pop_wrap {
    position: fixed;
    z-index: 500;
    /* 초기 렌더링 시 깜빡임 방지 - JS에서 위치 설정 후 표시 */
    visibility: hidden;
    opacity: 0;
}

/* JS가 위치 설정 완료 후 _pop_ready 클래스 추가 시 표시 */
._pop_wrap._pop_ready {
    visibility: visible;
    animation: _pop_in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes _pop_in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

._pop_wrap._pop_closing {
    animation: _pop_out 0.2s ease forwards;
}

@keyframes _pop_out {
    to { opacity: 0; transform: scale(0.95) translateY(4px); }
}

/* ── 위치별 ────────────────────────────────────────────────────── */
._pop_wrap[data-pos="center"] {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 480px;
    width: calc(100% - 40px);
}

._pop_wrap[data-pos="center"]._pop_closing {
    animation: _pop_out_center 0.2s ease forwards;
}

@keyframes _pop_out_center {
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
}

._pop_wrap[data-pos="bottom_right"] {
    bottom: 80px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
}

._pop_wrap[data-pos="bottom_left"] {
    bottom: 80px;
    left: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
}

._pop_wrap[data-pos="top_banner"] {
    top: 64px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0 !important;
}

._pop_wrap[data-pos="bottom_banner"] {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0 !important;
}

/* ── 팝업 박스 ────────────────────────────────────────────────── */
._pop_box {
    position: relative;
    background-color: #1a1510;
    border: 1px solid #3d2e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

._pop_wrap[data-pos="top_banner"] ._pop_box,
._pop_wrap[data-pos="bottom_banner"] ._pop_box {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

/* ── 닫기 버튼 ────────────────────────────────────────────────── */
._pop_close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
}

._pop_close:hover {
    background-color: rgba(196,28,28,0.7);
}

/* ── 이미지 영역 ──────────────────────────────────────────────── */
._pop_img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

._pop_wrap[data-pos="top_banner"] ._pop_img,
._pop_wrap[data-pos="bottom_banner"] ._pop_img {
    max-height: 80px;
}

/* ── 텍스트 영역 ──────────────────────────────────────────────── */
._pop_body {
    padding: 16px 18px;
}

._pop_body ._pb_title {
    font-size: 16px;
    font-weight: 800;
    color: #d4c4a0;
    margin-bottom: 6px;
    line-height: 1.4;
}

._pop_body ._pb_content {
    font-size: 13px;
    color: #8a7a62;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ── 하단 바 (24시간 보지 않기 + 닫기) ───────────────────────── */
._pop_footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid #2a1e10;
    background-color: #120f0a;
}

._pop_footer ._pf_hide {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

._pop_footer ._pf_hide input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #c41c1c;
}

._pop_footer ._pf_hide label {
    font-size: 12px;
    color: #5a4a32;
    cursor: pointer;
    user-select: none;
}

._pop_footer ._pf_close_btn {
    font-size: 12px;
    color: #5a4a32;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

._pop_footer ._pf_close_btn:hover {
    color: #8a7a62;
}

/* ── 배너형 (가로 레이아웃) ─────────────────────────────────── */
._pop_wrap[data-pos="top_banner"] ._pop_box,
._pop_wrap[data-pos="bottom_banner"] ._pop_box {
    display: flex;
    align-items: center;
}

._pop_wrap[data-pos="top_banner"] ._pop_body,
._pop_wrap[data-pos="bottom_banner"] ._pop_body {
    flex: 1;
    padding: 10px 40px 10px 16px;
}

._pop_wrap[data-pos="top_banner"] ._pb_title,
._pop_wrap[data-pos="bottom_banner"] ._pb_title {
    font-size: 14px;
    margin-bottom: 2px;
}

._pop_wrap[data-pos="top_banner"] ._pb_content,
._pop_wrap[data-pos="bottom_banner"] ._pb_content {
    font-size: 12px;
}

._pop_wrap[data-pos="top_banner"] ._pop_footer,
._pop_wrap[data-pos="bottom_banner"] ._pop_footer {
    border-top: none;
    border-left: 1px solid #2a1e10;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    min-width: 120px;
    background: transparent;
}

/* 오버레이 없음 */

/* ── 라이트모드 ─────────────────────────────────────────────── */
body._lm ._pop_box {
    background-color: #ffffff;
    border-color: #dde1ea;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

body._lm ._pop_body ._pb_title {
    color: #1a1d27;
}

body._lm ._pop_body ._pb_content {
    color: #5a6070;
}

body._lm ._pop_footer {
    background-color: #f4f6fa;
    border-top-color: #dde1ea;
}

body._lm ._pop_footer ._pf_hide label,
body._lm ._pop_footer ._pf_close_btn {
    color: #8a95a8;
}

body._lm ._pop_close {
    background-color: rgba(0,0,0,0.15);
    border-color: rgba(0,0,0,0.1);
    color: #1a1d27;
}

/* ── 반응형 ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    ._pop_wrap[data-pos="center"] {
        max-width: calc(100vw - 24px);
    }
    ._pop_wrap[data-pos="bottom_right"],
    ._pop_wrap[data-pos="bottom_left"] {
        width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
    }
}