/* 팝업 시스템 CSS */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.popup-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
    align-items: center;
}

/* 모바일 모드별 스타일은 JavaScript에서 동적으로 적용 */

.popup-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    position: absolute;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: popupFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
}

.popup-item.dragging {
    cursor: grabbing;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.popup-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    cursor: move;
    flex: 1;
    padding-right: 20px;
}

/* 모바일에서는 드래그 커서 제거 */
@media (max-width: 768px) {
    .popup-title {
        cursor: default;
    }
}

.popup-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close-btn:hover {
    background: #f5f5f5;
    color: #666;
}

.popup-content {
    padding: 28px;
    color: #333;
}

.popup-content.dark-theme {
    color: #e0e0e0;
}

.popup-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.popup-content p {
    margin: 0 0 15px 0;
    line-height: 1.7;
    font-size: 15px;
    color: inherit;
}

.popup-content p:last-child {
    margin-bottom: 0;
}

.popup-content strong {
    color: #009393;
    font-weight: 700;
}

.popup-content a {
    color: #009393;
    text-decoration: none;
}

.popup-content a:hover {
    text-decoration: underline;
}

.popup-footer {
    padding: 24px 28px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.popup-footer-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popup-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.popup-checkbox input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #009393;
}

.popup-checkbox label {
    cursor: pointer;
    user-select: none;
}

.popup-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.popup-btn {
    padding: 14px 28px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
}

.popup-btn:hover {
    background: #f8f8f8;
    border-color: #ccc;
    color: #333;
}

.popup-btn-primary {
    background: #009393;
    border-color: #009393;
    color: #fff;
}

.popup-btn-primary:hover {
    background: #007a7a;
    border-color: #007a7a;
    color: #fff;
}

/* 모바일 추가 스타일 */
@media (max-width: 768px) {
    .popup-footer-content {
        gap: 15px;
    }
    
    .popup-buttons {
        justify-content: center;
    }
    
    .popup-overlay {
        padding: 10px;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .popup-overlay {
        padding: 15px;
    }
    
    .popup-header,
    .popup-content,
    .popup-footer {
        padding: 20px;
    }
    
    .popup-title {
        font-size: 16px;
    }
    
    .popup-content p {
        font-size: 14px;
    }
}
