/* Firebase 팝업 스타일 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.popup-overlay.show {
    opacity: 1;
}

.popup-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.show .popup-container {
    transform: scale(1);
}

/* 위치 클래스 */
.popup-center {
    /* 기본값 */
}

.popup-top {
    align-self: flex-start;
    margin-top: 50px;
}

.popup-bottom {
    align-self: flex-end;
    margin-bottom: 50px;
}

.popup-top-left {
    position: absolute;
    top: 50px;
    left: 50px;
}

.popup-top-right {
    position: absolute;
    top: 50px;
    right: 50px;
}

.popup-bottom-left {
    position: absolute;
    bottom: 50px;
    left: 50px;
}

.popup-bottom-right {
    position: absolute;
    bottom: 50px;
    right: 50px;
}

/* 닫기 버튼 */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popup-close:hover {
    background: white;
    transform: rotate(90deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.popup-close svg {
    width: 20px;
    height: 20px;
    stroke: #333;
}

/* 팝업 본문 */
.popup-body {
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

.popup-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.popup-link-wrapper {
    display: block;
    cursor: pointer;
}

.popup-content {
    padding: 25px;
}

.popup-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.3;
}

.popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
}

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

.popup-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    user-select: none;
}

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

.popup-checkbox:hover {
    color: #333;
}

.popup-button {
    padding: 10px 24px;
    background: #2c5aa0;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.popup-button:hover {
    background: #1e4080;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

/* 반응형 */
@media (max-width: 768px) {
    .popup-container {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .popup-top-left,
    .popup-top-right,
    .popup-bottom-left,
    .popup-bottom-right {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
    }
    
    .popup-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .popup-checkbox {
        width: 100%;
    }
    
    .popup-button {
        width: 100%;
        text-align: center;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .popup-text {
        font-size: 14px;
    }
}

/* 전체화면 모드 */
.popup-container[style*="width: 100%"] {
    border-radius: 0;
    margin: 0;
}

.popup-container[style*="width: 100%"] .popup-image {
    height: 100vh;
    object-fit: contain;
}

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

.popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

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

.popup-container {
    animation: popupSlideIn 0.3s ease;
}

/* 로딩 상태 */
.popup-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.popup-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
