/* ============================================
   사용자 팝업 컴포넌트 스타일
   ============================================ */

/* 팝업 오버레이 (배경) */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: popupFadeIn 0.3s ease;
}

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

/* 팝업 컨테이너 (여러 팝업을 겹쳐서 표시) */
.popup-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 개별 팝업 박스 */
.popup-box {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 팝업 겹침 효과 - 각 팝업마다 약간씩 위치 조정 */
.popup-box:nth-child(1) { z-index: 10; }
.popup-box:nth-child(2) { z-index: 9; transform: translate(15px, 15px); }
.popup-box:nth-child(3) { z-index: 8; transform: translate(30px, 30px); }
.popup-box:nth-child(4) { z-index: 7; transform: translate(45px, 45px); }
.popup-box:nth-child(5) { z-index: 6; transform: translate(60px, 60px); }

/* 팝업 헤더 */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #f9fafb;
}

.popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 닫기 버튼 */
.popup-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.popup-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 팝업 본문 */
.popup-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
}

/* 팝업 내용 스타일 */
.popup-content {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

.popup-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.popup-content p {
    margin: 0 0 12px 0;
}

.popup-content p:last-child {
    margin-bottom: 0;
}

/* 팝업 푸터 */
.popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #f9fafb;
}

/* 오늘 하루 보지 않기 체크박스 */
.popup-today-hide {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.popup-today-hide input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #d51e26;
}

.popup-today-hide span {
    font-size: 14px;
    color: #6b7280;
}

/* 푸터 버튼 그룹 */
.popup-footer-buttons {
    display: flex;
    gap: 8px;
}

/* 팝업 버튼 */
.popup-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-btn-close {
    background: #e5e7eb;
    color: #374151;
}

.popup-btn-close:hover {
    background: #d1d5db;
}

.popup-btn-primary {
    background: #d51e26;
    color: #fff;
}

.popup-btn-primary:hover {
    background: #b81820;
}

/* 팝업 인디케이터 (여러 개일 때) */
.popup-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.popup-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-indicator-dot.active {
    background: #fff;
    transform: scale(1.2);
}

/* 팝업 카운터 (n/전체) */
.popup-counter {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   반응형 스타일
   ============================================ */
@media (max-width: 768px) {
    .popup-overlay {
        padding: 16px;
    }

    .popup-box {
        max-width: 100%;
        width: 100%;
        max-height: 85vh;
    }

    /* 모바일에서는 겹침 효과 줄임 */
    .popup-box:nth-child(2) { transform: translate(8px, 8px); }
    .popup-box:nth-child(3) { transform: translate(16px, 16px); }
    .popup-box:nth-child(4) { transform: translate(24px, 24px); }
    .popup-box:nth-child(5) { transform: translate(32px, 32px); }

    .popup-header {
        padding: 14px 16px;
    }

    .popup-title {
        font-size: 16px;
    }

    .popup-body {
        padding: 16px;
        max-height: 55vh;
    }

    .popup-content {
        font-size: 14px;
    }

    .popup-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .popup-today-hide {
        width: 100%;
        justify-content: center;
    }

    .popup-footer-buttons {
        width: 100%;
    }

    .popup-btn {
        flex: 1;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .popup-counter {
        top: -35px;
        font-size: 12px;
        padding: 5px 12px;
    }
}
