/**
 * LivePicksPro - 팝업 스타일
 * v1.0
 */

/* 팝업 래퍼 - 화면 전체 덮음 */
#lp-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* 개별 팝업 */
.lp-popup {
    position: fixed;
    pointer-events: auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: none; /* JS로 표시 */
    flex-direction: column;
    overflow: hidden;
    width: var(--popup-w-pc);
    max-width: 95vw;
    max-height: 90vh;
}

/* 위치별 배치 */
.lp-popup.lp-popup-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.lp-popup.lp-popup-top-left {
    top: 20px;
    left: 20px;
}
.lp-popup.lp-popup-top-right {
    top: 20px;
    right: 20px;
}
.lp-popup.lp-popup-bottom-left {
    bottom: 20px;
    left: 20px;
}
.lp-popup.lp-popup-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* 활성 표시 */
.lp-popup.is-visible {
    display: flex;
    animation: lp-popup-fadein 0.3s ease-out;
}

@keyframes lp-popup-fadein {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.lp-popup.lp-popup-top-left.is-visible,
.lp-popup.lp-popup-top-right.is-visible,
.lp-popup.lp-popup-bottom-left.is-visible,
.lp-popup.lp-popup-bottom-right.is-visible {
    animation: lp-popup-slidein 0.3s ease-out;
}

@keyframes lp-popup-slidein {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 팝업 콘텐츠 영역 */
.lp-popup-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    height: var(--popup-h-pc);
    max-height: calc(90vh - 50px);
}

/* X 닫기 버튼 (우상단) */
.lp-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
}
.lp-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 링크 영역 */
.lp-popup-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* 이미지 */
.lp-popup-image {
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}
.lp-popup-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 본문 텍스트 */
.lp-popup-text {
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-break: keep-all;
}

/* 푸터 (하단 컨트롤) */
.lp-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.lp-popup-today {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}
.lp-popup-today input[type=checkbox] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.lp-popup-close-btn {
    background: #444;
    color: #fff;
    border: 0;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.lp-popup-close-btn:hover {
    background: #222;
}

/* 모바일 반응형 */
@media (max-width: 640px) {
    .lp-popup {
        width: var(--popup-w-mobile) !important;
        max-width: 95vw;
    }
    
    .lp-popup.lp-popup-center {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .lp-popup.lp-popup-top-left,
    .lp-popup.lp-popup-top-right {
        top: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .lp-popup.lp-popup-bottom-left,
    .lp-popup.lp-popup-bottom-right {
        bottom: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .lp-popup-content {
        height: auto;
        max-height: 70vh;
    }
    
    .lp-popup-footer {
        padding: 8px 12px;
    }
    
    .lp-popup-today {
        font-size: 12px;
    }
}

/* 여러 팝업이 동시에 표시될 때 위치 오프셋 */
.lp-popup[data-popup-index="1"] { margin-left: 30px; margin-top: 30px; }
.lp-popup[data-popup-index="2"] { margin-left: 60px; margin-top: 60px; }
.lp-popup[data-popup-index="3"] { margin-left: 90px; margin-top: 90px; }

@media (max-width: 640px) {
    .lp-popup[data-popup-index] {
        margin-left: 0;
        margin-top: 0;
    }
}
